262854 Commits

Author SHA1 Message Date
jmcneill
1ddc0ea041 Add MSI-X support. 2018-10-31 15:42:17 +00:00
jmcneill
86955039b0 EFI runtime code section needs to be writable, otherwise we fail with a permission fault at shutdown on QEMU when writing to the RTC 2018-10-31 14:15:12 +00:00
jmcneill
77af45ad47 Implement parse_mi_bootargs for aarch64 2018-10-31 13:42:24 +00:00
jmcneill
97044f64fa Use PRIx64 to print uint64_t 2018-10-31 13:37:35 +00:00
jmcneill
77a6cf4b9b Setup mappings for EFI runtime mmio ranges. 2018-10-31 13:01:48 +00:00
jmcneill
1cd5b4302b Assign VAs for EFI runtime mmio ranges 2018-10-31 13:00:35 +00:00
jmcneill
33c6bbfd0f When building /memory, skip EFI runtime memory ranges 2018-10-31 12:59:43 +00:00
skrll
44c3537404 Tidyup VERBOSE_INIT_ARM output 2018-10-31 09:31:01 +00:00
skrll
1f664ade34 Fix VERBOSE_INIT_ARM build 2018-10-31 09:15:25 +00:00
jmcneill
a6043900cb No longer need to delete reserved memory ranges. 2018-10-31 09:13:32 +00:00
skrll
06d47151af Fix non-DIGNOSTIC builds 2018-10-31 08:41:47 +00:00
skrll
dcb7cd7c66 Turn off DIAGNOSTIC and DEBUG by default 2018-10-31 08:10:01 +00:00
ryo
3abdc6b2fd invalidate icache correctly.
l3pte_executable() should be used for only valid pte.
2018-10-31 06:36:19 +00:00
maxv
790d0b797c Move the MI parts of KASAN into kern/subr_asan.c. This file includes
machine/asan.h, which contains the MD functions. We use an include rather
than a plain C file, because we want GCC to optimize/inline some functions
into one single block.

The amd64 MD parts of KASAN are moved accordingly.

The naming convention we use is:

	kasan_*
		a generic kasan object, declared in subr_asan.c
	kasan_md_*
		an MD kasan object, declared in machine/asan.h, and used
		in subr_asan.c
	__md_*
		an MD object, declared in machine/asan.h, and not used
		outside

Overall this makes it easier to add KASAN support on more architectures.

Discussed with several people.
2018-10-31 06:26:25 +00:00
msaitoh
c893fecee0 - 82574 and newer's document says the status field has neither EC
(Excessive Collision) bit nor LC (Late Collision) bit (reserved).
  Refer "PCIe GbE Controller Open Source Software Developer's Manual",
  82574 datasheet and newer.

  XXX I saw the LC bit was set on I218 even though the media was full duplex,
  so the bit might be used for other meaning ...(I have no document).
- Use macro.
2018-10-31 06:04:48 +00:00
jmcneill
6867029f18 Fail gracefully when an attempt to allocate MSI vectors is made on a device
without MSI capabilities.
2018-10-30 23:59:47 +00:00
jmcneill
26bbc56f09 build fdt_memory.c 2018-10-30 22:32:33 +00:00
jmcneill
d377d504e4 Replace extent(9) with our own code to deal with adding and reserving
memory ranges.
2018-10-30 21:32:35 +00:00
kre
3e9d705017 sysctl(KERN_BOOTTIME) is a struct timespec, not struct timeval
and has eben since 2009.    Adapt.

NFCI - while the tv_usec (now tv_nsec) field is used, we will
keep its uses to microsecond precision to avoid any compat issues.
2018-10-30 21:18:39 +00:00
kre
d4305dc776 sysctl(KERN_BOPOTIME) started returning a struct timespec in 2009.
Update to match....    We're slow but we get there eventually!

NFC for any of these programs, struct timeval and struct timespec
are the same size, and only the tv_sec field of boottime is used,
and that's unchanged.
2018-10-30 21:15:09 +00:00
christos
7fe1831b09 no param names in prototype. 2018-10-30 20:23:29 +00:00
christos
91e3572e8f bump for clang 2018-10-30 20:18:30 +00:00
christos
57ce79706b provide a main prototype (this is standalone) 2018-10-30 20:15:57 +00:00
kre
7c12c3f28f Minor update. This already knew that boottime is a timespec.
Just a minor wording change to avoid pretending that time_t
variables contain nanoseconds, and that the base time is UTC.
2018-10-30 20:10:23 +00:00
kre
c576beb79a kern.boottime was changed from a struct timeval to a struct timespec
in January 2009 (the Christos' time merge, when time_t went to 64 bits).

sysctl needs to catch up.   (So do other progs, which will happen, eventually,
but most of them are unaffected in any practical way.)

If you are running a system (NetBSD 6 or later) without this change, try
	sysctl -nn kern.boottime
and marvel at the result (in theory, seconds.microseconds) most
probably being something like:
	jinx$ sysctl -nn kern.boottime
	1540801874.999995564
(There is a 1 in 1000 chance your system will have booted
in the interval [0 , 999999] nanoseconds after some second,
in which case this will not be observed.   You should get
(almost) the same value after this change - just now it is as
it should be (there should now always be 9 digits after the '.').

On the other hand, if you're on a big-endian 64 bit host (running
64 bit sysctl) you would have always seen 0 for the microseconds field.
That should be fixed by this.

In sysctl(7) also document what we mean by "the time the system booted".

XXX Pullup -8
XXX Pullup -7
XXX Pullup -6 (oops, missed that one...)
2018-10-30 19:41:21 +00:00
kre
7008793d77 Correct the 6 second offset issue between the time reported by
dmesg -T and the actual time a message was produced, noted on
current-users by Geoff Wing (Oct 27, 2018).

The size of the offset would depend upon architecture, and processor,
but was the delay from starting the clocks to initialising the time
of day (after mounting root, in case that is needed).

Change the kernel to set boottime to be the time at which the
clocks were started, rather than the time at which it is init'd
(by subtracting the interval between).

Correct dmesg to properly compute the ToD based upon the
boottime (which is a timespec, not a timeval, and has been
since Jan 2009) and the time logged in the message.

Note that this can (rarely) be 1 second earlier than date reports.
This occurs  when the time when the message was logged was actually
in the next second, but the timecounters have not yet processed
the tick, and so the time of the last tick, near the end of the
previous second, is reported instead.   Since times are always
truncated, rather than rounded, it is occasionally possible to
observe that disparity (if you try hard enough).

IOW: sys/kern/subr_prf.c:addtstamp() uses getnanouptime() rather
than nanouptime().

Note in dmesg(8) that -T conversions are gibberish other than
when the message comes from current the running kernel.  (It
could be fixed when -M is used, for messages generated by the
kernel whose corpse is being observed.   But hasn't been...)
2018-10-30 19:40:35 +00:00
skrll
d903176946 Retire fdt_putchar and ap_early_put_char in favour of uartputc. 2018-10-30 16:41:51 +00:00
riastradh
1c1a78241c Paranoia: zero COMPAT_30 ntptimeval and 32-bit ntptimeval too.
These structs don't have padding but safer to keep the code
structured the same way between the various ntp_gettimes in case
anyone makes more copypasta of it for future updates.
2018-10-30 14:43:38 +00:00
riastradh
cc8a85962e Zero ntptimeval50 too to prevent 4-byte kernel stack disclosure.
From Thomas Barabosch of Fraunhofer FKIE.

XXX pullup-7, pullup-8 (along with rev. 1.60 of kern_ntptime.c)
2018-10-30 14:35:16 +00:00
jmcneill
d442e9f083 Disable diagnostic assertions around timer jitter on Allwinner A64. It
seems the instability of CNTVCT can cause issues with the compare value,
and rather than applying a heavy workaround just skip the panics.
2018-10-30 10:38:11 +00:00
martin
15ea57e01c When BOARDTYPE is not set, use MACHINE_ARCH for the image name. 2018-10-30 09:06:07 +00:00
skrll
ee648c4e05 Allow setend be decode 2018-10-30 09:05:51 +00:00
skrll
106bb42a11 Don't forget EXTRA_LINKFLAGS+= --be8 for BE kernels 2018-10-30 08:59:09 +00:00
skrll
2743beddbb Merge SUNXI completely into GENERIC 2018-10-30 07:51:09 +00:00
skrll
a59fe308df Merge EXYNOS into GENERIC completely. GENERIC nows boots on ODROID-XU4 2018-10-30 06:55:07 +00:00
ozaki-r
cb8a413a5e Use rt_update framework on updating a rtentry 2018-10-30 05:56:02 +00:00
ozaki-r
973496ef18 Avoid double rt_replace_ifa on rtrequest1(RTM_ADD)
Some callers of rtrequest1(RTM_ADD) adjust rt_ifa of an rtentry created by
rtrequest1 that may change rt_ifa (in ifa_rtrequest) with another ifa that is
different from requested one.  It's wasteful and even worse introduces a race
condition.  rtrequest1 should just use a passed ifa as is if a caller hopes so.
2018-10-30 05:54:41 +00:00
ozaki-r
954d82d49e Avoid a dangling pointer during rt_replace_ifa 2018-10-30 05:30:31 +00:00
ozaki-r
334ceb81c9 Use atomic operations for ifa_refcnt 2018-10-30 05:29:21 +00:00
ozaki-r
9b83640c45 Remove a wrong assertion in ifaref
Doing ifref on an ifa with IFA_DESTROYING is not a problem; the reference should
be dropped during the destruction of the ifa.
2018-10-30 05:27:51 +00:00
christos
d6cba4abc7 Zero out the ntptimeval structure to prevent a 4 byte kernel stack disclosure.
Reported by Thomas Barabosch.
2018-10-29 22:02:25 +00:00
wiz
c23b16b56b Add comma in enumeration. 2018-10-29 21:06:13 +00:00
jmcneill
932d2dbd41 If a /chosen/framebuffer node is found, reserve physical memory claimed
by it.
2018-10-29 21:05:58 +00:00
wiz
bd01c08b37 Remove unnecessary Pp before Bl/Bd. 2018-10-29 21:04:18 +00:00
wiz
cd3f51adac New sentence, new line 2018-10-29 21:02:15 +00:00
maya
d3aa915675 Make VM_MIN_KERNEL_ADDRESS and others available in the _KMEMUSER case
as well. This affects ddb. Tested by htodd.
2018-10-29 19:43:16 +00:00
christos
28e6c3de1b Back to using _NPF_TESTING now that it does not change the semantics of
the calls, but only adds extra functionality.
2018-10-29 15:37:45 +00:00
christos
2a18a80d51 We need to have rump tests work in two modes:
1. npf unit tests. In this case only the npf subsystem is created
   and dictionaries are passed directly.
2. kernel system tests (like the ipsec natt test). In this case, npf is
   instantiated regularly as part of the kernel and dictionaries are
   passed via ioctl.

We differentiate between the two cases by checking the "mbufops" member
which is NULL, regularly and non-NULL in the npf unit tests. Previously
this was done using an ifdef which obviously can't work for both cases.
2018-10-29 15:37:06 +00:00
martin
5cc5ab64b4 If no BOARDTYPE is defined, avoid the space to separate it from the OS
release.
2018-10-29 13:53:23 +00:00
martin
cd54eb5ef0 VAX does not fully populate the register move costs table, so do not
access it w/o checks.
Hack to work around PR toolchain/53176.
2018-10-29 10:22:56 +00:00