FreeBSD/src 46d383ausr.sbin/pciconf pciconf.8 pciconf.c

pciconf: Add -C option to filter by class name

Differential Revision:  https://reviews.freebsd.org/D59602
MFC after:      3 weeks
PR:             289923
Reviewed by:    bnovkov
DeltaFile
+35-5usr.sbin/pciconf/pciconf.c
+8-2usr.sbin/pciconf/pciconf.8
+43-72 files

FreeBSD/src 64a73d1sys/amd64/amd64 sigtramp.S, sys/amd64/ia32 ia32_sigtramp.S

amd64/*sigtramp.S: re-enable some cfi annotations for special registers

Also explicitly specify .cfi_sections to emit the cfi bytecode into the
loadable .eh_frame section.

Reviewed by:    mchoo
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D59838
DeltaFile
+27-17sys/amd64/amd64/sigtramp.S
+13-6sys/amd64/ia32/ia32_sigtramp.S
+40-232 files

FreeBSD/src 1b9aea3usr.bin/gh-bc/tests dc_tests.sh bc_tests.sh

gh-bc/tests: run tests in parallel

Helps to mitigate failures due to timeout in CI on emulated architectures:
https://ci.freebsd.org/job/FreeBSD-main-riscv64-test/16565/testReport/usr.bin.gh-bc/

MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D59547
DeltaFile
+1-1usr.bin/gh-bc/tests/dc_tests.sh
+1-1usr.bin/gh-bc/tests/bc_tests.sh
+2-22 files

FreeBSD/src f1a4ac4share/man/man4 uipaq.4

uipaq.4: Canonicalize SYNOPSIS, tag SPDX

MFC after:      3 days
DeltaFile
+8-13share/man/man4/uipaq.4
+8-131 files

FreeBSD/src f4e7e5eshare/man/man4 ukbd.4

ukbd.4: Canonicalize SYNOPSIS, tag SPDX

Also add a missing Cd tag for consistency.

MFC after:      3 days
DeltaFile
+24-14share/man/man4/ukbd.4
+24-141 files

FreeBSD/src b27a221usr.sbin/bhyve pci_emul.c

bhyve: fix boot device ordering

EDK2's QemuBootOrderLib inspects the bootorder file provided
via fw_cfg and requires it to be NUL-terminated. Otherwise,
it rejects the supplied bootorder and falls back to its
default boot order.

Currently, bhyve registers bootorder with qemu_fwcfg_add_file()
using bootorder_len returned by open_memstream(), which excludes
the trailing NUL byte.

Fix that by passing bootorder_len + 1 to qemu_fwcfg_add_file() so
the fw_cfg payload is properly NUL-terminated.

PR:             279720
Reviewed by:    markj
Found with:     codex (gpt-5.6-sol)
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D59859
DeltaFile
+1-1usr.sbin/bhyve/pci_emul.c
+1-11 files

FreeBSD/src 00d693eshare/man/man4 ufoma.4

ufoma.4: Improve HARDWARE introductory sentence

MFC after:      3 days
DeltaFile
+2-2share/man/man4/ufoma.4
+2-21 files

FreeBSD/src 7d1edc5share/man/man4 uhid.4

uhid.4: Canonicalize SYNOPSIS, tag SPDX

MFC after:      3 days
DeltaFile
+14-13share/man/man4/uhid.4
+14-131 files

FreeBSD/src 2407b84share/man/man4 uhso.4

uhso.4: describe better, SYNOPSIS, HARDWARE, SPDX

+ Update SYNOPSIS to the new standard format
+ Give this a clearer description in apropos
+ Give this a clearer description in hardware note
+ Spinoff SYSCTL VARIABLES from HARDWARE
+ Pet linter for long lines and trailing punctuation
+ Tag SPDX

MFC after:      3 days
DeltaFile
+33-22share/man/man4/uhso.4
+33-221 files

FreeBSD/src 6a07579share/man/man4 ugold.4

ugold.4: Canonicalize SYNOPSIS, HARDWARE, tag SPDX

MFC after:      3 days
DeltaFile
+11-15share/man/man4/ugold.4
+11-151 files

FreeBSD/src fc44154sys/amd64/vmm/io vatpit.c

vmm: Re-arm the PIT callout for square wave mode

The 8254's square wave mode (mode 3) is periodic, with the same
interrupt rate as the rate generator mode (mode 2), but
vatpit_callout_handler() only re-arms the channel 0 callout for
TIMER_RATEGEN.  A guest that programs mode 3 therefore receives a
single IRQ0 and no further timer interrupts.

Re-arm the callout for TIMER_SQWAVE as well, matching illumos
change 13301.

Reviewed by:    markj
Obtained from:  illumos 93d78aba5b32996fc2ae893a6237a0d3972f86b2
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D59816
DeltaFile
+1-1sys/amd64/vmm/io/vatpit.c
+1-11 files

FreeBSD/src ce5b706sys/amd64/vmm vmm_instruction_emul.c

vmm: Fix a page wiring leak in MOVS emulation

When emulating a MOVS from MMIO to guest RAM, the kernel's
vm_copy_setup() wires the destination pages.  If the subsequent
MMIO read fails, emulate_movs() skips vm_copy_teardown(), leaking
the page wire references acquired during setup.

Run vm_copy_teardown() regardless of the MMIO read result, and
only copy the value to guest memory if the read succeeds.
Preserve the existing error return.

This matches illumos change 13309.

Reviewed by:    markj
Obtained from:  illumos 83cd75bb2949d26e6eb38ddefc60fdeed1909643
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D59823
DeltaFile
+9-3sys/amd64/vmm/vmm_instruction_emul.c
+9-31 files

FreeBSD/src d400b1csys/amd64/vmm/intel vmx.c

vmm: Synchronize long-mode state when emulating CR0 writes

vmx_emulate_cr0_access() sets EFER.LMA and the IA-32e guest VM-entry
control when enabling paging with EFER.LME set, but does not clear them
when disabling paging.  This can leave an inconsistent guest state that
fails VM entry.

Update both fields in either direction based on EFER.LME and the CR0
value written to the VMCS.  Use the mask-adjusted CR0 value so the
resulting state remains consistent with the VMX fixed-bit requirements.

Reviewed by:    markj
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D59756
DeltaFile
+15-17sys/amd64/vmm/intel/vmx.c
+15-171 files

FreeBSD/src 3330226sys/amd64/vmm/io vatpit.c

vmm: Normalize a zero PIT count before starting channel 0

pit_timer_start_cntr0() does not schedule a callout when the initial
count is zero.  The counter write handler normalizes a programmed zero
count only after calling it, leaving an initially unarmed channel 0
without a scheduled timer event.

Move the existing normalization before the timer-start call.  Retain the
historical 0xffff representation of a zero count.

Reviewed by:    markj
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D59749
DeltaFile
+2-2sys/amd64/vmm/io/vatpit.c
+2-21 files

FreeBSD/src 5123453usr.sbin/bhyveload bhyveload.c

bhyveload: validate character disk devices

Currently, bhyveload(8) does not validate the supplied disk
image path. For example, it allows passing the /dev/null
device, which later fails in userboot because it does not
support DIOCGSECTORSIZE and DIOCGMEDIASIZE ioctls (see
userdisk_init() in stand/userboot/userboot/userboot_disk.c).

Fix that by checking DIOCGSECTORSIZE and DIOCGMEDIASIZE ioctls early.
A similar check already exists in bhyve(8). While here, make
cb_diskioctl() report the obtained sector size instead of
hard-coding 512.

Reviewed by:    markj
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D59253
DeltaFile
+31-3usr.sbin/bhyveload/bhyveload.c
+31-31 files

FreeBSD/src 8943d47share/man/man4 ugen.4

ugen.4: Canonicalize SYNOPSIS + tag SPDX

MFC after:      3 days
DeltaFile
+11-4share/man/man4/ugen.4
+11-41 files

FreeBSD/src 0a81077share/man/man4 ufshci.4

ufshci.4: Canonicalize SYNOPSIS, LOADER TUNABLES

+ Update SYNOPSIS to the new standard format
+ Rename CONFIGURATION to the usual LOADER TUNABLES
+ Adjust tunable markup for inclusion in the search index
+ Editorial nit: Unwind a parenthetical

MFC after:      3 days
DeltaFile
+18-28share/man/man4/ufshci.4
+18-281 files

FreeBSD/src acaab48share/man/man4 ufoma.4

ufoma: Describe better, short SYNOPSIS, tag SPDX

This driver is for NTT DoCoMo 3G cellular equiment, which afaict all
went offline six months ago. Tidy up the entry until we can remove it.

MFC after:      3 days
DeltaFile
+10-15share/man/man4/ufoma.4
+10-151 files

FreeBSD/src 6a34abbsys/netpfil/pf if_pfsync.c, tests/sys/netpfil/pf pfsync.sh

pfsync: when importing a state clear take the interface name into account

When one pfsync host clears states it informs its peers about this.
While processing such messages, in pfsync_in_clr() we failed to take the
interface name into account.
This meant that if one host cleared states on one interface the peers
would clear all states, not just those on the affected interface.

Actually check for the interface in pfsync_in_clr()

Sponsored by:   Rubicon Communications, LLC ("Netgate")
DeltaFile
+86-0tests/sys/netpfil/pf/pfsync.sh
+10-6sys/netpfil/pf/if_pfsync.c
+96-62 files

FreeBSD/src e20ed58sys/kern kern_lockf.c

lockf: Truncate the active lock list earlier in lf_purgelocks()

Otherwise vfs_report_lockf() can race with lf_purgelocks() while the
latter is freeing active lock entries without any locks held.

Reviewed by:    kib
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D59768
DeltaFile
+8-7sys/kern/kern_lockf.c
+8-71 files

FreeBSD/src fecb953sys/netinet6 udp6_usrreq.c

udp: Let jail policy rewrite the dstaddr for v6 sendto()s

When performing an unconnected sendto() on a v6 UDP socket in a classic
jail, we were not applying the usual policy of replacing the loopback
addr with the jail's primary IP.  Compare with, e.g., udp6_connect() or
the IPv4 udp_send().  Fix that.

Reported by:    Yuxiang Yang, Yizhou Zhao, Ao Wang, Xuewei Feng, Qi Li,
                and Ke Xu from Tsinghua University using GLM-5.1 from Z.ai
Reviewed by:    bz, glebius
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D59772
DeltaFile
+4-0sys/netinet6/udp6_usrreq.c
+4-01 files

FreeBSD/src fa4f76estand/common gfx_fb.c, stand/efi/loader copy.c bootinfo.c

stand: remove unused variables

(cherry picked from commit 7d48a56205224cfa969c32b47496dc8ac6a6a637)
DeltaFile
+1-3stand/efi/loader/main.c
+1-2stand/efi/loader/bootinfo.c
+0-2stand/efi/loader/arch/amd64/multiboot2.c
+1-1stand/efi/loader/copy.c
+0-1stand/efi/loader/arch/amd64/trap.c
+0-1stand/common/gfx_fb.c
+3-106 files

FreeBSD/src a43fff2stand/common gfx_fb.c, stand/efi/loader copy.c bootinfo.c

stand: remove unused variables

(cherry picked from commit 7d48a56205224cfa969c32b47496dc8ac6a6a637)
DeltaFile
+2-5stand/efi/loader/main.c
+1-2stand/efi/loader/bootinfo.c
+0-2stand/efi/loader/arch/amd64/multiboot2.c
+1-1stand/efi/loader/copy.c
+0-1stand/efi/loader/arch/amd64/trap.c
+0-1stand/common/gfx_fb.c
+4-126 files

FreeBSD/src a4ea046sys/dev/sound/pci hdspe-pcm.c hdsp-pcm.c

snd_hdsp*: malloc(9) with M_WAITOK

Perform the allocations outside the lock section so that we can use
M_WAITOK. Holding the lock here is actually not really necessary and we
could just as well remove it, but keep it for consistency.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 month
Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D59079

(cherry picked from commit b5c1ab6c8f2811278b801084713a6618f3b783d3)
DeltaFile
+15-2sys/dev/sound/pci/hdspe-pcm.c
+15-2sys/dev/sound/pci/hdsp-pcm.c
+30-42 files

FreeBSD/src 1490193sys/dev/sound dummy.c

snd_dummy: Bump primary channel count

Makes it easier to test scenarios involving more than 1 primary channels
per direction.

Sponsored by:   The FreeBSD Foundation
MFC after:      2 weeks
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D59085

(cherry picked from commit 358fe149f591028945a8e5a51dff9121a2358c85)
DeltaFile
+2-2sys/dev/sound/dummy.c
+2-21 files

FreeBSD/src eefd556sys/dev/sound/pcm dsp.c

sound: Prefer idle primary channels when allocating

dsp_chn_alloc() stopped at the first primary channel that was either
idle or already had vchans. Since the list is walked in order, the first
channel matched both conditions once it had been used, so every client
after the first was stacked onto it as a vchan and the remaining primary
channels were never allocated at all.

This is invisible on devices with a single primary channel, but not on
those which provide several. snd_emu10kx(4), for instance, registers
four primary channels for its front device, each able to run with its
own rate.

Look for an idle primary channel first, and only fall back to sharing
one that already has vchans when there is none left.

Sponsored by:   The FreeBSD Foundation
MFC after:      2 weeks
Reviewed by:    markj

    [3 lines not shown]
DeltaFile
+17-7sys/dev/sound/pcm/dsp.c
+17-71 files

FreeBSD/src e376d28sys/conf NOTES

LINT: enable KLD_DEBUG

Without this, no kernel config contained this option so it was easy to
break.

Sponsored by:   Innovate UK
DeltaFile
+5-0sys/conf/NOTES
+5-01 files

FreeBSD/src 0a3d54asys/kern kern_linker.c

kern_linker: use __func__ correctly in diagnostics

__func__ is a variable not a string literal so pass it to printf.  This
only manifest when KLD_DEBUG was defined so wasn't tested by an kernel
including LINT.

Reported by:    Mark Millard <marklmi at yahoo.com>
Sponsored by:   Innovate UK
DeltaFile
+3-3sys/kern/kern_linker.c
+3-31 files

FreeBSD/src 2cfb88elibexec/rtld-elf rtld.c

rtld: more caution when parsing in digest_notes()

(cherry picked from commit fa848d4d0c0371cdbf39265b6528f4c61bc02c7d)
DeltaFile
+10-5libexec/rtld-elf/rtld.c
+10-51 files

FreeBSD/src deb4c73sys/powerpc/aim mmu_radix.c

powerpc/radix: acquire the pmap lock in mmu_radix_extract()

mmu_radix_extract() walks the page tables without holding the pmap lock,
unlike its hash MMU counterpart moea64_extract(). A concurrent unmap can
free and recycle the page table page being walked, so the read returns
whatever now occupies that memory and the caller gets a physical address
that never existed.

That is how mmu_radix_sync_icache() came to hand a bogus address to
__syncicache() and panic the machine. Commit 1574ca1955f5 worked around
it by taking the pmap lock in mmu_radix_sync_icache(), but the machine
independent callers of pmap_extract() - vm_sync_icache(), proc_rwmem()
and the vslock() paths - remain exposed to the same failure.

Rename the existing body to mmu_radix_extract_locked(), which asserts the
lock, and make mmu_radix_extract() a thin wrapper that acquires it.
mmu_radix_sync_icache() already holds the pmap lock, so it calls the
locked variant directly and neither recurses nor reacquires the lock once
per page.

    [7 lines not shown]
DeltaFile
+15-5sys/powerpc/aim/mmu_radix.c
+15-51 files