Link [ NetBSD | NetBSD OpenGrok source search | PR fulltext-search | Summary of daily snapshot builds | history of daily build result | pkgsrc commit viewer ]


   
        usage: [branch:branch] [user:user] [path@revision] keyword [... [-excludekeyword [...]]] (e.g. branch:MAIN sys/arch/arm, if_wm.c@1.234 )




switch to index mode

recent branches: MAIN (1h)  perseant-exfatfs (15h)  netbsd-10 (6d)  netbsd-9 (6d) 

2025-05-01 10:16:34 UTC Now

2025-05-01 08:43:02 UTC MAIN commitmail json YAML

Support the brightness slider on PowerBook 1xx series.
Update copyright.

(nat)

2025-05-01 08:40:47 UTC MAIN commitmail json YAML

Use the right location for powering off the PowerBook.

The previous location would only power off the computer if the AC adaptor was
connected.

(nat)

2025-05-01 07:40:43 UTC MAIN commitmail json YAML

PR toolchain/58699: fix nbtool_config.h filename in tools/README

(martin)

2025-05-01 06:13:19 UTC MAIN commitmail json YAML

Note about sti(4) support for 362 and 382 on hp300.

(tsutsui)

2025-05-01 06:11:21 UTC MAIN commitmail json YAML

Add sti(4) support for 9000/362 and 9000/382 on-board framebuffers.

Mostly pulled from OpenBSD/hp300.

This supersedes old and dumb gendiofb.  Currently there is no mmap
or cmap (palette) support, but I'll investigate how Bt474 RAMDAC
should be handled.

Tested on 382 with 640x480 and 1024x768 variants, and 362 with 640x480.
No visible regression on 425e (EVRX) and 425t (CRX).

(tsutsui)

2025-05-01 06:01:47 UTC MAIN commitmail json YAML

Avoid redundant and incorrect hypervisor detection in second
identify_hypervisor() call

The second call to identify_hypervisor() during autoconf needlessly repeats
hypervisor detection logic and could incorrectly override vm_guest values
(e.g., replacing VM_GUEST_KVM with VM_GUEST_VM). This change ensures that
if vm_guest is already set to a known hypervisor, the second pass skips
detection, preserving correct identification from the early call.

Tested on NetBSD/amd64, NetBSD/i386 with QEMU/KVM and QEMU/NVMM (BIOS and PVH),
Xen domU and Xen PVH.

(imil)

2025-05-01 05:36:02 UTC MAIN commitmail json YAML

2025-05-01 05:17:31 UTC MAIN commitmail json YAML

Introduce cpu_max_hypervisor_cpuid to cache hypervisor CPUID leaf

This variable stores the maximum supported hypervisor CPUID leaf so that
future checks can avoid repeated calls to x86_cpuid().

(imil)

2025-05-01 02:04:32 UTC MAIN commitmail json YAML

enable apc(4) by default.

it seems that the original commit left it disabled as the linux
driver has a comment about it hanging on prototype systems (that
i don't recall ever hearing about with netbsd), but it's enabled
by default there, so let's enable it by default.

the real benefit here is that qemu-system-sparc detects this and
it idles on the host properly.

(mrg)

2025-05-01 01:35:37 UTC MAIN commitmail json YAML

t_ptrace_*.c: Make debug output a little less verbose.

Maybe it will stop overflowing the releng testbed file systems this
way.

(riastradh)

2025-04-30 18:49:24 UTC perseant-exfatfs commitmail json YAML

2025-04-30 18:48:02 UTC perseant-exfatfs commitmail json YAML

Convert endianness when loading superblock and FATs.  There is likely more
that needs to be done in this regard.

(perseant)

2025-04-30 18:46:21 UTC perseant-exfatfs commitmail json YAML

Do not check boot block checksum by default.  Add -x flag to turn on this check, if desired by the user.
Convert the endianness of the superblock and other on-disk data structures.
Do not attempt to write the superblock if passed -n.

(perseant)

2025-04-30 17:02:02 UTC perseant-exfatfs commitmail json YAML

2025-04-30 16:55:52 UTC perseant-exfatfs commitmail json YAML

2025-04-30 15:40:38 UTC MAIN commitmail json YAML

sljit: avoid compiler warning due to switch fallthru on mips

Unsure why, but this is only a problem when building sljit in
userspace via rump, which we don't do by default on mips,
although it's included in the OCTEON kernel.

Not enough to allow setting MKSLJIT=yes on mips but gets us
closer.

(nia)

2025-04-30 15:30:53 UTC MAIN commitmail json YAML

Fix build for XEN not defined

(imil)

2025-04-30 14:23:45 UTC MAIN commitmail json YAML

mention KERNEL_DIR

(pgoyette)

2025-04-30 13:27:13 UTC MAIN commitmail json YAML

From FreeBSD D50078 by jrtc27:

Linux's struct stat does not have an st_flags member, but we still want
to be able to create FreeBSD disk images with non-zero st_flags. Add a
replacement member to struct fsinode to store it on Linux.

(christos)

2025-04-30 07:22:17 UTC MAIN commitmail json YAML

2025-04-30 06:24:47 UTC MAIN commitmail json YAML

Remove conditionals on KERNEL_DIR, and reorder the potential boot
locations to put the legacy ones first.  This allows us to use a
single version of the bootstrap code regardless of the use of the
KERNEL_DIR build option, and should avoid spurious error messages
disrupting the automated testbeds.

Tested on i386 (non-KERNEL_DIR) and amd64 (both with and without
KERNEL_DIR).  In all cases the anita installations succeeded and
the atf tests were initiated.  Any remaining issues are most likely
due to subtle changes in text interaction and will probably need
updates to "expect" processing in anita.

If necessary this commit can be reverted, but please try to avoid
more churn, and update the testbed drivers as appropriate.
cvs: ----------------------------------------------------------------------

(pgoyette)

2025-04-30 06:01:08 UTC MAIN commitmail json YAML

make: fix order of error messages in the ":?" modifier

While here: In Var_Parse, EvalStack_Pop needs to be called before
freeing the short-lived variable, as its name is part of the evaluation
stack.

(rillig)

2025-04-30 05:33:10 UTC MAIN commitmail json YAML

2025-04-30 05:15:08 UTC MAIN commitmail json YAML

Introduce pvh_boot boolean to identify the real hypervisor when booting in PVH
mode.

As of now, sys/arch/x86/x86/identcpu.c / identify_hypervisor() returns in the
case of vm_guest being VM_GUEST_GENPVH, yet this VM type is not an actual
hypervisor but an information recorded in locore.S to drive boot method.
We need to investigate what type of hypervisor is really running the VM in
order to apply specifics, so instead of relying on vm_guest_is_pvh() which only
checks for VM_GUEST_XENPVH || VM_GUEST_GENPVH, pvh_boot informs on the boot
method while allowing to identify the real hypervisor.

Idea ok'd by bouyer@, tested on Xen domU, Xen dom0 with GENERIC PVH and
qemu GENERIC PVH boot.

(imil)

2025-04-30 04:42:17 UTC perseant-exfatfs commitmail json YAML

2025-04-30 03:16:34 UTC perseant-exfatfs commitmail json YAML

Initialize fs structure, to make -w option work correctly.

(perseant)

2025-04-29 23:32:35 UTC MAIN commitmail json YAML

t_ptrace_wait, t_ptrace_sigchld: Enable debug output.

Otherwise failures lead only to nearly useless output like:

FAILED: /work/src/tests/lib/libc/sys/t_ptrace_signal_wait.h:852: info.psi_siginfo.si_signo != sig

What _was_ si_signo, you ask?  Sorry, you have to guess or run the
test yourself!

(riastradh)

2025-04-29 22:25:36 UTC MAIN commitmail json YAML

doc: mips enablement

(nia)

2025-04-29 21:06:18 UTC MAIN commitmail json YAML

KNF - blank linebetween data and code

Also make sure we leave space in the path[] for a possible '.gz' to
be appended.

Both suggestions from kre@ - thanks

(pgoyette)

2025-04-29 15:57:35 UTC MAIN commitmail json YAML

Bump a max number of bootable file (actually MAC address lines) to 16.

There are >10 HP9000 machines with Ethernet here.

(tsutsui)

2025-04-29 15:07:44 UTC MAIN commitmail json YAML

Update to pathnames for booting under KERNEL_DIR

Tested on i386 (wwithout KERNEL_DIR) and amd64 (both with and without)

(pgoyette)

2025-04-29 14:53:54 UTC MAIN commitmail json YAML

PR 59307: fix longjmp(9) for sparc64 too (there is only a single arg,
return value from setjmp is always 1).

(martin)

2025-04-29 14:33:26 UTC MAIN commitmail json YAML

Fix typo.

Noticed by Miod Vallat.

(tsutsui)

2025-04-29 12:20:36 UTC MAIN commitmail json YAML

2025-04-29 10:57:17 UTC MAIN commitmail json YAML

PR port-powerpc/59306 has been fixed, remove expected failure.

(martin)

2025-04-29 10:56:38 UTC MAIN commitmail json YAML

PR port-powerpc/59306: kernel longjmp(9) only takes one argument,
always make setjmp(9) return 1.
Change as suggested by Taylor.

(martin)

2025-04-29 09:55:59 UTC MAIN commitmail json YAML

PR port-sparc/59307 has been fixed, remove expected failure

(martin)

2025-04-29 09:55:14 UTC MAIN commitmail json YAML

PR port-sparc/59307: kernel longjmp(9) only gets a single argument,
make setjmp(9) always return 1 via longjmp(9).

(martin)

2025-04-29 09:08:38 UTC MAIN commitmail json YAML

Backout /filename/kernel changes, this breaks default installs
and needs more testing.

(martin)

2025-04-29 04:53:46 UTC MAIN commitmail json YAML

2025-04-29 02:22:43 UTC MAIN commitmail json YAML

If only a filename is given on the boot command, try /filename/kernel
and /filename/kernel.gz, and then /filename to minimize differences
between old andnew recovery procedures.  No change to ``naked'' boot
commands, nor to boot commands with pathname containing `;'

(pgoyette)

2025-04-28 19:54:49 UTC MAIN commitmail json YAML

mk: Enable SSP on MIPS, since it works and defends properly.

Also carry over RELRO enablement to n64 variants.

PR pkg/59368

(nia)

2025-04-28 18:29:09 UTC MAIN commitmail json YAML

2025-04-28 18:15:53 UTC MAIN commitmail json YAML

PR 59370: compat_13: since we do not initialize the %o0 slot in jmpbuf
in setjmp() we need to store the full 64bit argument from longjmp()
there, otherwise the upper 32bit will be random garbage.

(martin)

2025-04-28 15:41:25 UTC MAIN commitmail json YAML

Skip the test if we are not allowed to load modules.

(martin)

2025-04-28 15:31:13 UTC MAIN commitmail json YAML

Make main() actually return zero. From Riastradh.
PR kern/59327: user stack pointer is not aligned properly

(martin)

2025-04-28 14:47:47 UTC MAIN commitmail json YAML

Allow out of source builds (hrosenfeld)

(christos)

2025-04-28 13:09:26 UTC MAIN commitmail json YAML

tests/lib/libc/setjmp: Mark compat 1.3 setjmp busted on sparc64.

PR port-sparc64/59370: compat 1.3 setjmp is busted

(riastradh)

2025-04-28 13:01:28 UTC MAIN commitmail json YAML

xen: Stop-gap FPU PCB fix; disable Intel AMX for now.

Since the custom cpu_uarea_alloc/free are disabled under XENPV,
nothing would initialize struct pcb::pcb_savefpu to point either to
struct pcb::pcb_savefpusmall, or to a separately allocated large area
on machines with Intel AMX TILECFG/TILEDATA requiring it.  So the
memset in fpu_lwp_fork would crash on null pointer dereference:

[  1.0000030] uvm_fault(0xffffffff8094a300, 0x0, 2) -> e
[  1.0000030] fatal page fault in supervisor mode
[  1.0000030] trap type 6 code 0x2 rip 0xffffffff8062795c cs 0xe030 rflags 0x10202 cr2 0 ilevel 0 rsp 0xffffffff80adad38
[  1.0000030] curlwp 0xffffffff8078f880 pid 0.0 lowest kstack 0xffffffff80ad62c0
kernel: page fault trap, code=0
Stopped in pid 0.0 (system) at  netbsd:memset+0x2c:    repe stosq      %es:(%rdi)
memset() at netbsd:memset+0x2c
lwp_create() at netbsd:lwp_create+0x2f1
fork1() at netbsd:fork1+0x42c
main() at netbsd:main+0x44f

In order to support Intel AMX TILECFG/TILEDATA, or any other CPU
extensions that increase the XSAVE area beyond what fits in a single
page after struct pcb, we would need to enable the the custom
cpu_uarea_alloc/free.  Currently that would imply allocating stack
guard pages (`redzone') under XENPV; if there's some reason the stack
guard pages don't work, we could also push #ifdef XENPV conditionals
into cpu_uarea_alloc/free to cover the guard pages -- to be
considered.

PR kern/59371: Xen domU uvm_fault since FPU state allocation patch

PR port-amd64/57661: Crash when booting on Xeon Silver 4416+ in
KVM/Qemu

(riastradh)

2025-04-28 12:30:39 UTC MAIN commitmail json YAML

2025-04-28 12:29:51 UTC MAIN commitmail json YAML

fix typo in previous commit s/FHC/FCH/ for AMD RAID mode SATA controller.

(andvar)

2025-04-28 11:39:10 UTC MAIN commitmail json YAML

clear whitespace in IPV6 neighbor solicitation

(joe)

2025-04-28 11:03:40 UTC MAIN commitmail json YAML

2025-04-28 11:03:14 UTC MAIN commitmail json YAML

Add AMD X370/X399/A320/A520/600 Series SATA/xHCI devices, 600 Series and Navi
PCIe Switch Upstream/Downstream Ports, Raven Ridge Vega GPUs and GeForce 6200A.

(andvar)

2025-04-28 07:43:41 UTC MAIN commitmail json YAML

allow to specify the font's height in WSDISPLAYIO_SFONT.
now you can:
/home/ml# wsfontload -l
Gallant 12x22
Droid Sans Mono 10x20
Droid Sans Mono 12x22
Terminal 8x13
HP ROM 10x20
/home/ml# wsconsctl -dw font="Droid Sans Mono@20"
font -> "Droid Sans Mono@20"
/home/ml# wsconsctl -dw font="Droid Sans Mono@22"
font -> "Droid Sans Mono@22"
/home/ml# wsconsctl -dw font="Droid Sans Mono@15"
wsconsctl: WSDISPLAYIO_SFONT: No such file or directory

(macallan)

2025-04-28 04:46:58 UTC MAIN commitmail json YAML

remove code to stash the console font in video memory - this was an experiment
based on guesswork which probably won't work if the card runs in anything
other than 1280x1024, and wasn't significantly faster than drawing characters
line by line using BINC writes.

(macallan)

2025-04-28 00:28:27 UTC MAIN commitmail json YAML

t_sigstack: Don't do atf_tc_expect_fail then atf_tc_expect_signal.

atf interprets this sequence, with no intervening atf_tc_fail, to
mean the xfail failed to fail so it fails.  (Got that?)  That is, it
is interpreted somewhat like

atf_tc_expect_fail(...);
... there is supposed to be a failure here ...
atf_tc_expect_pass();
... remaining checks are expected to pass ...

where a lack of failures between the xfail and the xpass means the
expectation was not met.

But in this case, there are two compounding bugs:

1. the compat 1.3 setjmp has botched its registers, as uwe@
  discovered, so it is expected to crash on SIGSEGV (PR 59351); and

2. the compat 1.3 longjmp restores the stack poiter and signal mask
  in the wrong order, so it is expected to fail the test (PR 57946).

Since the crash in setjmp triggers before the failure after longjmp,
only do atf_tc_expect_signal; once that is fixed we can re-enable the
atf_tc_expect_fail for longjmp.

PR lib/57946: longjmp fails to restore stack first before restoring
signal mask on most architectures

PR port-arm/59351: compat_setjmp is busted

(riastradh)

2025-04-27 23:30:39 UTC MAIN commitmail json YAML

Correct a couple of typos.

(kre)

2025-04-27 22:03:22 UTC MAIN commitmail json YAML

Mention new KERNEL_DIR stuff

(pgoyette)

2025-04-27 21:35:36 UTC MAIN commitmail json YAML

Actually include a bootable kernel in the KERNEL_DIR boot images.

This enables us to actually boot the image into qemu from /netbsd/kernel
and load modules from /netbsd/modules/... , keeping the modules and
kernel together, and removing kernel version numbers from the modules'
path.

From christos@

LGTM, commit it...

(pgoyette)

2025-04-27 21:13:42 UTC MAIN commitmail json YAML

tests/kernel/setjmp_tester: Apparently kmods have .debug data too!

(Fix set list.)

PR port-riscv/59304: kernel longjmp(9) fails to make setjmp(9) return 1
PR port-hppa/59305: kernel longjmp(9) fails to make setjmp(9) return 1
PR port-powerpc/59306: kernel longjmp(9) fails to make setjmp(9) return 1
PR port-sparc/59307: kernel longjmp(9) fails to make setjmp(9) return 1
PR port-vax/59308: kernel longjmp(9) fails to make setjmp(9) return 1

(riastradh)

2025-04-27 17:40:56 UTC MAIN commitmail json YAML

posix_spawn(2): Allocate a new vmspace at process creation time.

This allocates a new vmspace for the process at the time the new
process is created, rather than sharing some other vmspace temporarily.
This eliminates any risk of anything bad happening due to temporary
sharing, since there isn't any sharing.

Resolves a race to where:

1. we set up the child to share proc0.p_vmspace at first,

2. another process tries to read the new child's psstrings via
  kern.proc_args.<childpid>.argv or similar with the child's
  p_reflock held and gets stuck in a uvm fault loop because
  proc0.p_vmspace doesn't have the child's psstrings address
  (inherited from the parent) mapped,

3. the child is waiting for p_reflock before it can replace its
  p_vmspace or psstrings.

By allocating the vmspace up front, with no mappings in it, we avoid
exposing the child in this scenario.  Minor possible downside is that
sysctl kern.proc_args.<childpid>.argv might spuriously fail with
EFAULT during this time (rather than fail with EBUSY as it does if
p_reflock is held concurrently) but that's not a particularly big
deal.

Patch and first paragraph of commit message written by chs@; minor
tweaks to comments -- and any mistakes in the analysis -- by me.

PR kern/59037: deadlock in posix_spawn
PR kern/59175: posix_spawn hang, hanging other process too

(riastradh)

2025-04-27 16:49:54 UTC MAIN commitmail json YAML

t_signal_and_sp: Try to fix mips o32 tests.

Evidently, for o32, PIC_PROLOGUE (which expands to .cpload) must be
the very first instruction of the function, or else it will get the
$gp calculation wrong.

Since it seems that the mips PIC_PROLOGUE does not, after all, mess
with the stack, let's just dispense with the temporary copy of sp in
t0 which I had added in paranoia over what magic might happen inside
PIC_PROLOGUE.  (Such paranoia is not entirely unjustified -- for
example, the sh3 PIC_PROLOGUE _does_ push data on the stack, though
this can be bypassed with PIC_PROLOGUE_NOSAVE.)

PR kern/59327: user stack pointer is not aligned properly

(riastradh)

2025-04-27 16:22:26 UTC MAIN commitmail json YAML

tests/kernel: New test for setjmp(9)/longjmp(9).

PR port-riscv/59304: kernel longjmp(9) fails to make setjmp(9) return 1
PR port-hppa/59305: kernel longjmp(9) fails to make setjmp(9) return 1
PR port-powerpc/59306: kernel longjmp(9) fails to make setjmp(9) return 1
PR port-sparc/59307: kernel longjmp(9) fails to make setjmp(9) return 1
PR port-vax/59308: kernel longjmp(9) fails to make setjmp(9) return 1

(riastradh)

2025-04-27 16:15:40 UTC MAIN commitmail json YAML

lib/libc/arch/alpha: Say STACK_ALIGNBYTES, not 0xf, where relevant.

No functional change intended.

PR kern/59327: user stack pointer is not aligned properly

(riastradh)

2025-04-27 16:15:27 UTC MAIN commitmail json YAML

lib/libc/arch/alpha/gen/_lwp.c, makecontext.c: Sort includes.

No functional change intended.

Preparation for tidying for:

PR kern/59327: user stack pointer is not aligned properly

(riastradh)

2025-04-27 16:03:17 UTC MAIN commitmail json YAML

Replace broken link to the GEM Gigabit Ethernet ASIC Specification
with a working archive.org link.

(gson)

2025-04-27 15:43:43 UTC MAIN commitmail json YAML

t_signal_and_sp arm/execsp.S: Try using registers that aren't in use.

The first draft of this was instead using all the registers that
_are_ in use on entry to the elf entry point, which understandably
confused __start when we jumped to it after trashing all its inputs.

PR kern/59327: user stack pointer is not aligned properly

(riastradh)

2025-04-27 15:38:50 UTC MAIN commitmail json YAML

t_signal_and_sp arm/signalsphandler.S: Fix pasto.

Copied & pasted this from contextspfunc.S and forgot to change one
reference to contextsp to signalsp instead, oops.

Should resolve:

*** Check failed: /work/src/tests/kernel/t_signal_and_sp.c:440: signalsp != NULL not met

PR kern/59327: user stack pointer is not aligned properly

(riastradh)

2025-04-27 15:31:51 UTC MAIN commitmail json YAML

t_ptrace_wait*: Deal with quirk of softfloat trap SIGFPE delivery.

PR misc/56820: Many FPE related tests fail on softfloat machines

(riastradh)

2025-04-27 15:23:27 UTC MAIN commitmail json YAML

libc softfloat: Make SIGFPE for trapped fp exceptions non-ignorable.

In hardfloat, when the kernel delivers SIGFPE for a floating-point
exception trap, if SIGFPE is masked or ignored, it is handled _as if_
SIGFPE were unmasked and had the default signal disposition:

    964 /*
    965 * If the signal is masked or ignored, then unmask it and
    966 * reset it to the default action so that the process or
    967 * its tracer will be notified.
    968 */
    969 const bool ignored = action == SIG_IGN;
    970 if (masked || ignored) {
    971 mutex_enter(&ps->sa_mutex);
    972 sigdelset(mask, signo);
    973 sigdelset(&p->p_sigctx.ps_sigcatch, signo);
    974 sigdelset(&p->p_sigctx.ps_sigignore, signo);
    975 sigdelset(&SIGACTION_PS(ps, signo).sa_mask, signo);
    976 SIGACTION_PS(ps, signo).sa_handler = SIG_DFL;
    977 mutex_exit(&ps->sa_mutex);
    978 }

https://nxr.netbsd.org/xref/src/sys/kern/kern_sig.c?r=1.410#964

In other words, if you have asked for floating-point exception traps
via fpsetmask(3) or feeenableexcept(3), then you can't simply defer
or ignore them at the signal level any more than you can defer or
ignore SIGBUS or SIGSEGV.  And if the signal handler returns, it will
restart the instruction and -- if nothing has changed in the set of
trapped floating-point exceptions -- trap again, delivering the same
signal again.

Since we can't lock access to signal dispositions, I don't think we
can guarantee the same effect from userland atomically, but we can
get a close approximation (should be good enough for single-threaded
programs, at least) by mimicking this logic and calling sigqueueinfo
in a loop.

PR misc/56820: Many FPE related tests fail on softfloat machines

(riastradh)

2025-04-27 14:30:28 UTC MAIN commitmail json YAML

tests/kernel/Makefile: Back out DPSRCS for t_execregs arch helpers.

This time for real -- accidentally backed out the wrong commit last
time:

https://mail-index.netbsd.org/source-changes/2025/04/26/msg156620.html

Doesn't work the way I'd hoped for update builds -- I had tested it
only with a .h file, not with the .S files:

#    create  kernel//work/src/tests/kernel/arch/arm/execsp.d
CC=/work/tools/bin/arm--netbsdelf-eabi-gcc /work/tools/bin/nbmkdep -f /work/src/tests/kernel/arch/arm/execsp.d.tmp  -- --sysroot=/branches/hosts-current/evbearmv5 -D_KERNTYPES -I/work/src/tests/kernel/..    -x assembler-with-cpp /work/src/tests/kernel/arch/arm/execsp.S &&  mv -f /work/src/tests/kernel/arch/arm/execsp.d.tmp /work/src/tests/kernel/arch/arm/execsp.d
nbmkdep: unable to write to file /work/src/tests/kernel/arch/arm/execsp.d.tmp: Permission denied

PR kern/59084: exec/spawn leaks register content

(riastradh)

2025-04-27 14:30:03 UTC MAIN commitmail json YAML

t_execregs: Redo better diagnostics for child.

Accidentally backed out the wrong commit here:

https://mail-index.netbsd.org/source-changes/2025/04/26/msg156620.html

Meant to back out this one:

https://mail-index.netbsd.org/source-changes/2025/04/26/msg156607.html

Instead backed out this one (which I am now restoring):

https://mail-index.netbsd.org/source-changes/2025/04/25/msg156596.html

PR kern/59084: exec/spawn leaks register content

(riastradh)

2025-04-27 14:23:54 UTC MAIN commitmail json YAML

distrib/amd64/cdroms/spec.in: Add buffer line after $NetBSD$.

Reduces chance of merge conflicts when changing content we might
plausibly edit.  No functional change intended.

(riastradh)

2025-04-27 14:04:19 UTC MAIN commitmail json YAML

tests/lib/csu: Build h_hello.o with -fPIE, not -fpie.

Static libraries like libc may overflow the bounds assumed by -fpie.
Resolves:

h_hello.o: in function `main':
h_hello.c:(.text.startup+0x30): relocation truncated to fit: R_SPARC_GOT13 against symbol `__sF' defined in .data.rel section in /tmp/build/2025.04.27.10.22.23-sparc64/destdir/usr/lib/libc.a(findfp.o)

PR lib/59359: static pies are broken

(riastradh)

2025-04-27 10:22:23 UTC MAIN commitmail json YAML

Add pie as set lists attribute

(martin)

2025-04-27 10:19:34 UTC MAIN commitmail json YAML

Add new paths for kernel code when using KERNEL_DIR

(pgoyette)

2025-04-27 09:11:01 UTC MAIN commitmail json YAML

2025-04-27 04:44:44 UTC MAIN commitmail json YAML

2025-04-27 04:38:43 UTC MAIN commitmail json YAML

2025-04-27 04:09:35 UTC MAIN commitmail json YAML

lib/csu: Add tests of {static, dynamic} x {pie, non-pie}.

Main goal here is to test static pies, but let's take advantage of
this to test the same code several ways, since the csu logic has some
differences for static vs dynamic builds too like the ordering of
_libc_init calls.

PR lib/59359: static pies are broken

(riastradh)

2025-04-27 03:48:34 UTC MAIN commitmail json YAML

bsd.own.mk: If NOPIE is defined, set MKPIE=no.

This way, on sun2, we don't wind up with the bizarre setting of
MKPIC=no MKPIE=yes by default.

Preparation for conditionalizing automatic tests for:

PR lib/59359: static pies are broken

(riastradh)

2025-04-27 02:54:05 UTC MAIN commitmail json YAML

Fix builds on NetBSD hosts.

Do not #include prop_object_impl.h in tools or _STANDALONE
builds, it (directly or indirectly) brings in far too much
that is inappropriate in those environments.

If its sole reason for being added was for the fallback
definition of _PROP_EXPORT then in those cases, simply
supply that here.

This is most probably not the most elegant of fixes, and a
better way of supplying that fallback definition than dumping
it in the middle of prop_object_impl.h should be found.

Someone else's problem - but DO test any alternative version
of this with a complete clean build on a NetBSD host before
committing.  And note, that since prop_object_impl.h includes
nbtool_config.h, when appropriate, it MUST be included before
any other system include file (but that change alone is not
sufficient to fix things, so do it this way instead).

This should unbreak all (well, all the previously unbroken)
builds on NetBSD hosts.

(kre)

2025-04-27 02:24:07 UTC MAIN commitmail json YAML

t_execregs: implement sh3 h_execregs helper

Just dumps mcontext __gregset_t for now.
Not yet hooked into the build.

(uwe)

2025-04-27 02:18:26 UTC MAIN commitmail json YAML

sh3/mcontext.h: make asm-friendly, respect _LOCORE

(uwe)

2025-04-27 01:32:09 UTC MAIN commitmail json YAML

amd64/param.h: Fix KASAN/KMSAN build (and ALL build by extension).

Make UPAGES match what it was before my recent changes, as verified
by the __CTASSERT below, justifying the existence of the __CTASSERT.

As I recall, SVS is incompatible with KASAN/KMSAN, so it doesn't
contribute to the sum; presumably KASAN/KMSAN requires three pages,
though I'm not sure where this is documented.  If it turns out this
accounting is wrong, we should fix it and cross-reference any relevant
constraints affecting the accounting.  (But for now I'm just making
sure to restore the status quo of these definitions, which was my
intent all along with adding the __CTASSERT.)

Issue noted by hannken@.

PR port-amd64/57661: Crash when booting on Xeon Silver 4416+ in
KVM/Qemu

(riastradh)

2025-04-27 00:11:57 UTC MAIN commitmail json YAML

tests/libexec/ld.elf_so/Makefile: Sort.

Preparation for:

PR bin/59360: ld.elf_so(8): missing RELR support

(riastradh)

2025-04-27 00:11:40 UTC MAIN commitmail json YAML

sys/exec_elf.h: Add some missing numbers from the ELF gABI.

Fix the meta-number DT_ENCODING while here: it is defined to be 32,
not 31; it is a name for the smallest DT_* tag that follows the rule
of only even-numbered tags using d_ptr, and odd-numbered tags using
either nothing or d_val.  Nothing uses DT_ENCODING directly, though,
so this shouldn't affect anything.

https://www.sco.com/developers/gabi/latest/ch5.dynamic.html

Preparation for:

PR bin/59360: ld.elf_so(8): missing RELR support

(riastradh)

2025-04-27 00:11:27 UTC MAIN commitmail json YAML

sys/exec_elf.h: Nix trailing whitespace.

No functional change intended.

Preparation for:

PR bin/59360: ld.elf_so(8): missing RELR support

(riastradh)

2025-04-27 00:03:46 UTC MAIN commitmail json YAML

t_signal_and_sp: Fix RCSID in sh3/execsp.S.

PR kern/59327: user stack pointer is not aligned properly

(riastradh)

2025-04-26 23:49:56 UTC MAIN commitmail json YAML

t_signal_and_sp: sh3 - mark expected failures

misaligned_sp_and_signal and signalsp_sigaltstack currently fail on
sh3 b/c the stack is not force-aligned for signal handlers.  Make
signalsphandler more robust by not touching the stack - we can save
r12 (GOT) in a register.

PR kern/59327: user stack pointer is not aligned properly

(uwe)

2025-04-26 22:34:52 UTC MAIN commitmail json YAML

2025-04-26 22:10:45 UTC MAIN commitmail json YAML

mk: Enable partial relro on mips64.

(nia)

2025-04-26 21:42:53 UTC MAIN commitmail json YAML

add an entry for ctftools

(christos)

2025-04-26 21:17:42 UTC MAIN commitmail json YAML

avoid possible use of uninitilaized error

reviewed by christos@

(joe)

2025-04-26 20:17:37 UTC MAIN commitmail json YAML

Instead of faking the kernel path in KERNEL_DIR, use proper entries in
the array. This has the advantage of producing correct error messages.

(christos)

2025-04-26 19:23:06 UTC MAIN commitmail json YAML

t_signal_and_sp: Define __EXPOSE_STACK to get STACK_ALIGNBYTES.

This is a bit silly: sys/param.h unconditionally defines
STACK_ALIGNBYTES if machine/param.h does, but if machine/param.h
doesn't, then it only provides the default

#define STACK_ALIGNBYTES __ALIGNBYTES

under the condition that __EXPOSE_STACK is defined.

But using __EXPOSE_STACK here is a lower-risk change than touching
sys/param.h.

PR kern/59327: user stack pointer is not aligned properly

(riastradh)

2025-04-26 19:05:35 UTC MAIN commitmail json YAML

t_signal_and_sp: Get STACK_ALIGNBYTES from sys/param.h.

Fills in a default of __ALIGNBYTES if machine/param.h doesn't define
it.

PR kern/59327: user stack pointer is not aligned properly

(riastradh)

2025-04-26 17:13:23 UTC MAIN commitmail json YAML

2025-04-26 12:21:37 UTC MAIN commitmail json YAML

tests/kernel/Makefile: Back out DPSRCS for t_signal_and_sp helpers.

Doesn't work the way I'd hoped for update builds -- I had tested it
only with a .h file, not with the .S files:

#    create  kernel//work/src/tests/kernel/arch/arm/execsp.d
CC=/work/tools/bin/arm--netbsdelf-eabi-gcc /work/tools/bin/nbmkdep -f /work/src/tests/kernel/arch/arm/execsp.d.tmp  -- --sysroot=/branches/hosts-current/evbearmv5 -D_KERNTYPES -I/work/src/tests/kernel/..    -x assembler-with-cpp /work/src/tests/kernel/arch/arm/execsp.S &&  mv -f /work/src/tests/kernel/arch/arm/execsp.d.tmp /work/src/tests/kernel/arch/arm/execsp.d

PR kern/59327: user stack pointer is not aligned properly

(riastradh)

2025-04-26 12:20:33 UTC MAIN commitmail json YAML

tests/kernel/Makefile: Back out DPSRCS for t_execregs arch helpers.

Doesn't work the way I'd hoped for update builds -- I had tested it
only with a .h file, not with the .S files:

#    create  kernel//work/src/tests/kernel/arch/arm/execsp.d
CC=/work/tools/bin/arm--netbsdelf-eabi-gcc /work/tools/bin/nbmkdep -f /work/src/tests/kernel/arch/arm/execsp.d.tmp  -- --sysroot=/branches/hosts-current/evbearmv5 -D_KERNTYPES -I/work/src/tests/kernel/..    -x assembler-with-cpp /work/src/tests/kernel/arch/arm/execsp.S &&  mv -f /work/src/tests/kernel/arch/arm/execsp.d.tmp /work/src/tests/kernel/arch/arm/execsp.d
nbmkdep: unable to write to file /work/src/tests/kernel/arch/arm/execsp.d.tmp: Permission denied

PR kern/59084: exec/spawn leaks register content

(riastradh)

2025-04-26 09:31:00 UTC MAIN commitmail json YAML

s/LIP Rset/LIP Reset/ in comment.

(andvar)

2025-04-26 08:41:03 UTC MAIN commitmail json YAML

doc: two weeks of changes

(nia)

2025-04-26 07:33:14 UTC MAIN commitmail json YAML

Unbreak bus_dmamem_map for mipsco.

Patch is sent from Miod Vallat:
> The switch to common code in 2009 did not account for private fields in
> bus_dma_segment_t, which are now left uninitialized but were relied upon
> by bus_dmamem_map().
>
> Remove these fields as their values were trivial to compute from the MI
> fields.
>
> This gives Ethernet and SCSI a chance to work again on this platform.

"switch to common code in 2009" was the following commit:
https://mail-index.netbsd.org/source-changes/2009/08/21/msg224405.html

We should eventually switch to the common mips bus_dma and it still
requires private _ds_vaddr for VIPT cache in MIPS3 case, but for now
his priority is to unbreak the code before attempting to improve it.

Note it looks the private _ds_paddr for mipsco was also pulled from
NetBSD/arc, where DMA address != physical address on jazzio devices.

(tsutsui)

2025-04-26 07:09:14 UTC MAIN commitmail json YAML

Some USBHIST (aka KERNHIST) fixes from sc.dying on current-users.

(skrll)

2025-04-26 07:08:48 UTC MAIN commitmail json YAML

Some USBHIST (aka KERNHIST) fixes from sc.dying on current-users.

(skrll)

2025-04-26 07:06:53 UTC MAIN commitmail json YAML

A USBHIST (aka KERNHIST) fix from sc.dying on current-users.

(skrll)

2025-04-26 07:05:56 UTC MAIN commitmail json YAML

Some USBHIST (aka KERNHIST) fixes from sc.dying on current-users. One
fixup from me.

(skrll)

2025-04-26 06:55:19 UTC MAIN commitmail json YAML

Make endif comment match actual definition.

(andvar)

2025-04-26 04:58:48 UTC MAIN commitmail json YAML

Remove dead code and variables from clock interrupt code.

These should have been removed on switching to using MI timecounter(9)
from MD microtime(9) impementation back in 2006:
https://mail-index.netbsd.org/source-changes/2006/09/15/0042.html
https://github.com/NetBSD/src/commit/12fed6d0

Patch from Miod Vallat.

(tsutsui)

2025-04-26 04:39:09 UTC MAIN commitmail json YAML

Move ipl_sr_map to model-specific file and add IPL_DDB entry.

This will help adding support for other mipsco systems such as
the RC3240 eventually.

Patch from Miod Vallat.

(tsutsui)

2025-04-26 04:07:05 UTC MAIN commitmail json YAML

Fix le(4) match routine to probe the address specified in config(5).

No functional changes with current kernel config files.

Also apply cosmetic changes:
- use proper variable name per examples in the bus_dma(9) man page
- fix an incorrect comment

Patch from Miod Vallat.

(tsutsui)

2025-04-26 03:49:34 UTC MAIN commitmail json YAML

2025-04-26 03:03:35 UTC MAIN commitmail json YAML

tests/kernel/Makefile: Add DPSRCS for t_execregs.c parts.

We build it with -DHAVE_EXECREGS_TEST if arch/.../execregs.h exists;
this way if you add it for a new architecture and do an update build,
t_execregs.c will be recompiled with the macro defined so it will
pick up the new stuff automatically.

PR kern/59084: exec/spawn leaks register content

(riastradh)

2025-04-26 03:01:39 UTC MAIN commitmail json YAML

2025-04-26 03:01:13 UTC MAIN commitmail json YAML

tests/kernel/Makefile: Add DPSRCS for t_signal_and_sp.c parts.

This way if you add, e.g., arch/foo/execsp.S, then t_signal_and_sp.c
will be recompiled with -DHAVE_EXECSP even if you don't make clean.

PR kern/59327: user stack pointer is not aligned properly

(riastradh)

2025-04-25 22:55:26 UTC MAIN commitmail json YAML

2025-04-25 22:51:29 UTC MAIN commitmail json YAML

librumphijack/t_tcpip: Fix clutter at /out.

PR misc/59354: librumphijack/t_tcpip leaves clutter at /out

(riastradh)

2025-04-25 21:12:31 UTC MAIN commitmail json YAML

s/abadoned/abandoned/ and s/fobidden/forbidden/ in comments.

(andvar)

2025-04-25 21:08:29 UTC MAIN commitmail json YAML

s/identiy/identity/ and s/chang /change/ in comments.

(andvar)

2025-04-25 21:07:20 UTC MAIN commitmail json YAML

s/cahanged/changed/ in comment.

(andvar)

2025-04-25 21:06:41 UTC MAIN commitmail json YAML

2025-04-25 19:34:39 UTC MAIN commitmail json YAML

Leave the kernel-dir sets in the $RELEASE directories so the
subsequent image-building targets can find them.

Use `ln -f'' to allow overwriting previous versions of links.

Addresses kern/55929

XXX More to come for building the image targets.

christos@ says ``go for it''

(pgoyette)

2025-04-25 13:09:44 UTC MAIN commitmail json YAML

t_compat_cancel: Use -1 rather than SIGALRM for expected signal.

On kernels without (e.g.) COMPAT_13, we get SIGSYS rather than
SIGALRM if the cancellation point doesn't cancel the syscall.

Won't help if we try to interrupt in-progress waits, but currently
none of the tests do that; we'll burn that bridge when we come to it,

PR lib/59240: POSIX.1-2024: cancellation point audit
PR lib/59247: pthread_cancelstub.c is inadequately tested

(riastradh)

2025-04-25 12:58:51 UTC MAIN commitmail json YAML

t_execregs: Make failure of child a little more obvious.

PR kern/59084: exec/spawn leaks register content

(riastradh)

2025-04-25 12:58:41 UTC MAIN commitmail json YAML

t_execregs: On aarch64, make sure to align stack to 16 bytes.

Should avoid SIGBUS with strict alignment (SCTLR_EL0.A bit).

PR kern/59084: exec/spawn leaks register content

(riastradh)

2025-04-25 12:11:14 UTC MAIN commitmail json YAML

t___sync_compare_and_swap: Mark tests xfail on armv5.

PR port-arm/56839: GCC emits wrong codes for compare_and_swap_1
bultins on armv5 (el & eb)

(riastradh)

2025-04-25 07:57:42 UTC MAIN commitmail json YAML

2025-04-25 02:24:01 UTC MAIN commitmail json YAML

2025-04-25 01:56:52 UTC MAIN commitmail json YAML

t_setjmp, t_sigstack: Mark compat13 setjmp tests xfail on arm.

(Does it even make sense to have compat_setjmp on arm?  Didn't we
break ABI compatibility with the oabi->eabi transition, long after
1.3?)

PR port-arm/59351: compat_setjmp is busted

(riastradh)

2025-04-25 01:18:51 UTC MAIN commitmail json YAML

hppa makecontext: Use STACK_ALIGNBYTES to refer to stack alignment.

No functional change intended -- just make it clearer and easier to
search.

PR kern/59327: user stack pointer is not aligned properly

(riastradh)

2025-04-25 01:18:38 UTC MAIN commitmail json YAML

hppa _lwp_makecontext: Align stack pointer.

PR kern/59327: user stack pointer is not aligned properly

(riastradh)

2025-04-25 01:18:24 UTC MAIN commitmail json YAML

mips _lwp_makecontext: Align sp.

PR kern/59327: user stack pointer is not aligned properly

(riastradh)

2025-04-25 01:17:11 UTC MAIN commitmail json YAML

hppa _lwp_makecontext, makecontext: Sort includes.

No functional change intended.

PR kern/59327: user stack pointer is not aligned properly

(riastradh)

2025-04-25 00:59:27 UTC MAIN commitmail json YAML

2025-04-25 00:26:59 UTC MAIN commitmail json YAML

mips: Align stack pointer on entry to signal handler.

Based on a patch by rin@.  The variant approach I took puts the stack
frame allocation and alignment logic in one place (getframe, used by
sendsig_siginfo for native (n64, on mips), netbsd32_sendsig_siginfo
for compat32 (n32/o32, on mips), and sendsig_sigcontext (compat 1.6))
and reduces the chance of provoking compiler exploitation of
undefined behaviour by doing arithmetic in uintptr_t rather than in
pointers to large aligned structs.  This also ensures the resulting
pointer is aligned for the object (struct siginfo_sigframe, struct
siginfo_sigframe32, struct sigcontext), not just for the ABI stack
alignment.

PR kern/59327: user stack pointer is not aligned properly

(riastradh)

2025-04-25 00:08:38 UTC MAIN commitmail json YAML

mips __resumecontext: Align private stack frame size.

On mips64, UCONTEXT_SIZE is 664=0x298 (n32) or 744=0x2e8 (n64), but
sp is required to have 16-byte alignment in the ABI, so we need to
round the stack frame allocation up to 0x2a0 or 0x2f0.

No functional change intended on mips o32.  Unlikely to have a
practical change on mips n32/n64, but possible if signal delivery
wins a race -- until we fix sp alignment in signal handler calls,
coming soon.

Based on a patch by rin@.

PR kern/59327: user stack pointer is not aligned properly

(riastradh)

2025-04-25 00:03:16 UTC MAIN commitmail json YAML

t_signal_and_sp: Check alignment of default thread stack too.

Not just with pthread_attr_setstack.

PR kern/59327: user stack pointer is not aligned properly

(riastradh)

2025-04-24 23:56:50 UTC MAIN commitmail json YAML

lib/libc/arch/mips/gen/_lwp.c: Sort includes.

No functional change intended.

Preparation for:

PR kern/59327: user stack pointer is not aligned properly

(riastradh)

2025-04-24 23:56:25 UTC MAIN commitmail json YAML

sparc _lwp_makecontext, makecontext: Sort includes.

No functional change intended.

Tidying up for:

PR kern/59327: user stack pointer is not aligned properly

(riastradh)

2025-04-24 23:55:18 UTC MAIN commitmail json YAML

mips: Make sure stack is aligned on exec.

The only caller of setregs, sys/kern/kern_exec.c execve_runproc,
already guarantees STACK_ALIGNBYTES alignment, so let's assert it but
out of paranoia also clear the bits anyway just in case for non-
DIAGNOSTIC builds.

Based on a patch by rin@.

PR kern/59327: user stack pointer is not aligned properly

(riastradh)

2025-04-24 23:54:14 UTC MAIN commitmail json YAML

mips/makecontext.c: Use STACK_ALIGNBYTES for clarity.

No functional change intended.

Tidying to make stack alignment more obvious, prompted by:

PR kern/59327: user stack pointer is not aligned properly

Part of a patch by rin@.

(riastradh)

2025-04-24 23:51:44 UTC MAIN commitmail json YAML

mips/makecontext.c: Sort includes.

No functional change intended.

Preparation for:

PR kern/59327: user stack pointer is not aligned properly

(riastradh)

2025-04-24 23:51:03 UTC MAIN commitmail json YAML

x86: Make sure esp is aligned when delivering signal.

While here, use STACK_ALIGNBYTES consistently for the alignment mask
(or STACK_ALIGNBYTES32 in amd64 for the compat32 alignment mask).

PR kern/59327: user stack pointer is not aligned properly

(riastradh)

2025-04-24 18:37:59 UTC MAIN commitmail json YAML

2025-04-24 17:00:25 UTC MAIN commitmail json YAML

t_signal_and_sp: contextsplink test may not be broken on n64.

n32 and n64 have the same stack alignment requirement (16-byte), so
if there were a problem it would probably manifest on n32 too.  But
the only things that __resumecontext does with a misaligned sp are:

1. syscall getcontext (not even via the syscall stub, but via the
  syscall instruction directly), which is unlikely to care; and

2. tail-call setcontext, which does a syscall (again, unlikely to
  care) that will discard the caller's sp and replace it altogether.

So I'm not sure we can even test potential adverse consequences of
misalignment inside __resumecontext, short of interposing our own
setcontext symbol to artificially verify its stack alignment before
passing on to the syscall -- which, while feasible, is maybe not
worth the effort.

PR kern/59327: user stack pointer is not aligned properly

(riastradh)

2025-04-24 16:57:27 UTC MAIN commitmail json YAML

t_signal_and_sp: Mark signalsp xfail on mips n32/n64.

The kernel takes an initially aligned stack pointer and subtracts
sizeof(struct sigframe_siginfo) or sizeof(struct sigframe_siginfo32)
from it -- that is, 872=0x368 or 792=0x318 bytes, respectively.  But
n32 and n64 require 16-byte stack alignment.

PR kern/59327: user stack pointer is not aligned properly

(riastradh)

2025-04-24 16:53:44 UTC MAIN commitmail json YAML

Remove the now static _prop_format_default and _prop_string_type_tags.
Ride the minor bump from a few hours ago.
XXX should use -fvisibility=hidden and only export public symbols
XXX and then bump major

(martin)

2025-04-24 16:50:02 UTC MAIN commitmail json YAML

tests/lib/libc/setjmp/t_sigstack: Update xfails.

Designations based on actual test run for i386 and code inspection
for arm and sh3 (and code inspection for all the other architectures
not listed because I expect the tests to pass on them -- they mostly
use sigreturn which will DTRT).

Move the ia64 xfail to just setjmp/sigsetjmp -- no compat13 on ia64.

Nix the long comment now that just about everything has been fixed.

PR lib/57946: longjmp fails to restore stack first before restoring
signal mask on most architectures

(riastradh)

2025-04-24 15:50:52 UTC MAIN commitmail json YAML

2025-04-24 14:42:45 UTC netbsd-10 commitmail json YAML

2025-04-24 14:40:51 UTC netbsd-10 commitmail json YAML

Pull up following revision(s) (requested by martin in ticket #1102):
build.sh: revision 1.389-1.391 via patch
Fix "show-revisionid" operation to include both src and xsrc
data if the -x argument is present.
--
Minor cosmetic tweaks to previous
--
Simplify previous (from kre@)

(snj)

2025-04-24 14:24:45 UTC MAIN commitmail json YAML

2025-04-24 14:18:44 UTC netbsd-9 commitmail json YAML

2025-04-24 14:17:05 UTC netbsd-9 commitmail json YAML

Pull up following revision(s) (requested by martin in ticket #1945):
build.sh: revision 1.389-1.391 via patch
Fix "show-revisionid" operation to include both src and xsrc
data if the -x argument is present.
--
Minor cosmetic tweaks to previous
--
Simplify previous (from kre@)

(snj)

2025-04-24 12:54:43 UTC MAIN commitmail json YAML

mips: Fix compat_13_sys_sigreturn locking.

This had been broken back in rev. 1.13.20.1 (on the newlock2 branch,
merged into HEAD as 1.14) in 2007.

Should fix:

  lib/libc/setjmp/t_setjmp (261/985): 10 test cases
      _longjmp_zero: [0.078125s] Passed.
      _setjmp: [0.093750s] Passed.
      compat13_longjmp_zero: [ 7875.3945352] panic: kernel diagnostic assertion "mutex_owned(l->l_proc->p_lock)" failed: file "/tmp/build/2025.04.24.01.52.38-pmax/src/sys/kern/sys_sig.c", line 590
  [ 7875.3984415] cpu0: Begin traceback...
  [ 7875.4062540] pid -2135532376 not found
  [ 7875.4140665] cpu0: End traceback...
  [ 7875.6093790] 0x80b65c90: cpu_reboot+0x3c (0x80b64000,0,0x866e5400,0x805b6440) ra 0x803197c0 sz 24
  [ 7875.7109415] 0x80b65ca8: kern_reboot+0xb0 (0x80b64000,0,0x866e5400,0x805b6440) ra 0x80369c80 sz 40
  [ 7875.7109415] 0x80b65cd0: vpanic+0x1dc (0x80b64000,0,0x866e5400,0x805b6440) ra 0x804c085c sz 48
  [ 7875.7109415] 0x80b65d00: kern_assert+0x3c (0x80b64000,0x804e6a3c,0x8051f7a8,0x8052e330) ra 0x8038df4c sz 32
  [ 7875.7265665] 0x80b65d20: sigprocmask1+0x224 (0x80b64000,0x804e6a3c,0x8051f7a8,0x8052e330) ra 0x800616f0 sz 48
  [ 7875.7265665] 0x80b65d50: compat_13_sys_sigreturn+0x1f0 (0x80b64000,0x804e6a3c,0x8051f7a8,0x8052e330) ra 0x80055178 sz 376
  [ 7875.7265665] 0x80b65ec8: syscall+0x158 (0x80b64000,0x804e6a3c,0x8051f7a8,0x8052e330) ra 0x800450ac sz 128
  [ 7875.7265665] 0x80b65f48: mips1_systemcall+0xec (0x80b64000,0x804e6a3c,0x8051f7a8,0x8052e330) ra 0x7923d090 sz 0
  [ 7875.7265665] PC 0x7923d090: not in kernel space
  [ 7875.7265665] 0x80b65f48: 0+0x7923d090 (0x80b64000,0x804e6a3c,0x8051f7a8,0x8052e330) ra 0 sz 0
  [ 7875.7265665] User-level: pid 17290.17290

https://releng.netbsd.org/b5reports/pmax/2025/2025.04.24.01.52.38/test.log

(Probably won't do anything about `pid -2135532376 not found',
though!)

Prompted by adding tests for compat13 for:

PR port-mips/59285: _longjmp(..., 0) makes setjmp return 0, not 1
PR port-mips/59342: compat_setjmp.S is confused about delay slots
PR port-mips/59343: compat_sigsetjmp.S: missing RESTORE_GP64

(riastradh)

2025-04-24 12:40:32 UTC MAIN commitmail json YAML

2025-04-24 12:39:06 UTC MAIN commitmail json YAML

Make the sparc64 camelia asm code depend on CMLL_ASM (which is used
to guard the definition of the runtime test result)

(martin)

2025-04-24 11:01:27 UTC MAIN commitmail json YAML

Add a STACK_ALIGNBYTES definition

(martin)

2025-04-24 09:58:26 UTC MAIN commitmail json YAML

Skip __CTASSERT() when _STANDALONE

Unbreak the amd64 build (the assembler did not like those things!).

These __CTASSERT()'s aren't really useful in any case, and
should probably just be deleted - they simply check that the
arithmetic in the previous few lines produces the answers
expected.

If those answers were critical, then we shouldn't be computing
them in the first place, and should simply
#define UPAGES 8
(conditionally, replacing all the previous computation which
generates UPAGES, and the 3 __CTASSERT()'s.)

But I suspect that they're not critical, they just happen to be
the answers currently expected to be achieved.  That's not something
that should be asserted to be true, it isn't a required fact, it
could easily be altered in one of the cases if needed, and everything
else should cope with that.

(kre)

2025-04-24 09:29:09 UTC MAIN commitmail json YAML

offsetof() needs <stddef.h>  (<sys/stddef.h>)

Include <sys/stddef.h> when offsetof() is to be used.

First step in fixing x86 builds.

(kre)

2025-04-24 08:21:36 UTC MAIN commitmail json YAML

include <sys/param.h> for STACK_ALIGNBYTES

(martin)

2025-04-24 07:37:13 UTC MAIN commitmail json YAML

include <sys/param.h> for STACK_ALIGNBYTES

(martin)

2025-04-24 01:52:38 UTC MAIN commitmail json YAML

2025-04-24 01:52:03 UTC MAIN commitmail json YAML

x86/identcpu.c: Sort includes.

No functional change intended.

Preparation for:

PR port-amd64/59299: Support Intel AMX CPU state (TILECFG/TILEDATA)

(riastradh)

2025-04-24 01:51:43 UTC MAIN commitmail json YAML

amd64: Enable TILECFG and TILEDATA registers.

This allows processes to use the registers, and NetBSD will save and
restore them in context switches.  But it does not expose them to
ptrace(2) or debuggers like all the other extended CPU state
(xmm/ymm/zmm) -- that will require more work.

PR kern/57661: Crash when booting on Xeon Silver 4416+ in KVM/Qemu
PR port-amd64/59299: Support Intel AMX CPU state (TILECFG/TILEDATA)

(riastradh)

2025-04-24 01:51:21 UTC MAIN commitmail json YAML

x86: Reserve space for only the extended CPU state we will use.

CPUID[EAX=0x0d, ECX=0].ECX, i.e., the value of descs[2] after
x86_cpuid2(0x0d, 0, descs), gives the size in bytes of the extended CPU
state for all features supported by the hardware in CPUID[EAX=0x0d,
ECX=0].EAX which can be enabled in XCR0.  However, on i386, it is
senseless to leave TILECFG and TILEDATA enabled, because they are state
for Intel AMX instructions which work only in 64-bit mode.

So, instead of querying the hardware's supported features and maximum
_supported_ extended CPU state size:

1. Query the hardware's supported features.
2. Enable only those supported by software as well (XCR0_FPU).
3. Query the hardware's maximum _enabled_ extended CPU state size.

We will also disable TILECFG and TILEDATA on amd64 for now too
because:

(a) This is not a regression, at least for TILEDATA (and I'm not sure
    any machines ship with TILECFG but not TILEDATA), because the
    size overflowed the PCB page and therefore never worked on amd64
    (PR port-amd64/57661: Crash when booting on Xeon Silver 4416+ in
    KVM/Qemu).

(b) We need a little extra work to properly support reading and
    writing a process's TILECFG and TILEDATA in ptrace(2), and that
    work hasn't been done yet.

While here, write out x86_cpuid2(0x0d, <ecx>, ...) explicitly, rather
than x86_cpuid(0x0d, ...), to make it clear that ECX must be set --
otherwise we may get garbage.  (It is, perhaps, an accident that
x86_cpuid(<eax>, ...) always sets ECX=0, but other CPUID access
paths, like gcc's <cpuid.h> __cpuid(<eax>, ...), do not, so let's
make it clear for the reader.)

XXX When we enable TILECFG and TILEDATA in amd64, we should arrange
to disable them in compat32 processes -- no sense in allocating extra
space for state they can't use anyway, since the Intel AMX
instructions work only in 64-bit mode.  However, selectively
disabling them in some contexts might require hardware support for
XFD, Extended Feature Disable, which is another kettle of fish to
deal with.

PR port-amd64/57661: Crash when booting on Xeon Silver 4416+ in
KVM/Qemu

(riastradh)

2025-04-24 01:51:08 UTC MAIN commitmail json YAML

x86: Add some more XCR0 bits and references.

PR port-amd64/57661: Crash when booting on Xeon Silver 4416+ in
KVM/Qemu

(riastradh)

2025-04-24 01:50:39 UTC MAIN commitmail json YAML

amd64: Allocate FPU save state outside pcb if it's too large.

We have seen x86_fpu_save_size values (CPUID[EAX=0x0d, ECX=0].ECX) as
large as 11008 bytes, notably with Intel AMX TILEDATA's 8192-byte
state.

We only do this for user threads, and only on machines where it's
necessary, to avoid incurring much overhead.  There is still a tiny
bit of overhead when saving and restoring the FPU state by using a
pointer indirection instead of arithmetic indirection for access to
struct pcb::pcb_savefpu, but this is probably a drop in the bucket
compared to the memory traffic incurred by the FPU state save/restore
anyway.

For now, these paths are mostly disabled on i386.  We could enable
them but it will require either rewriting cpu_uarea_alloc/free for
i386, or adopting a guard page like amd64 does, which might be costly
and so should be undertaken only with some thought and care.  And
since Intel AMX instructions only work in 64-bit mode, it's not
likely to be useful on i386.

PR port-amd64/57661: Crash when booting on Xeon Silver 4416+ in
KVM/Qemu

These changes, as a side effect, may fix:

PR kern/57258: kthread_fpu_enter/exit problem

by making sure to allocate an FPU save space that is large enough to
guarantee fpu_kern_enter/leave work safely, instead of just using a
union savefpu object on the stack (which, at 576 bytes, may be too
small on some machines, particularly with AVX512 requiring ~2.5K).
(But we'll have to do some extra work with kthread_fpu_enter/exit_md
-- if we try doing them again on x86 -- to actually allocate the
separate pcb on these machines!)

(riastradh)

2025-04-24 01:49:30 UTC MAIN commitmail json YAML

amd64/param.h: Make UPAGES definition clearer.

Break it down into subaccounts that are summed at the end to make it
clear how much each part is using, and how many pages are actually
reserved for the stack.

No functional change intended.

PR port-amd64/57661: Crash when booting on Xeon Silver 4416+ in
KVM/Qemu

(riastradh)

2025-04-24 01:48:21 UTC MAIN commitmail json YAML

sparc, sparc64 longjmp: Use _UC_SIGMASK to restore signal mask.

This way, restoring the signal mask and restoring the stack pointer
happen atomically with respect to signal handler calls, whereas using
sigprocmask would restore the signal mask _before_ the stack pointer,
breaking sigaltstack.

The motivation for using sigprocmask first and then setcontext later,
rather than _UC_SIGMASK in setcontext, was to get SA-based libpthead
sigprocmask interposition.  But that's long gone and unlikely to come
back.

PR lib/57946: longjmp fails to restore stack first before restoring
signal mask on most architectures

(riastradh)

2025-04-24 01:47:55 UTC MAIN commitmail json YAML

mips longjmp: Use _UC_SIGMASK to restore signal mask.

This way, restoring the signal mask and restoring the stack pointer
happen atomically with respect to signal handler calls, whereas using
sigprocmask would restore the signal mask _before_ the stack pointer,
breaking sigaltstack.

The motivation for using sigprocmask first and then setcontext later,
rather than _UC_SIGMASK in setcontext, was to get SA-based libpthead
sigprocmask interposition.  But that's long gone and unlikely to come
back.

PR lib/57946: longjmp fails to restore stack first before restoring
signal mask on most architectures

(riastradh)

2025-04-24 01:43:20 UTC MAIN commitmail json YAML

mips/compat_longjmp: Make sure compat13 setjmp returns nonzero.

PR port-mips/59285: _longjmp(..., 0) makes setjmp return 0, not 1

(riastradh)

2025-04-24 01:42:38 UTC MAIN commitmail json YAML

mips/compat_sigsetjmp: Add missing RESTORE_GP64.

Otherwise, compat13 sigsetjmp clobbers the caller's gp when it
returns (the first time around, anyway), which leads to a lovely
display of fireworks.

PR port-mips/59343: compat_sigsetjmp.S: missing RESTORE_GP64

(riastradh)

2025-04-24 01:42:26 UTC MAIN commitmail json YAML

mips/compat_setjmp: .set reorder doesn't have delay slots.

PR port-mips/59342: compat_setjmp.S is confused about delay slots

(riastradh)

2025-04-24 01:41:48 UTC MAIN commitmail json YAML

t_setjmp, t_sigstack: Test compat13 setjmp/sigsetjmp too.

PR port-mips/59342: compat_setjmp.S is confused about delay slots
PR port-mips/59343: compat_sigsetjmp.S: missing RESTORE_GP64

(riastradh)

2025-04-24 01:41:01 UTC MAIN commitmail json YAML

t_setjmp: Tidy up.

- KNF.
- Nix trailing whitespace.
- Use RL from h_macros.h.
- Use enum and case.

No functional change intended.

Preparation for extending these tests to the compat13 functions,
prompted by:

PR port-mips/59285: _longjmp(..., 0) makes setjmp return 0, not 1
PR port-mips/59342: compat_setjmp.S is confused about delay slots
PR port-mips/59343: compat_sigsetjmp.S: missing RESTORE_GP64

(riastradh)

2025-04-24 01:40:27 UTC MAIN commitmail json YAML

mips: Disable rdhwr emulation fast path on Octeon CPUs.

They are haunted.

PR kern/59064: jemalloc switch to 5.3 broke userland
PR kern/59236: Multiple segfaults in erlite3 boot

(riastradh)

2025-04-23 20:14:59 UTC MAIN commitmail json YAML

2025-04-23 19:37:00 UTC MAIN commitmail json YAML

make: fix grammar in debug log message

(rillig)

2025-04-23 19:27:23 UTC MAIN commitmail json YAML

make: prevent overly large values for the -j option

A comment previously suggested to clip the number of parallel jobs to
PIPE_BUF, but that would have been wrong, as PIPE_BUF is not the maximum
capacity of a pipe, but rather the maximum number of bytes that are
guaranteed to be written to the pipe atomically.

Previously, the output end of the token pool pipe was blocking, which
meant that the "errno == EAGAIN" branches were unreachable. Now that the
pipe is nonblocking, they would be reachable. When setting up the token
pool, writing to a full pipe indicates too many parallel jobs requested,
and is thus rejected. At any later point in time, writing to a full pipe
indicates an internal error, as each sub-make is supposed to only return
as many tokens as it previously took from the pool. Therefore, error out
in these situations.

(rillig)

2025-04-23 12:17:05 UTC MAIN commitmail json YAML

cleaar trailig whitespace

(joe)

2025-04-23 10:46:08 UTC MAIN commitmail json YAML

adjust for libprop minor bump

(martin)

2025-04-23 06:06:55 UTC MAIN commitmail json YAML

Simplify previous (from kre@)

(martin)

2025-04-23 03:00:38 UTC MAIN commitmail json YAML

Note JSON support in proplib(3).

(thorpej)

2025-04-23 02:58:53 UTC MAIN commitmail json YAML

Add support for serializing to, and de-serializing from, JSON, as
specified in RFC 8259.  Format is automatically detected for input,
and can be specified explicitly for output.  The default format remains
XML.

As part of this change, generic prop_object_{internalize,externalize}()
functions are provided, and the "_with_format" flavor allows the output
format to be specified.  Previous array- and dictionary-specific routines
remain for backwards compatibility.

(thorpej)

2025-04-22 19:28:50 UTC MAIN commitmail json YAML

make: clean up

Replace 'unsigned int' with simply 'unsigned'.

In compat.c, skipping whitespace is not needed, as the loop above
already skips it.

In job.c, remove the unused header <sys/file.h>.

Inline the TMPPAT macro, as it is only needed in a single place.

(rillig)

2025-04-22 17:50:34 UTC MAIN commitmail json YAML

2025-04-22 17:39:12 UTC MAIN commitmail json YAML

2025-04-22 17:01:31 UTC MAIN commitmail json YAML

mips: Fix _longjmp(..., 0) so _setjmp returns 1 as intended.

_setjmp (like setjmp and sigsetjmp) is only permitted to return 0 the
first time around.

PR port-mips/59285: _longjmp(..., 0) makes setjmp return 0, not 1

(riastradh)

2025-04-22 14:25:50 UTC MAIN commitmail json YAML

timespec_get(3): add timespec_getres return type, brush up markup

(uwe)

2025-04-22 13:48:24 UTC MAIN commitmail json YAML

2025-04-22 13:12:11 UTC MAIN commitmail json YAML

t_setjmp: Mark _longjmp_zero xfail on mips.

PR port-mips/59285: _longjmp(..., 0) makes setjmp return 0, not 1

(riastradh)

2025-04-22 12:05:19 UTC MAIN commitmail json YAML

NVMM hypervisor identification, KVM and GenPVH identification fixes

arch/x86/include/cpu.h, arch/x86/x86/identcpu.c: Enable NVMM hypervisor
discovery
arch/x86/x86/identcpu.c: Fix vm_guest_t for KVM in vm_system_products
iarch/x86/x86/x86_machdep.c: Add NVMM and GenPVH in vm_guest_name

(imil)

2025-04-22 10:22:29 UTC MAIN commitmail json YAML

Minor cosmetic tweaks to previous

(martin)

2025-04-22 10:14:36 UTC MAIN commitmail json YAML

Fix "show-revisionid" operation to include both src and xsrc
data if the -x argument is present.

(martin)

2025-04-22 09:41:17 UTC MAIN commitmail json YAML

Merge the manual pages for timespec_get(3) and timespec_getres(3).

(nia)

2025-04-22 06:05:51 UTC MAIN commitmail json YAML

make: remove no-op code

Whitespace is already skipped in the loop above.

When no jobs are running, there is no need to wait for one.

(rillig)

2025-04-22 05:57:12 UTC MAIN commitmail json YAML

make: move struct Job from job.h to job.c

The content of this struct is an implementation detail, and other parts
of make only need to access very few parts of it.

(rillig)

2025-04-22 05:56:25 UTC MAIN commitmail json YAML

vio9p: export tag via sysctl

With this change, we can see tags of virtio-9p devices via sysctl:
  # sysctl hw.vio9p
  hw.vio9p.vio9p0.tag = test
  hw.vio9p.vio9p1.tag = test2

PR kern/59165

(ozaki-r)