FreeBSD/src e32b274. run.c FIXES, testdir T.misc T.errmsg

awk: Update to 20250116 bsd-feature 2dce54b053d4

Update to 20250116 upstream. This fixes issues with bad line numbers,
hex numbers, an indirection in variable dereferencing and prevent
openfile from reading directories.

Jan 14, 2025
        Fix incorrect error line number issues. unput has
        no business managing lineno. Thanks to Ozan Yigit.
Jan 05, 2025
        Fix hex detection in is_valid_number.
        Fix indirect field specification with non-numeric string
        eg. $("foo") in indirect. This is not illegal.
        Thanks to Arnold Robbins.
Jan 01, 2025
        Fixed openfile to not try to read from a directory.
        Thanks to Arnold Robbins.

Sponsored by:           Netflix
DeltaFile
+10-5run.c
+14-0FIXES
+7-1testdir/T.misc
+0-7lex.c
+0-3testdir/T.errmsg
+1-1main.c
+32-171 files not shown
+33-187 files

FreeBSD/src 194bb58sys/x86/x86 cpu_machdep.c local_apic.c

x86: Fixes for nmi/pmi interrupt sharing

- Fix a bug where the semantics of refcount_release() were
reversed.  This would lead to the nmi interrupt being prematurely
masked in the local apic, leading to an out-of-tree profiling
tool only getting results the first time it was run.

- Stop executing nmi handlers after one claims the interrupt.
The core2 hwpmc handler seems to be especially heavy, and running it
in addition to vtune's handler caused roughly 50% of the nmi interrupts
to be lost (and caused vtune to give worse results).

Reviewed by: bojan
Sponsored by: Netflix
DeltaFile
+8-3sys/x86/x86/cpu_machdep.c
+1-1sys/x86/x86/local_apic.c
+9-42 files

FreeBSD/src 856d316sys/arm64/arm64 efirt_support.S, sys/modules/efirt Makefile

arm64: Hook up efi_rt_arch_call in efirt.ko

Note that this requires marking efi_rt_fault as a non-preemptible
local symbol.

Co-authored-by: Jessica Clarke <jrtc27 at FreeBSD.org>
Reviewed by:    imp, andrew
Obtained from:  CheriBSD
Fixes:          d7f930b80e89 ("arm64: Implement efi_rt_arch_call")
Differential Revision:  https://reviews.freebsd.org/D48715
DeltaFile
+4-3sys/modules/efirt/Makefile
+2-2sys/arm64/arm64/efirt_support.S
+6-52 files

FreeBSD/src 0e4c4ccshare/mk bsd.lib.mk bsd.README

share/mk: Remove more support for building profiled libraries

- Remove documentation of profiled library support from bsd.README

- Remove rules to create individual .po files.  The rules to generate
  an archive from these files was already removed, so these .po rules
  aren't used.

Reviewed by:    emaste
Fixes:          3750ccefb862 ("Retire MK_PROFILE infrastructure")
Differential Revision:  https://reviews.freebsd.org/D48819
DeltaFile
+3-29share/mk/bsd.lib.mk
+11-16share/mk/bsd.README
+14-452 files

FreeBSD/src 6180d03tools/boot ci-qemu-test.sh

Cirrus-CI: Check for final "Uptime" message

The last thing printed by the kernel after shutdown is Uptime: <time>.
In the CI boot test script add a check for this, to ensure that shutdown
is successful.  A test branch of mine panicked during shutdown, but
still reported success in Cirrus-CI.

Reviewed by:    kevans
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48823
DeltaFile
+2-2tools/boot/ci-qemu-test.sh
+2-21 files

FreeBSD/src e917958libexec/rtld-elf rtld.c

rtld: clear any holes in the struct utrace_rtld passed to kernel logger

This should avoid an (almost) false positive from Valgrind, by filling
the padding on LP64.

PR:     284563
Reported by:    Paul Floyd <pjfloyd at wanadoo.fr>
Reviewed by:    emaste
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D48854
DeltaFile
+2-2libexec/rtld-elf/rtld.c
+2-21 files

FreeBSD/src 84e3ffasys/dev/mlx4/mlx4_core mlx4_cmd.c

mlx4ib(4): Fix some typos in device messages

- s/availible/available/

MFC after:      5 days
DeltaFile
+4-4sys/dev/mlx4/mlx4_core/mlx4_cmd.c
+4-41 files

FreeBSD/src 48f91causr.sbin/bhyve/riscv vmexit.c

bhyve/riscv: clean up SBI handlers.

Similar to kernel SBI clean up patch, do clean up in userspace SBI part:

- use standard SBI error codes;
- remove unused function.

Differential Revision:  https://reviews.freebsd.org/D48829
DeltaFile
+24-39usr.sbin/bhyve/riscv/vmexit.c
+24-391 files

FreeBSD/src 6492ef7usr.sbin/bhyve/riscv vmexit.c

bhyve: Sleep for a short period after VM_EXITCODE_DEBUG exits

Apply 2e2b8afa52da6 for RISC-V:

As on amd64 and aarch64 APs will repeatedly exit until they are
brought online, so this hack helps avoid burning CPU time during
guest bootup.

Reviewed by:    corvink, markj
Differential Revision:  https://reviews.freebsd.org/D48811
DeltaFile
+7-0usr.sbin/bhyve/riscv/vmexit.c
+7-01 files

FreeBSD/src ae65d59sys/riscv/vmm vmm_aplic.c

riscv vmm: various fixes in APLIC.

- Implement Level-sensitive interrupts
- Disable up to 32 interrupts by a single query (CLRIE register handling)
- Implement reading from DOMAINCFG

All of this needed for Linux guest.

Differential Revision:  https://reviews.freebsd.org/D48808
DeltaFile
+74-13sys/riscv/vmm/vmm_aplic.c
+74-131 files

FreeBSD/src d69ab49usr.sbin/bhyve/riscv vmexit.c

bhyve/riscv: fix HSM extension handling.

Pass private data from supervisor as the second argument on secondary
CPU startup.

This is used by Linux guest.

Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D48807
DeltaFile
+5-0usr.sbin/bhyve/riscv/vmexit.c
+5-01 files

FreeBSD/src 4eee138sys/riscv/vmm vmm_sbi.c vmm_riscv.c

riscv vmm: clean up SBI code

- Use SBI standard error codes (with respect to the spec)
- riscv_send_ipi() now takes cpuset_t* as an argument

Differential Revision:  https://reviews.freebsd.org/D48575
DeltaFile
+41-60sys/riscv/vmm/vmm_sbi.c
+15-14sys/riscv/vmm/vmm_riscv.c
+2-2sys/riscv/vmm/riscv.h
+58-763 files

FreeBSD/src e3898d5libexec/rc/rc.d devd

Revert "rc.d: Add hastd as a prereq for devd"

This reverts commit 2d17f44a5ae6e948c3a93cac30b8315d127ba900. It hangs
the boot. It turns out I installed my test on the wrong machine and
rebooted the other one...

Sponsored by:           Netflix
DeltaFile
+1-1libexec/rc/rc.d/devd
+1-11 files

FreeBSD/src d90e14fusr.sbin/mptutil mpt_config.c

mptutil: Capture CAM errors from bus rescan

This will force reporting of CAM errors from rescanning the bus.

PR: 174072
Reviewed by: imp
DeltaFile
+12-8usr.sbin/mptutil/mpt_config.c
+12-81 files

FreeBSD/src f52154asys/dev/hptrr hptrr_osm_bsd.c

hptrr: Better error recovery

This bug and https://www.mail-archive.com/freebsd-stable@freebsd.org/msg124458.html
both have this fix. It turns unknown errors into an autosense failure, which causes
us to grab the sense buffer manually. It also sets a condition that we use to retry
timed out commands that jmg reports as being helpful.

I'm torn on committing it. The code seems fine in terms of fixing
things. But this is a 10-year-old bug with few other bugs and a short CC
list for a driver that might go away in 15 anyway. I'm going to commit
and close the bug, and MFC it in a week, unless someone complains (which
seems unliekly, given the age of this hardware, I susepct most of it is
out of service).

Suggested by: jmg, Scott Long
PR: 191135
MFC After: 1 week
Reviewed by: imp
DeltaFile
+2-2sys/dev/hptrr/hptrr_osm_bsd.c
+2-21 files

FreeBSD/src 841dcdcsys/netlink netlink_domain.c netlink_module.c, sys/netlink/route iface.c

netlink: initialize VNET context with VNET_SYSINIT()

With the initial check-in netlink(4) was very conservative with regards to
using memory and intrusiveness to the kernel and network stack. In
particular it would initialize the VNET context only on the first actuall
call to socket(PF_NETLINK), saving on allocation of a struct nl_control of
size 224 bytes.

Now it is clear that netlink(4) is primary citizen of FreeBSD, with a set
of system tools using it.  So resort to normal VNET_SYSINIT() and with
that shave a lot of complexity, since after the change V_nl_ctl is
immutable.
DeltaFile
+30-59sys/netlink/netlink_domain.c
+16-45sys/netlink/netlink_module.c
+1-5sys/netlink/netlink_var.h
+0-6sys/netlink/route/iface.c
+0-1sys/netlink/netlink_ctl.h
+47-1165 files

FreeBSD/src 164dec8sys/netlink netlink_domain.c

netlink: rename functions that manipulate group membership of a pcb

Use nlp_ prefix for them, cause they operate on single pcb.  Use words
"join" and "leave" instead of "add" and "del", cause we aren't creating
or destroying groups, we are just joining or leaving.
Really assert locks instead of just having "locked" suffix.
DeltaFile
+17-12sys/netlink/netlink_domain.c
+17-121 files

FreeBSD/src ef3991dsys/netlink netlink_glue.c netlink_domain.c

netlink: don't store an extra pointer to so_cred
DeltaFile
+2-2sys/netlink/netlink_glue.c
+0-2sys/netlink/netlink_domain.c
+0-1sys/netlink/netlink_var.h
+2-53 files

FreeBSD/src 5630457sys/netlink netlink_domain.c

netlink: remove _pru_ prefix from protosw method names

This is a relic that doesn't has any value now.
DeltaFile
+8-8sys/netlink/netlink_domain.c
+8-81 files

FreeBSD/src 5b900bdsys/dev/mpt mpt_cam.c

mpt: replace mpt_prt with mpt_lprt in mpt_cam.c

Replace mpt_prt with mpt_lprt with DEBUG level to print kernel pointers
only at the debug level.

PR: 238662
Signed-off-by: Fuqian Huang <huangfq.daxian at gmail.com>
Reviewed-by: imp
DeltaFile
+10-5sys/dev/mpt/mpt_cam.c
+10-51 files

FreeBSD/src 2d17f44libexec/rc/rc.d devd

rc.d: Add hastd as a prereq for devd

Setuping up CARP and HAST described in:
        https://www.freebsd.org/doc/en/books/handbook/disks-hast.html
doesn't work at boot time because devd start before hastd.

PR: 199733
Submitted-by: hs_fbsd at on-sky.net (no name given)
DeltaFile
+1-1libexec/rc/rc.d/devd
+1-11 files

FreeBSD/src d9beef9sys/dev/mpt mpt.c

mpt: print req->index rather than the pointer itself in mpt.c

Print req->index instead of printing the pointer itself to avoid kernel
pointer leakage.

PR: 238661
Signed-off-by: Fuqian Huang <huangfq.daxian at gmail.com>
Reviewed-by: imp
DeltaFile
+2-2sys/dev/mpt/mpt.c
+2-21 files

FreeBSD/src 1a0cb93sys/kern vfs_subr.c vfs_syscalls.c

unlink, rmdir: call notify_upper from VOP pre method instead of syscall

Suppose that there are two or more nullfs mounts over some fs, and
suppose the we unlink a file on one of the nullfs mount.
This way notify_upper get called from the lower vnode as well, allowing
the other nullfs mounts to note that and drop their caches for the
unlinked vnode.

PR:     254210
Reviewed by:    olce
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D48825
DeltaFile
+2-0sys/kern/vfs_subr.c
+0-2sys/kern/vfs_syscalls.c
+2-22 files

FreeBSD/src f16ca17sbin/ipf/ipnat ipnat.5, sys/netinet/libalias libalias.3

man: Remove references to classful networks

Update wording in manual pages to replace references to classful networks with
CIDR notation.

Approved by:    glebius, dhw
Sponsored by:   Netflix
Differential Revision:  https://reviews.freebsd.org/D48853
DeltaFile
+4-4sys/netinet/libalias/libalias.3
+3-3usr.sbin/ppp/ppp.8
+1-1sbin/ipf/ipnat/ipnat.5
+8-83 files

FreeBSD/src fffedd8sys/net pfvar.h, sys/netpfil/pf pf.c

pf: send ICMP destination unreachable fragmentation needed when appropriate

Just like we do for IPv6, generate an ICMP fragmentation needed packet if we're
going to need fragmenation for IPv4 as well (i.e. DF is set). Do so before full
processing, so we generate it with pre-NAT addreses, just as we do for IPv6.

Sponsored by:   Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D48805
DeltaFile
+48-0tests/sys/netpfil/pf/icmp.py
+26-15sys/netpfil/pf/pf.c
+1-0sys/net/pfvar.h
+75-153 files

FreeBSD/src 1f4c388sys/netinet ip_output.c ip_fastfwd.c

pfil: set PFIL_FWD for IPv4 forwarding

Just like we already do for IPv6 set the PFIL_FWD flag when we're forwarding
IPv4 traffic. This allows firewalls to make more precise decisions.

Reviewed by:    glebius
Sponsored by:   Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D48824
DeltaFile
+7-1sys/netinet/ip_output.c
+1-1sys/netinet/ip_fastfwd.c
+8-22 files

FreeBSD/src b7f2a45share/man/man7 arch.7

arch.7: grammar fixes

The "for hysterical raisons" was a nice one, though.

MFC after:      3 days
DeltaFile
+2-2share/man/man7/arch.7
+2-21 files

FreeBSD/src 46b9160share/man/man7 arch.7

arch.7: Update version reference to 13.0

This document is intended to be a reference for supported FreeBSD
versions, so update text to refer to 13.0 and later.

Sponsored by:   The FreeBSD Foundation
DeltaFile
+2-2share/man/man7/arch.7
+2-21 files

FreeBSD/src 753a4acsys/netlink netlink_generic.c netlink_var.h

netlink: make struct genl_family and genl_group private
DeltaFile
+41-31sys/netlink/netlink_generic.c
+0-15sys/netlink/netlink_var.h
+41-462 files

FreeBSD/src d2e6eb6usr.bin/genl genl.c

genl: fix printing of a command with zero capabilities
DeltaFile
+10-4usr.bin/genl/genl.c
+10-41 files