Use the fake exception frame created by pmap_bootstrap2() by
capturing its return value and passing it along as the return
value from start_c_finish().
Move initialization of %dfc and %sfc into _bootstrap() (which will
eventually itself be re-factored to reduce duplication). Also, catch
up with the others: no need to initialize %usp before calling main().
For many many years now, it has been unnecessary to initialize the user
stack pointer before calling main(). TL;DR - %usp comes from the exception
frame and is restored in the syscall stub (always) or rei (if an AST is
pending). For newly-forked processes, those take the non-AST path through
rei, but lwp_trampoline() takes care of it in that case.
PR bin/60099 - Fix unquoted $* ($@) expansion
Make unquoted $* (or $@) when used in a context where field
splitting happens (which requires unquoted of course) generate
the same result, always, as would have been obtained had the
number of params been known, and
$1 $2 $3 ... ${n} (n is the value of $#)
been used instead of $* - so for x$*y, for any strings x & y
(including empty), the equivalent would be
x$1 $2 $3 ... ${n}y
This must hold, whatever the setting of IFS (which affects
how the fields generated are field split after they appear,
but should not affect the generation of those fields).
The bug this fixes is (in practice) never encountered, which is
how it has persisted for so long, and in so many different shells.
The method that was previously used to expand $* in this situation
would work perfectly, if the first character of ${IFS} was an IFS
[28 lines not shown]
Minor cleanups
Cleanup CTLccc char definitions (layout only):
#define [space|tab] consistency, align value column,
add hex equivalents (in comments) for octal char values
Minor changes to comments.
NFC.
Add DEBUG_ONLY() to include anything in DEBUG code
DEBUG_ONLY(x) expands to its arg, which should not contain commas
(outside parens) only in DEBUG mode compiles, most useful for var
declarations, and similar. Nb: code only, not outside functions.
Some cleanups/additions to comments.
By itself, this is a NFC change (until something uses DEBUG_ONLY()
for DEBUG mode code alteration).
PR lib/60111 - Add some bounds checking
As requested by the PR, bounds checking on the two obvious
places I could see where overflow looks possible has been added.
Detected overflow should generate a decode error.
PR 60119 - don't set -o pipefail (revert previous)
I was going to make the setting of the pipefail option check if
the executing shell supports the option or not (all should really,
and up to date dash does - it is a standard option) - but then I
looked at the script, and couldn't find a pipe used anywhere.
The option is useless here. So, bye-bye pipefail.
Reorder slightly for correctness
The "pipefail" option is now a POSIX standard option, move it
from the extensions section to the standard options section.
The (very fake) "r" option is not a standard option, though it
is a command line only "option" - move it away from -s, -c
the other (but standard) command line only options, and to a
section of its own (our first non-standard command line only option).
NFC - the order of options in this definition file is for human
(those who view this file) purposes only, all is reordered by
mkoptions.sh before being included with the shell sources.
Use sh internal char typing, not <ctype.h>
That is, use the internal shell is_digit() rather than isdigit().
No practical functional change (a digit is a digit).
Rather than pmap_boostrap2() returning the address of the lwp0 uarea,
let pmap_bootstrap2() construct the fake exception frame, initialize
lwp0.l_md.md_regs, and return the new lwp0 stack pointer, thus removing
a bunch of duplicated asm code in each platform's locore.s.
XXX amiga and atari TBD, but the changes will be less mechanical.
XXX sun2/sun3/sun3x TBD, require a slightly different set of mechanical
changes.
zfs: fix "slow rm" issue
* stop commiting zil in zfs_netbsd_reclaim and other operations
in vnode reclaim path.
* retire zfs_zget_cleaner/VN_RELE_CLEANER.
instead, just use normal zfs_zget and vrele_async.
note that these two changes depend on each other:
* zfs_zget_cleaner relies on zil_commit in zfs_netbsd_reclaim to
ensure that the znode referenced by TX_WRITE itx is always in-core.
* otoh, zfs_zget_clear makes zil_commit in the vnode reclaim path
possible. that is, zfs_netbsd_reclaim (VOP_RECLAIM) is called with
the vnode in VS_RECLAIMING state, which would make vcache_vget
block.
if the vnode being reclaimed happened to have TX_WRITE itx on the
zil, it deadlocks.
[20 lines not shown]
dounmount/vfs_insmntque: allow vcache_get during VFS_UNMOUNT
we currently have assertions to prevent file systems from
populating its vnode cache during VFS_UNMOUNT. this commit
relaxes the assertions a bit to allow vcache_get during
VFS_UNMOUNT. although VFS_UNMOUNT should still eventually
drain the vnode cache for the mount, this commit allows it
to populate its vnode cache temporarily.
this is for zfs, which sometimes need to access znode when
committing the log. (zfs_get_data) a forthcoming zfs change
will depend on this change.
PR/59885https://gnats.netbsd.org/59885
discussed on tech-kern.
https://mail-index.netbsd.org/tech-kern/2026/02/20/msg030817.html
Disable a kassertmsg.
This triggers for me quite reliably over years now, and has been
tracked in PR 56764, with no resolution.
It seems the asserted inequality just is not correct.
uvm: retire pdpending
this commit retires pdpending.
namely,
* stop counting it in kernel
* stop printing it in userland
* uvmexp/uvmexp_sysctl fields are left intact for compatibility
pdpending is documented in a few places:
uvm(9),uvm_extern.h: "number of times daemon got a pending pageout"
vmstat: "total pending pageouts"
but no one seems to know what it actually means.
here's my reasearch:
in 1998, uvm was imported to our tree.
("initial import of the new virtual memory system, UVM, into
-current.") if my reading of the ancient version of uvm is
[60 lines not shown]
nvmm_x86_vmx.c: fixes tprof stalls
the current implementation of nvmm nmi handling is
simple; just drops them. it interferes other nmi-using
components in the system, including tprof.
this commit makes nvmm try to dispatch nmis by itself.
while this is imperfect, it's good enough to give
tprof a chance to unmask LAPIC_LVT_PCINT.
i guess svm VMCB_EXITCODE_NMI needs something similar.
but i have no hardware. if someone wants to test a patch,
please let me know.
reproduce recipe:
1. run "tprof top" in a terminal. leave it running.
2. run an nvmm-based vm in another terminal.
3. observe some cpus in the "tprof top" stopped counting.