Matthew Dillon [Fri, 14 Feb 2020 05:39:17 +0000 (21:39 -0800)]
kernel - Reduce excessive rdrand harvesting
* Our rdrand driver harvests 512 bytes on each cpu thread at a rate
of 10hz. Ryzen CPUs appear to burn about 0.73uS per word, creating
an overhead of about 460uS/sec on EACH cpu thread in the system.
When added to the even higher overhead of the add_buffer_randomness()
call, the result was a roughly 3% loss of performance across the board.
* Reduce the harvest size to 16 bytes, which honestly is still plenty
of entropy to inject.
* Change some symbolic branch targets to local branch targets in the
rdrand and padlock code to avoid generating symbols that can cause
weird output in our PC sampler (I was getting 'loop+N' and 'out+N'
while testing the above).
Matthew Dillon [Thu, 13 Feb 2020 03:39:12 +0000 (19:39 -0800)]
kernel - Improve tmpfs support
* When a file in tmpfs is truncated to a size that is not on a block
boundary, or extended (but not written) to a size that is not on a
block boundary, the nvextendbuf() and nvtruncbuf() functions must
modify the contents of the straddling buffer and bdwrite().
However, a bdwrite() for a tmpfs buffer will result in a dirty buffer
cache buffer and likely force it to be cycled out to swap relatively
soon under a modest load. This is not desirable if there is no memory
pressure present to force it out.
Tmpfs almost always uses buwrite() in order to leave the buffer 'clean'
(the underlying VM pages are dirtied instead), to prevent unecessary
paging of tmpfs data to swap when the buffer gets recycled or the vnode
cycles out.
* Add support for calling buwrite() in these functions by changing the
'trivial' boolean into a flags variable.
* Tmpfs now passes the appropriate flag, preventing the undesirable
behavior.
François Tigeot [Thu, 13 Feb 2020 19:04:51 +0000 (20:04 +0100)]
drm/linux: Add framebuffer_alloc() and framebuffer_release()
Sascha Wildner [Thu, 13 Feb 2020 18:01:09 +0000 (19:01 +0100)]
wait.2: Fix markup and comment out some references.
François Tigeot [Thu, 13 Feb 2020 06:58:07 +0000 (07:58 +0100)]
drm/linux: Implement outb()
zrj [Sun, 2 Feb 2020 11:35:20 +0000 (13:35 +0200)]
Makefile.inc1: Pass _SHLIBDIRPREFIX for btools too.
Allow to to link in with crossworld target built libraries if available.
These are not needed for DragonFly crossworld target, however helps with
bootstrapping on OpenBSD or glibc based systems where static versions
are not available or mismatches the lex(1) too much.
zrj [Sun, 2 Feb 2020 11:14:22 +0000 (13:14 +0200)]
grep(1): Disable use of unlocked IO in btools.
Our use of grep during bootstrapping process does not require it and
solves issues when bootstrapping utility on OpenBSD.
zrj [Sun, 2 Feb 2020 11:05:16 +0000 (13:05 +0200)]
find(1): Disable use of getvfsbyname(3) in btools.
Not needed by our buildworld/buildkernel infrastructure.
This allows utility to be used on OpenBSD host.
zrj [Sun, 2 Feb 2020 11:03:09 +0000 (13:03 +0200)]
find(1): Reduce bootstrap locale specific requirements.
The F_TIME2_T functionality is not available on all OSes.
While there, check for D_MD_ORDER availability and fallback to month
first if not available.
zrj [Sun, 2 Feb 2020 10:55:34 +0000 (12:55 +0200)]
find(1): Check for _ST_FLAGS_PRESENT_ availability.
zrj [Sun, 2 Feb 2020 10:53:58 +0000 (12:53 +0200)]
find(1): Check for FTS_CONST just like mtree(8).
For compatibility with OpenBSD.
zrj [Sun, 2 Feb 2020 10:36:09 +0000 (12:36 +0200)]
cp(1): Check for FTS_CONST just like mtree(8).
For compatibility with OpenBSD.
zrj [Sun, 2 Feb 2020 10:33:39 +0000 (12:33 +0200)]
cp(1): Check for _ST_FLAGS_PRESENT_ availability.
zrj [Sun, 2 Feb 2020 10:32:59 +0000 (12:32 +0200)]
cp(1): Install signal handler only if SIGINFO is available.
zrj [Sun, 2 Feb 2020 10:29:06 +0000 (12:29 +0200)]
mv(1): Check for _ST_FLAGS_PRESENT_ availability.
While there, check for MNAMELEN availability that indicates presence of
f_mntonname field in struct statfs.
zrj [Sun, 2 Feb 2020 10:28:47 +0000 (12:28 +0200)]
mv(1): Install signal handler only if SIGINFO is available.
zrj [Sun, 2 Feb 2020 10:26:14 +0000 (12:26 +0200)]
rm(1): Check for _ST_FLAGS_PRESENT_ availability.
This allows utility to be used on glibc based systems.
zrj [Sun, 2 Feb 2020 10:24:31 +0000 (12:24 +0200)]
rm(1): Check for whiteout support.
The S_IFWHT is not available on all OSes.
zrj [Sun, 2 Feb 2020 10:22:14 +0000 (12:22 +0200)]
rm(1): Install signal handler only if SIGINFO is available.
zrj [Sun, 2 Feb 2020 10:12:38 +0000 (12:12 +0200)]
gzip(1): Check for _ST_FLAGS_PRESENT_ availability.
zrj [Sun, 2 Feb 2020 10:11:05 +0000 (12:11 +0200)]
m4(1): Add const attribute to __progname.
zrj [Sun, 2 Feb 2020 10:07:45 +0000 (12:07 +0200)]
stat(1): Disable -H support in btools.
While there, limit features in btools too (used only in sys/boot/).
zrj [Sun, 2 Feb 2020 09:52:15 +0000 (11:52 +0200)]
install(1): Check for _ST_FLAGS_PRESENT_ availability.
Our <sys/stat.h> provides the definition. Unbreaks build on Linux.
zrj [Sun, 2 Feb 2020 09:50:09 +0000 (11:50 +0200)]
install(1): Use at least 6 characters for template.
Glibc mkstemp(3) requires at least 6 characters in template.
zrj [Sun, 2 Feb 2020 09:44:01 +0000 (11:44 +0200)]
install(1): Disable -N option in btools.
Our installworld has installcheck and preupgrade and we do not make use
of mtree -N option. This removes hard dependency on pwcache(3).
zrj [Sun, 2 Feb 2020 09:38:54 +0000 (11:38 +0200)]
mtree(8): Add missing checks for HAVE_STRUCT_STAT_ST_FLAGS.
This make mtree(8) usable when building on Linux host.
While there, adjust few included headers too.
zrj [Sun, 2 Feb 2020 09:34:00 +0000 (11:34 +0200)]
mtree(8): Disable -N option in btools.
Our installworld has installcheck and preupgrade and we do not make use
of mtree -N option. This removes hard dependency on pwcache(3).
Matthew Dillon [Thu, 13 Feb 2020 01:12:29 +0000 (17:12 -0800)]
vmstat - Change re, pi, po and fr from counts to bytes
* Change re, pi, po, and fr to bytes. re, pi, and po were previously
paging related transaction counts (not even page counts) which really
tells us absolutely nothing.
The values are now displayed in terms of bytes reclaimed, paged in,
paged out, and freed, with appropriate suffixes (nothing, K, M, or G).
Matthew Dillon [Thu, 13 Feb 2020 00:41:01 +0000 (16:41 -0800)]
tmpfs - Improve write clustering
* Setup bmap and max iosize parameters so the kernel's clustering
code can actually cluster 16KB tmpfs blocks together into 64KB
blocks.
* In low-memory situations the pageout daemon will flush tmpfs
pages via the VM page queues. This ultimately runs through
the tmpfs_vop_write() UIO_NOCOPY path which was previously using
cluster_awrite(). However, because other nearby buffers are
probably not present (buwrite()'s can allow buffers to be
dismissed early), there is nothing for cluster_awrite() to
latch onto to improve write granularity beyond 16KB.
Go back to using cluster_write() when SYNC and DIRECT are not
specified. This allows the clustering code to collect buffers
and flush them in larger chunks.
* Reduces low-memory tmpfs paging I/O overheads by 4x and
generally increases paging throughput to SSD-based swap by
2x-4x. Tmpfs is now able to issue a lot more 64KB I/Os when under
memory pressure.
Matthew Dillon [Thu, 13 Feb 2020 00:37:56 +0000 (16:37 -0800)]
kernel - Add vm.pageout_allow_active sysctl
* Add vm.pageout_allow_active sysctl and default to 1. The pageout
daemon scans inactive pages for work. This sysctl allows the pageout
daemon to cluster nearby active OR inactive pages with the inactive
page it found.
Default to enabled.
Matthew Dillon [Wed, 12 Feb 2020 20:47:07 +0000 (12:47 -0800)]
tmpfs - Flush and recycle pages quickly during heavy paging activity
* When the pagedaemon is operating any write()s made via tmpfs will
be forced to operate through the buffer cache via cluster_write()
or bdwrite() instead of using buwrite().
This will cause the pages to be pipelined to backing store (swap)
under these conditions, making them clean immediately to avoid
having tmpfs cause further paging pressure on the system when it
is already under paging pressure.
* In addition, the B_TTC flag is set on these buffers to attempt to
recycle the pages directly into PQ_CACHE ASAP after they are flushed.
* Implement cluster_write() operation by default to try to improve
block sizes for physical I/O.
* TMPFS currently must move pages between two VM objects when
reclaiming a vnode, and back again upon re-use. The current
VM mechanism for renaming VM pages dirties them and this can
potentially cause the paging system to thrash on the same page
under heavy vnode recycling loads.
Instead of allowing this to happen, TMPFS now frees any clean
page that have backing store assigned when moving from the backing
object, and any clean pages that were instantiated from backing
store when moving to the backing object.
Matthew Dillon [Wed, 12 Feb 2020 20:46:06 +0000 (12:46 -0800)]
kernel - Add B_TTC flag (buffer cache try-to-cache flag)
* This allows filesystems to set a flag, B_TTC, that causes the
kernel to attempt to cycle the underlying pages into PQ_CACHE
when the buffer is disposed of.
Matthew Dillon [Wed, 12 Feb 2020 20:42:36 +0000 (12:42 -0800)]
kernel - Improve vm_page_try_to_cache()
* In situations where this function is not able to cache the
page due to the page being dirtied, instead of just returning
at least ensure that it is moved to the inactive queue if it
is currently on the active queue.
Matthew Dillon [Wed, 12 Feb 2020 20:25:32 +0000 (12:25 -0800)]
kernel - Adjust vm.pageout_memuse_mode
* Generally speaking pages in the INACTIVE queue are cycled through
the queue once if they are clean, and twice if they are dirty
(cycle, clean, cycle again).
This could lead to an excessive lack of progress when paging heavily
and a lot of dirty data is present in INACTIVE, such as when a great
deal of just-written tmpfs related data is present.
* Change the default to cycle dirty pages through the queue just
once, same as clean pages.
* Only scan 1/10 of each of the 1024 ACTIVE / INACTIVE queues in
each pass. This is particularly important for the INACTIVE queue
because we want to give pages in this queue a chance to reactivate
and they might not be given that chance when the full queue is
scanned.
This became an issue when we greatly increased the number of queues
in previous SMP partitioning work (the CPU topology is mapped onto to
the queue space for initial allocation attempts in order to reduce
contention).
Matthew Dillon [Wed, 12 Feb 2020 20:20:47 +0000 (12:20 -0800)]
kernel - Require pages to be PQ_ACTIVE for quick vm_page soft refs
* Require the a VM page be ACTIVE when allowing a quick soft ref
on it for a vm_fault(). If the page is not ACTIVE, the fault will
access it normally and activate it.
Previously the page could be ACTIVE or INACTIVE.
* This ensures that pages often-referenced by vm_fault do not accidently
flow through states and get freed prematurely, causing light paging
to unnecessarily stall active processes.
Matthew Dillon [Wed, 12 Feb 2020 20:16:36 +0000 (12:16 -0800)]
dsynth - Add one more column for 'Lines'
* Increase Lines column width from 6 digits to 7.
Matthew Dillon [Wed, 12 Feb 2020 02:43:25 +0000 (18:43 -0800)]
vmstat - Adjust format slightly
* Adjust the format for the "r b w" columns slightly to keep things
aligned on modern systems.
Matthew Dillon [Tue, 11 Feb 2020 19:20:56 +0000 (11:20 -0800)]
dsynth - Adjust load calculations
* Change the load cap from 5.0 x ncpus to 4.0 x ncpus.
* Add vmtotal.t_pw to the 1-minute load. This adds in any processes
waiting on a page-fault in an attempt to not improperly increase the
job cap due to low swap-thrashing-caused load averages.
Sascha Wildner [Tue, 11 Feb 2020 15:20:02 +0000 (16:20 +0100)]
flock.2: Document the correct header (<fcntl.h>) for flock().
While here, remove some pointless quotations from the header.
Matthew Dillon [Tue, 11 Feb 2020 06:16:57 +0000 (22:16 -0800)]
dsynth - Improve auto SlowStart a bit
* When MaxWorkers is >= 16, set the SlowStart at MaxWorkers / 4 instead
of at 1 so we do not have to wait forever for it to inch up to a
stable value.
Matthew Dillon [Tue, 11 Feb 2020 06:13:13 +0000 (22:13 -0800)]
kernel - Improve pageout daemon pipelining.
* Improve the pageout daemon's ability to pipeline writes to the
swap pager. This deals with a number of low-memory situations
where the pageout daemon was stopping too early (at the minimum
free page mark).
* We don't want the pageout daemon to enforce the paging targets
after a successful pass (as this makes it impossible to actually
use the memory in question), but we DO want it to continue pipelining
if the page stats are still below the hysteresis point governed by
vm_paging_needed().
Matthew Dillon [Tue, 11 Feb 2020 06:11:35 +0000 (22:11 -0800)]
tmpfs - Cycle through buffer cache when pageout daemon is running
* tmpfs usually allocates VM pages directly, but this can overwhelm
the VM system in low-memory situations, causing processes to make
very little progress in normal run-time operation if one or more
of them are doing heavy writing to tmpfs.
* Significantly improves dsynth performance in low-memory situations
where multiple worker slots are in the install-pkgs phase.
Matthew Dillon [Tue, 11 Feb 2020 06:09:58 +0000 (22:09 -0800)]
kernel - Warn/assert on broken ACPI MADT
* Add warnings and assertions for broken ACPI MADT tables. I encountered
this trying to boot a 3990X on a motherboard with an old BIOS that didn't
support it. It tried to boot anyway, but the MADT table was mangled
and caused a null-pointer indirection in the kernel. Assert nicely
instead.
Matthew Dillon [Tue, 11 Feb 2020 06:09:15 +0000 (22:09 -0800)]
kernel - Add cpu ident bit ADMSKX (address mask extensions)
* Add cpu ident bit ADMSKX (address mask extensions)
Taken-from: FreeBSD
Sascha Wildner [Mon, 10 Feb 2020 16:25:16 +0000 (17:25 +0100)]
Merge branch 'vendor/OPENBSD_LIBM'
Sascha Wildner [Mon, 10 Feb 2020 16:22:59 +0000 (17:22 +0100)]
Really sync <math.h> with OpenBSD on the vendor branch.
Sascha Wildner [Mon, 10 Feb 2020 16:08:55 +0000 (17:08 +0100)]
libm: Remove sincos() and friends from lib/libm.
Sascha Wildner [Mon, 10 Feb 2020 15:48:10 +0000 (16:48 +0100)]
Merge branch 'vendor/OPENBSD_LIBM'
Sascha Wildner [Mon, 10 Feb 2020 15:47:40 +0000 (16:47 +0100)]
Import sincos() and friends directly to the vendor branch.
Sascha Wildner [Mon, 10 Feb 2020 15:18:48 +0000 (16:18 +0100)]
sincos.3: Add missing MLINKS.
Roy Marples [Sun, 9 Feb 2020 22:03:19 +0000 (22:03 +0000)]
inet6: report RTM_MISS when probing a known address fails
This allows unreachable to hit userland faster.
Sascha Wildner [Sun, 9 Feb 2020 21:22:25 +0000 (22:22 +0100)]
<sys/ttydefaults.h>: Sync up with FreeBSD, mainly for r179567.
The rest of it was already brought in.
FreeBSD's commit msg:
r179567 | ed | 2008-06-05 19:44:18 +0200 (Thu, 05 Jun 2008) | 13 lines
Fix faulty character to control-character conversion for CTRL().
The CTRL() macro seems to perform character to control-character
conversion (i.e. 'A' to 0x01) to lowercase characters. This is actually
not valid. If we use lowercase characters, conversions such as
CTRL('\\') and CTRL('?') will result to invalid conversions.
Because we must still support old source code that uses CTRL() (bad!),
we make CTRL() accept both forms. When the character is a lowercase
character, we perform the old style conversion.
Sascha Wildner [Sun, 9 Feb 2020 19:55:01 +0000 (20:55 +0100)]
<sys/ttydefaults.h>: Add some includes for self-sufficiency.
Sascha Wildner [Sun, 9 Feb 2020 18:26:15 +0000 (19:26 +0100)]
route(4): Remove a leftover closing brace.
Assuming the opening one was removed for style reasons.
Sascha Wildner [Sun, 9 Feb 2020 17:30:54 +0000 (18:30 +0100)]
installer: Silence a kenv(1) warning.
On non-comconsole systems, this is undefined, so silence any warnings
about it (that would show up briefly when logging in as installer).
Roy Marples [Sun, 9 Feb 2020 17:07:41 +0000 (17:07 +0000)]
route(4): add RO_MISSFILTER socket option.
This allows filtering of specific RTM_MISS destination sockaddrs.
Roy Marples [Sun, 9 Feb 2020 12:01:00 +0000 (12:01 +0000)]
route: make INET6 addrs human readable with sockaddr_print
Roy Marples [Sun, 9 Feb 2020 10:25:29 +0000 (10:25 +0000)]
route: constify sockaddr_print
Sascha Wildner [Sun, 9 Feb 2020 10:02:45 +0000 (11:02 +0100)]
kernel/apple_gmux: Add missing opt_ddb.h to the Makefile and sort.
Sascha Wildner [Sat, 8 Feb 2020 08:48:06 +0000 (09:48 +0100)]
kernel/vga_switcheroo: Add missing opt_ddb.h to the Makefile.
Sascha Wildner [Fri, 7 Feb 2020 14:54:10 +0000 (15:54 +0100)]
kernel/drm: Add missing opt_ddb.h to the Makefiles.
While here, adjust some SRCS declaration style with the rest of the
Makefile.
Matthew Dillon [Fri, 7 Feb 2020 07:43:31 +0000 (23:43 -0800)]
kernel - Clean up memory leaks and a stack buffer disclosure bug
* Clean up memory leaks, a stack buffer disclosure bug, and a
missing priv check in if_oce (which probably never attaches these
days). All in the network subsystem.
Reported-by: Ilja van Sprundel
Tomohiro Kusumi [Thu, 6 Feb 2020 15:15:10 +0000 (00:15 +0900)]
sbin/fsck_msdosfs: Diff reduction against FreeBSD against NetBSD
from freebsd/freebsd@
28bbeac80931cc14571ef4b6455d8da7466411a2
Tomohiro Kusumi [Thu, 6 Feb 2020 15:12:08 +0000 (00:12 +0900)]
sbin/fsck_msdosfs: Tighten FAT checks and fix off-by-one error in corner case
See below for details.
https://reviews.freebsd.org/D23065
from freebsd/freebsd@
b60894b10adb071a8dc2b6fea5f9867c24bc9c47
François Tigeot [Thu, 6 Feb 2020 12:15:57 +0000 (13:15 +0100)]
libm: Bring in sincos, sincosf, and sincosl from OpenBSD
François Tigeot [Thu, 6 Feb 2020 06:16:13 +0000 (07:16 +0100)]
drm/linux: fix a bug in DEFINE_WAIT()
The wake-up function was not properly set up.
Tomohiro Kusumi [Wed, 5 Feb 2020 16:29:45 +0000 (01:29 +0900)]
sbin/fsck_msdosfs: Document -M
from freebsd/freebsd@
0371742d8ddb1c53201a1141a58076535e0b2f9c
Tomohiro Kusumi [Wed, 5 Feb 2020 16:20:08 +0000 (01:20 +0900)]
sbin/fsck_msdosfs: Reduce memory footprint of fsck_msdosfs
See below for details.
https://reviews.freebsd.org/D22965
from freebsd/freebsd@
41655e1cf1451b788f6437c91ec74bcecd2192b7
François Tigeot [Wed, 5 Feb 2020 10:28:43 +0000 (11:28 +0100)]
drm: Improve drm_can_sleep()
Matthew Dillon [Wed, 5 Feb 2020 06:05:48 +0000 (22:05 -0800)]
drm - Remove some of the linux_sched debugging
* Remove some debugging that we no longer need.
Sascha Wildner [Wed, 5 Feb 2020 04:28:57 +0000 (05:28 +0100)]
hammer2.8: Fix typo.
Matthew Dillon [Tue, 4 Feb 2020 01:44:57 +0000 (17:44 -0800)]
dsynth - Add HTML support (2)
* Fix 'ignored' and 'failed' reason format (the js expects a certain
format and coughs pop-up errors up if it doesn't get it).
Matthew Dillon [Tue, 4 Feb 2020 01:05:00 +0000 (17:05 -0800)]
dsynth - Add HTML support
* Bring in progress.css, progress.html, progress.js, and icons from
the synth project. Add John's copyright to progress.js.
* dsynth now generates the logs/Report subdirectory, all necessary
files, and dynamically generates the json.
The summary.json database is updated every 10 seconds to reduce wear and
tear.
* Split the history files in 50KB segments to reduce network traffic.
Sascha Wildner [Mon, 3 Feb 2020 21:24:05 +0000 (22:24 +0100)]
etc/defaults/rc.conf: Remove some leftovers from the mrouted(8) removal.
Sascha Wildner [Mon, 3 Feb 2020 20:45:21 +0000 (21:45 +0100)]
kernel/iwm: Add back support for IWM_DEBUG (default is inactive).
Dunno why it got lost in the last upgrade.
Also, comment it out in the module Makefile.
Sascha Wildner [Mon, 3 Feb 2020 20:13:48 +0000 (21:13 +0100)]
getrandom.2: Use .Dv for defines.
Sascha Wildner [Mon, 3 Feb 2020 20:35:57 +0000 (21:35 +0100)]
iso639: Fix some descriptions (from upstream).
Matthew Dillon [Mon, 3 Feb 2020 19:15:03 +0000 (11:15 -0800)]
kernel - Fix usb crash on detach
* Sometimes a bad usb link can flicker off before the usb bus is able
to finish attaching it, resulting in an attempt to kfree() a NULL
pointer. Check for NULL.
Sascha Wildner [Mon, 3 Feb 2020 16:51:11 +0000 (17:51 +0100)]
sysctl.9/sysctl_add_oid.9: Add missing BIT32 and BIT64 MLINKS.
Sascha Wildner [Mon, 3 Feb 2020 16:06:00 +0000 (17:06 +0100)]
rman.9: Fix rman_make_alignment_flags() prototype.
Sascha Wildner [Mon, 3 Feb 2020 15:55:51 +0000 (16:55 +0100)]
getrandom.2: Comment out reference to getentropy.3 and fix date.
Sascha Wildner [Mon, 3 Feb 2020 15:13:54 +0000 (16:13 +0100)]
vkernel: Include <sys/malloc.h> for malloc_reinit_ncpus() prototype.
Fixes the VKERNEL64 build.
zrj [Sun, 2 Feb 2020 09:12:34 +0000 (11:12 +0200)]
gcc80: Hide NO_WERROR in tools better.
zrj [Sun, 2 Feb 2020 09:11:25 +0000 (11:11 +0200)]
hostprog: Remove NO_WERROR from btools tic.
Pointed-out-by: swildner
zrj [Sun, 2 Feb 2020 09:10:47 +0000 (11:10 +0200)]
<alloca.h>: Add comment for special handling case.
Matthew Dillon [Mon, 3 Feb 2020 03:29:30 +0000 (19:29 -0800)]
kernel - Make writing to /dev/urandom (to add entropy) faster
* Speed this up a bit by chunking up 256 byte blocks instead of
64. The SHA256 hash eats a lot of time, this should speed the
boot-time entropy injection up by 4x.
Reported-by: zrj
Matthew Dillon [Sun, 2 Feb 2020 20:41:30 +0000 (12:41 -0800)]
libc - Update manual page for realpath(3) and add page for __realpath(2)
* Add a manual page for __realpath(2) which clarifies differences
between realpath(3) and __realpath(2).
Matthew Dillon [Sun, 2 Feb 2020 20:21:59 +0000 (12:21 -0800)]
libc - Update for realpath() system call support (2)
* Fix bug last commit, on failure if a buffer is supplied we copy
the source path to the target buffer before returning.
Reported-by: zrj
Sascha Wildner [Sun, 2 Feb 2020 10:15:51 +0000 (11:15 +0100)]
boot/pxe: Fix some typos in comments and (unused, as it seems) type names.
While here, use our __packed.
Matthew Dillon [Sun, 2 Feb 2020 07:45:16 +0000 (23:45 -0800)]
kernel - Rejigger random number generator to be per-cpu 2/2
* The initializer tries to diverge each cpu's csprng a bit more
now. These initial conditions are not intended to produce secure
random numbers, but they should be reasonably secure by the time the
kernel is finished booting.
* Once the csprng is operational, do not always inject the same
entropy into both csprngs since that would make having two and
XOR'ing the results together kinda worthless.
* If RDRAND is available the csprng will get new injections 25 times
a second on each cpu. Without it, however, entropy injection is
relatively slow.
Matthew Dillon [Sun, 2 Feb 2020 06:55:12 +0000 (22:55 -0800)]
kernel - Rejigger random number generator to be per-cpu 1/2
* Refactor all the kernel random number generation code to
operate on a per-cpu basis. The csprng, ibaa, and l15
structures are now per-cpu.
* RDRAND now runs a periodic timer callback on all available cpus
rather than just on cpu 0, allowing rdrand data to mix on
each cpu's rng independently.
* The nrandom helper thread now chains state with an iteration
between cpus, injecting a random data buffer generated from
the previous cpu into the mix of the current.
Matthew Dillon [Sun, 2 Feb 2020 06:48:20 +0000 (22:48 -0800)]
kernel - Add __realpath() and getrandom() system calls (2)
* Move GRND_* defines to the right spot in sys/random.h
zrj [Sat, 1 Feb 2020 12:48:03 +0000 (14:48 +0200)]
make(1): Add OpenBSD support.
OpenBSD does not have 'A' support in malloc_options. Use supported 'S'
to prevent a lot of warnings during every bmake invoke.
zrj [Sat, 1 Feb 2020 12:43:08 +0000 (14:43 +0200)]
tic(1): Explicitly disable WERROR in hostprog tic.
This special version is used during buildworld.
Helps with bootstrapping on OpenBSD.
zrj [Sat, 1 Feb 2020 12:36:25 +0000 (14:36 +0200)]
world: Explicitly disable WERROR for hostprog and hostlib.
Explicit tracking of currently toolchain is too fragile for c++.
Add CROSS_CFLAGS helper in NXFLAGS for bootstrapping on OpenBSD.
zrj [Sat, 1 Feb 2020 12:32:40 +0000 (14:32 +0200)]
gcc80: Make bootstrapping more permissive.
To allow boostrapping on OpenBSD/Linux hosts:
* provide CROSS_LIBDL knob when needed;
* disable use of iconv in support libs;
* disable werror in hostlibs.
zrj [Sat, 1 Feb 2020 12:22:46 +0000 (14:22 +0200)]
binutils227: Explicitly include <stdint.h> and add CROSS_LIBDL.
On glibc based systems dlopen() functionality is not in libc.
zrj [Sat, 1 Feb 2020 12:21:18 +0000 (14:21 +0200)]
gdb(1): Explicitly include <stdint.h>.
Matthew Dillon [Sun, 2 Feb 2020 01:34:30 +0000 (17:34 -0800)]
libc - Update for realpath() system call support
* The realpath() implementation now checks to see if the system call
is available and uses it.
* getosreldate() now caches the result to avoid multiple sysctl()
calls.
* Add the new system calls (__realpath and getrandom()) to the symbol
list.
Matthew Dillon [Sun, 2 Feb 2020 01:30:28 +0000 (17:30 -0800)]
kernel - Add __realpath() and getrandom() system calls
* Add a kernel __realpath() system call. libc must still implement
the realpath() function to handle NULL buffers (malloc()d buffer
returned).
The libc implementation checks the osversion for backwards compatibility
before attempting to use the new system call.
* Add a kernel getrandom() system call.
* Bump __DragonFly_version to 500710.
Suggested-by: tuxillo, mjg