257809 Commits

Author SHA1 Message Date
macallan
bea393bbca don't poke GPIOs directly, use obio_*() access functions, now this
has a chance of working on G5 where we can't just BAT-map everything with
paddr == busaddr.
Doesn't play audio yet but things like headphone detection work.
2018-03-24 16:22:48 +00:00
roy
8a9420adee Allow a valid sendto .... duh 2018-03-24 15:51:57 +00:00
mlelstv
76e339c2fc Use separate lock to protect internal state and release locks when
calling biodone.
2018-03-24 08:08:19 +00:00
kre
66b36a0ae7 Make this more automated - no longer requires editing the
script before use.   Also update to reflect a few changes
to procedures that have occurred here and there in the past.
2018-03-24 01:54:48 +00:00
kre
d7ba21a60c Note update to tzdata2018d 2018-03-24 01:52:26 +00:00
kre
398771e150 Merge tzdata2018d 2018-03-24 01:47:49 +00:00
kre
99546511b5 Import tzdata2018d from ftp://ftp.iana.org/tz/releases/tzdata2018d.tar.gz
Summary of changes in tzdata2018d (2018-03-22 07:05:46 -0700):

	In 2018, Palestine starts DST on March 24 (today!), not March 31

	Casey Station in Antarctica changed from +11 to +08 on 2018-03-11
	at 04:00.

	Various adjustments to some historical conversions (several for
	Uruguay (1920 .. 1990), one fpr Enderbury and Kiritimati (1994/5),
	one for Portugal and colonies (1912) and Jamaica and Turks & Caicos
	(pre 1913)).
2018-03-24 01:45:23 +00:00
kamil
75b6fdf893 Revert previous commit in st.c in order to unbreak build
There are various build errors like:
/usr/src/sys/dev/scsipi/st.c: In function 'stattach':
/usr/src/sys/dev/scsipi/st.c:398:16: error: 'struct st_softc'
has no member named 'buf_defer'; did you mean 'buf_queue'?
  bufq_alloc(&st->buf_defer, "fcfs", 0);

Original (reverted) commit:
  Use separate lock to protect internal state and release locks when
  calling biodone.
2018-03-24 01:45:22 +00:00
kre
6041acfc85 Import tzdata2018d from ftp://ftp.iana.org/tz/releases/tzdata2018d.tar.gz
Summary of changes in tzdata2018d (2018-03-22 07:05:46 -0700):

	In 2018, Palestine starts DST on March 24 (today!), not March 31

	Casey Station in Antarctica changed from +11 to +08 on 2018-03-11
	at 04:00.

	Various adjustments to some historical conversions (several for
	Uruguay (1920 .. 1990), one fpr Enderbury and Kiritimati (1994/5),
	one for Portugal and colonies (1912) and Jamaica and Turks & Caicos
	(pre 1913)).
2018-03-24 01:44:51 +00:00
kamil
77dc83fa09 Add new C++ ATF tests
Add new variations for existing C++ tests:
 - Static
 - Profile+32-bit
 - PIC+32-bit
 - PIC+Profile
 - PIC+Profile+32-bit

All tests pass for NetBSD/amd64:
 - t_cxxruntime
 - t_hello
 - t_static_destructor

+--------------------------------------------------------------+
| Options            | cxxruntime | hello  | static_destructor |
+--------------------------------------------------------------+
| None               | Passed     | Passed | Passed            |
| 32-bit             | Passed     | Passed | Passed            |
| PIC                | Passed     | Passed | Passed            |
| PIE                | Passed     | Passed | Passed            |
| Profile            | Passed     | Passed | Passed            |
| Static             | Passed     | Passed | Passed            |
| Profile+32-bit     | Passed     | Passed | Passed            |
| PIC+32-bit         | Passed     | Passed | Passed            |
| PIC+Profile        | Passed     | Passed | Passed            |
| PIC+Profile+32-bit | Passed     | Passed | Passed            |
+--------------------------------------------------------------+

Add new C++11 std::call_once tests:
 - t_call_once
 - t_call_once2

Add new C++11 test with pthread_once(3) and C++ lambda:
 - t_pthread_once

All tests with the profile option for std::call_once and
pthread_once(3) are marked as expected failure (NetBSD/amd64).

Results for *_once*:
+------------------------------------------------------------+
| Options            | call_once | call_once2 | pthread_once |
+------------------------------------------------------------+
| None               | Passed    | Passed     | Passed       |
| 32-bit             | Passed    |  Passed    | Passed       |
| PIC                | Passed    | Passed     | Passed       |
| PIE                | Passed    | Passed     | Passed       |
| Profile            |  Failed   |  Failed    |  Failed      |
| Static             | Passed    | Passed     | Passed       |
| Profile+32-bit     |  Failed   |  Failed    |  Failed      |
| PIC+32-bit         | Passed    | Passed     | Passed       |
| PIC+Profile        |  Failed   |  Failed    |  Failed      |
| PIC+Profile+32-bit |  Failed   |  Failed    |  Failed      |
+------------------------------------------------------------+

Long term there is an option to refacotr the framework for C and C++ tests,
in order to reduce code duplication.

Patches sent by Yang Zheng <tomsun.0.7@gmail.com>
2018-03-24 00:26:51 +00:00
kamil
62ac00a826 Fix a printf(3)-like format in ATF ICMP t_ping.c
Use %zd for ssize_t, instead of %d.
2018-03-24 00:06:32 +00:00
roy
68900ca448 Handle the routing socket overflowing gracefully. 2018-03-23 11:57:33 +00:00
roy
80b75699b5 Note value received. Harden another sendto for ENOBUFS. 2018-03-23 10:05:45 +00:00
jmcneill
1f42c18405 No need to print interrupt status for RX underflow as this status bit is handled already 2018-03-23 09:43:33 +00:00
maxv
b4a2219ed1 Remove #ifdef INET. Nobody is doing that in the kernel, and there are
even IPv4 places that are not covered here.
2018-03-23 09:30:55 +00:00
maxv
5cf0fa574a Improve a bit here and there. Replace bcopy by memcpy/memmove. 2018-03-23 08:57:40 +00:00
maxv
89bd38bf79 In addition to checking L4 in the cache, here we also need to check the
protocol. The NPF entry point does not ensure that

	ICMPv6 can be set only in IPv6
	ICMPv4 can be set only in IPv4

So we could have ICMPv6 in IPv4.
2018-03-23 08:34:57 +00:00
maxv
ca52d20904 If we fail to advance inside TCP/UDP/ICMPv4/ICMPv6, stop pretending L4
is unknown, and error out right away.

This prevents bugs in machinery, if a place looks for L4 in 'npc_proto'
without checking the cache too. I've seen a ~similar problem already.
2018-03-23 08:28:54 +00:00
mlelstv
9fba504861 Use separate lock to protect internal state and release locks when
calling biodone.
2018-03-23 06:01:07 +00:00
ozaki-r
e3a1cd4228 Don't take RT_LOCK in DDB
It definitely causes a diagnostic failure if LOCKDEBUG is enabled.
2018-03-23 04:09:41 +00:00
macallan
06efcc19f8 more oea_mapiodev() 2018-03-22 21:30:34 +00:00
macallan
fa6f69514f sprinkle oea_mapiodev() 2018-03-22 21:28:58 +00:00
macallan
d6676291c5 don't call mapiodev() - the caller should hand us a usable address 2018-03-22 21:27:36 +00:00
macallan
39b0cf8d6c provide a wrapper for mapiodev() - if we have BATs just use the paddr, if
we don't then actually map it
2018-03-22 21:26:27 +00:00
maxv
32b1565b5b Don't pass a pointer to tcp_reass, otherwise it looks like it can modify
tlen while it doesn't.
2018-03-22 21:19:28 +00:00
maxv
032f2a9f7b Rearrange a bit. No real functional change. 2018-03-22 21:10:17 +00:00
maxv
26ff3ae5be Don't call tcp_input_checksum again, it was already called earlier, no
need to checksum twice.

Then call tcp_fields_to_host a bit earlier, so that we don't need to call
it in each branch.
2018-03-22 20:48:38 +00:00
roy
05ee2584ab Handle ENOBUFS in sendto 2018-03-22 17:27:34 +00:00
roy
1875ff6c39 Handle ENOBUFS in recv 2018-03-22 17:16:05 +00:00
macallan
a009f11f27 mapiodev() the CPU reset GPIOs instead of blindly assuming that everything
is BAT-mapped
Now the 2nd CPU on my PowerMac7,3 wakes up and says hi.
2018-03-22 15:23:43 +00:00
macallan
88050f5576 first step towards G5 SMP:
- only save/restore BATs on CPUs that have them
- treat HID0 as 64bit on 64bit CPUs
2018-03-22 15:18:05 +00:00
rin
249f79a6ba Redo previous; reset async events only if scsibus has already been attached. 2018-03-22 14:07:42 +00:00
rin
447b57543d Add njs(4) at pci(4) and cardbus(4). 2018-03-22 12:26:29 +00:00
rin
5bda63cccb Do not call scsipi routines via njsc32_init before scsibus is attached. 2018-03-22 12:20:55 +00:00
maxv
3cd1c7505f Ah, fix compilation. I tested my previous change by loading the kernel
module from the filesystem, but the Makefile didn't have DIAGNOSTIC
enabled, and the two KASSERTs I added did not compile properly.
2018-03-22 12:16:11 +00:00
ozaki-r
57e881a906 Avoid setting IP addresses of the same subnet on different interface
If we do so, there will remain one route that is of a preceding address, but
that behavior is not documented and may be changed in the future.  Tests
shouldn't rely on such a unstable behavior.
2018-03-22 09:21:24 +00:00
maxv
9359913a1f Retrieve the complete IPv4 header right away, and make sure we did retrieve
the IPv6 option header we were iterating on.
2018-03-22 09:04:25 +00:00
ragge
e87eb0355b Let boot relocate to just below 8MB. This solves the problem with
booting a kernel larger than below 4MB.
2018-03-22 08:58:56 +00:00
maxv
b29e387b3d Change npf_cache_all so that it ensures the potential ICMP Query Id is in
the nbuf. In such a way that we don't need to ensure that later.

Change npfa_icmp4_inspect and npfa_icmp6_inspect so that they touch neither
the nbuf nor npc. Adapt their callers accordingly.

In the end, if a packet has a Query Id, we set NPC_ICMP_ID in npc and leave
right away, without recaching npc (not needed since we didn't touch the
nbuf).

This fixes the handling of Query Id packets (that I broke in my previous
commit), and also fixes another possible use-after-free.
2018-03-22 08:57:47 +00:00
maxv
e505ea4416 Fix use-after-free.
The nbuf can be reallocated as a result of caching 'enpc', so it is
necessary to recache 'npc', otherwise it contains pointers to the freed
mbuf - pointers which are then used in the ruleset machinery.

We recache 'npc' when we are sure we won't use 'enpc' anymore, because
'enpc' can be clobbered as a result of caching 'npc' (in other words,
only one of the two can be cached at the same time).

Also, we recache 'npc' unconditionally, because there is no way to know
whether the nbuf got clobbered relatively to it. We can't use the
NBUF_DATAREF_RESET flag, because it is stored in the nbuf and not in the
cache.

Discussed with rmind@.
2018-03-22 07:32:07 +00:00
ragge
2af6320d24 Fix bug causing autoboot on 750/780 not to work. Cleanup. 2018-03-21 18:27:27 +00:00
maxv
06ae03e71b Localify and remove unused prototypes. 2018-03-21 17:03:09 +00:00
maxv
a840b0f6f5 Remove these global variables. They are unused, racy, and the only thing
they do is triggering cache synchronization latencies between CPUs.
2018-03-21 16:26:04 +00:00
macallan
f08bfa866c effectively enforce fan speed limits, deal with negatives properly 2018-03-21 15:41:34 +00:00
maxv
41c8a9b391 Add XXX (we don't handle IPv6 Jumbograms), and whitespace. 2018-03-21 15:36:28 +00:00
maxv
6a2702e705 Fix an untriggerable memory leak. carp_prepare_ad does not fail, so switch
it to void.
2018-03-21 15:33:25 +00:00
roy
38d01a8d5e Sprinkle more soroverflow(). 2018-03-21 14:23:54 +00:00
roy
d96ab75caf Handle ENOBUFS when receiving messages.
Don't send messages if the receiver has died.
2018-03-21 12:37:12 +00:00
wiz
5e9aa3e698 Merge altq(4) HISTORY changes. 2018-03-21 10:21:17 +00:00
wiz
11eb922ab3 Improve HISTORY section. 2018-03-21 10:20:33 +00:00