HardenedBSD/src 9fbd88fshare/man/man4 ulpt.4 uled.4, sys/dev/hwpmc hwpmc_amd.c

Merge remote-tracking branch 'rad/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+41-2sys/dev/hwpmc/hwpmc_amd.c
+35-5usr.sbin/pciconf/pciconf.c
+13-18share/man/man4/umcs.4
+8-14share/man/man4/umct.4
+6-11share/man/man4/ulpt.4
+6-11share/man/man4/uled.4
+109-616 files not shown
+133-6512 files

HardenedBSD/src 040a98fshare/man/man4 ulpt.4 uled.4, sys/dev/hwpmc hwpmc_amd.c

Merge remote-tracking branch 'rad/hardened/current/master' into hardened/current/pledge
DeltaFile
+41-2sys/dev/hwpmc/hwpmc_amd.c
+35-5usr.sbin/pciconf/pciconf.c
+13-18share/man/man4/umcs.4
+8-14share/man/man4/umct.4
+6-11share/man/man4/ulpt.4
+6-11share/man/man4/uled.4
+109-616 files not shown
+133-6512 files

HardenedBSD/src df87c4dshare/man/man4 ulpt.4 uled.4, sys/dev/hwpmc hwpmc_amd.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+41-2sys/dev/hwpmc/hwpmc_amd.c
+35-5usr.sbin/pciconf/pciconf.c
+13-18share/man/man4/umcs.4
+8-14share/man/man4/umct.4
+6-11share/man/man4/ulpt.4
+6-11share/man/man4/uled.4
+109-616 files not shown
+133-6512 files

HardenedBSD/src 8a0cab2sys/dev/hwpmc hwpmc_amd.h hwpmc_amd.c

hwpmc/amd: replace static pmcdesc[] and pc_amdpmcs[] with dynamic allocation

AMD_NPMCS_MAX = 342 (16 core + 6 L3 + 64 DF + 256 UMC). On a Zen 4
EPYC 9654 with 6 core, 6 L3, 16 DF, and 4 UMC counters, only 32
descriptors are needed; the static arrays over-allocate by ~10x.

Replace both amd_pmcdesc[AMD_NPMCS_MAX] and per-CPU pc_amdpmcs[AMD_NPMCS_MAX]
with mallocarray() sized to the actual registered PMC count:
  - amd_pmcdesc: allocated in pmc_amd_initialize()
  - pc_amdpmcs:  allocated per-CPU in amd_pcpu_init(), freed in fini()

Normalize amd_l3_npmcs and amd_df_npmcs against the AMDID2_PTSCEL2I
and AMDID2_PNXC feature bits before computing npmcs_total, so that
allocation, registration, and amd_get_msr() row offsets are all derived
from the same values.  Previously the ternary in npmcs_total excluded
L3/DF from the allocation while the globals retained their defaults,
causing amd_get_msr() to miscompute DF row offsets when L3 is absent.

amd_umc_npmcs comes from CPUID Fn8000_0022h EBX[23:16] (NumUMCCounters)

    [14 lines not shown]
DeltaFile
+41-2sys/dev/hwpmc/hwpmc_amd.c
+2-1sys/dev/hwpmc/hwpmc_amd.h
+43-32 files

HardenedBSD/src c745fccsys/riscv/conf GENERIC

riscv: enable gpiopower driver

It is functional, and there are some RISC-V platforms which can benefit
from it.

Requested by:   Brian Scott <bscott at bunyatech.com.au>
Sponsored by:   The FreeBSD Foundation
DeltaFile
+1-0sys/riscv/conf/GENERIC
+1-01 files

HardenedBSD/src e676978sys/dev/eqos if_eqos.c

eqos: Reduce RX error noisiness

Reduce very common console messages:
        Receive error rdes3=30208000

As observed on the VisionFive v2 hardware after some large transfers.

Differentiate between overflow errors and others. Report the errors when
the length is non-zero (overflow errors).

Also, count errors for netstat purposes.

Reviewed by:    mhorne
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D59479
DeltaFile
+9-1sys/dev/eqos/if_eqos.c
+9-11 files

HardenedBSD/src 9257ae7. MAINTAINERS, .github CODEOWNERS

Add entries for third-party projects I maintain

Add myself formally as the "maintainer" for atf, kyua, and lutok, both
in the GitHub CODEOWNERS and MAINTAINERS files.

This change matches the herald rules I recently setup for these
third-party components.
DeltaFile
+2-0MAINTAINERS
+2-0.github/CODEOWNERS
+4-02 files

HardenedBSD/src b952821share/man/man4 ulpt.4

ulpt.4: Canonicalize SYNOPSIS, tag SPDX

MFC after:      3 days
DeltaFile
+6-11share/man/man4/ulpt.4
+6-111 files

HardenedBSD/src 2784767share/man/man4 umct.4

umct.4: Canonicalize SYNOPSIS, HARDWARE, tag SPDX

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

HardenedBSD/src 6204c60share/man/man4 uled.4

uled.4: Canonicalize SYNOPSIS, tag SPDX

MFC after:      3 days
DeltaFile
+6-11share/man/man4/uled.4
+6-111 files

HardenedBSD/src 71a0ea7share/man/man4 umcs.4

umcs.4: Describe better, canonicalize SYNOPSIS

+ tag SPDX
+ improve apropos and hardware notes context
+ canonicalize SYNOPSIS

MFC after:      3 days
DeltaFile
+13-18share/man/man4/umcs.4
+13-181 files

HardenedBSD/src 19adf5bshare/man/man4 ufshci.4 uhso.4, sys/amd64/amd64 sigtramp.S

Merge remote-tracking branch 'rad/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+94-26sys/arm64/iommu/smmu.c
+86-0tests/sys/netpfil/pf/pfsync.sh
+62-6sys/cddl/dev/dtrace/aarch64/dtrace_asm.S
+33-22share/man/man4/uhso.4
+18-28share/man/man4/ufshci.4
+27-17sys/amd64/amd64/sigtramp.S
+320-9928 files not shown
+552-23534 files

HardenedBSD/src b335505share/man/man4 ufshci.4 uhso.4, sys/amd64/amd64 sigtramp.S

Merge remote-tracking branch 'rad/hardened/current/master' into hardened/current/pledge
DeltaFile
+94-26sys/arm64/iommu/smmu.c
+86-0tests/sys/netpfil/pf/pfsync.sh
+62-6sys/cddl/dev/dtrace/aarch64/dtrace_asm.S
+33-22share/man/man4/uhso.4
+18-28share/man/man4/ufshci.4
+27-17sys/amd64/amd64/sigtramp.S
+320-9928 files not shown
+552-23534 files

HardenedBSD/src 610f4basys/kern vfs_lookup.c, usr.sbin/nfsuserd nfsuserd.c

Merge remote-tracking branch 'rad/hardened/15-stable/main' into hardened/15-stable/pledge
DeltaFile
+8-4sys/kern/vfs_lookup.c
+4-2usr.sbin/nfsuserd/nfsuserd.c
+12-62 files

HardenedBSD/src a17143asys/kern vfs_lookup.c, usr.sbin/nfsuserd nfsuserd.c

Merge remote-tracking branch 'rad/freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+8-4sys/kern/vfs_lookup.c
+4-2usr.sbin/nfsuserd/nfsuserd.c
+12-62 files

HardenedBSD/src 5781f8bshare/man/man4 ufshci.4 uhso.4, sys/amd64/amd64 sigtramp.S

Merge remote-tracking branch 'rad/freebsd/current/main' into hardened/current/master
DeltaFile
+94-26sys/arm64/iommu/smmu.c
+86-0tests/sys/netpfil/pf/pfsync.sh
+62-6sys/cddl/dev/dtrace/aarch64/dtrace_asm.S
+33-22share/man/man4/uhso.4
+18-28share/man/man4/ufshci.4
+27-17sys/amd64/amd64/sigtramp.S
+320-9928 files not shown
+552-23534 files

HardenedBSD/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

HardenedBSD/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

HardenedBSD/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

HardenedBSD/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

HardenedBSD/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

HardenedBSD/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

HardenedBSD/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

HardenedBSD/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

HardenedBSD/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

HardenedBSD/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

HardenedBSD/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

HardenedBSD/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

HardenedBSD/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

HardenedBSD/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