rtwn: allow non-zero interface indexes
The endpoints we want won't always be on interface 0. Instead, allow the
interface index to be specified in driver_info when probing.
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D59107
rtwn: add rtwn_efuse_preread
This would be used to switch to the "WiFi bank" before reading the rom.
The 8723bu will need this, currently a nop on all chips.
Differential Revision: https://reviews.freebsd.org/D59106
amd_iommu: Bound IVHD device-entry parsing
Validate the IVRS table and every subtable length before using either
to form iterator bounds. Reject truncated typed IVHD blocks instead of
passing them to a type-specific callback.
Within each IVHD payload, correct the lower-bound comparison for
extended range entries and validate fixed-size entries, paired range
terminators, the fixed HID body, and the variable HID UID before
dereferencing or advancing. Malformed firmware can no longer drive
either iterator beyond its enclosing object.
Reviewed by: kib
MFC after: 2 weeks
Sponsored by: BBOX.io
Differential Revision: https://reviews.freebsd.org/D58724
bhyvectl: Generalize bhyve IPC code
Move the nvlist-based bhyve IPC code into a separate function.
No functional change intended.
Reviewed by: rew
Differential Revision: https://reviews.freebsd.org/D54652
bhyve: Generalize the IPC thread
Move the code for the snapshotting IPC thread into a separate file
and define macros for adding new IPC commands.
No functional change intended.
Reviewed by: rew
Differential Revision: https://reviews.freebsd.org/D54650
hwpmc: build hwpmc_rapl.c into the i386 module
The module's i386 source list compiles the files that call
pmc_rapl_initialize() and pmc_rapl_finalize() but not the one that defines
them, so the i386 hwpmc.ko has both undefined and cannot be loaded.
Fixes: a99d04f39dab ("hwpmc: add RAPL energy-counter class (AMD + Intel)")
Assisted-by: Claude Code (Opus 5)
hwpmc: do not register RAPL when the unit register reads as zero
An energy status unit of zero means one joule per raw tick, which no part
reports; it is what a hypervisor returns for an MSR it does not implement.
Both energy rows are scaled by that field, so the class would be
registered with counters that read zero forever.
Refuse it, as the class is already refused when no energy MSR responds.
Assisted-by: Claude Code (Opus 5)
hwpmc: probe the RAPL unit MSR instead of faulting on it
The RAPL probe read MSR_RAPL_POWER_UNIT with a bare rdmsr(). RAPL is not
enumerated by CPUID on either vendor and the register is absent on older
Intel and AMD parts and under a hypervisor that does not emulate it, so
the read raises #GP and loading hwpmc panics the machine.
Read it with rdmsr_safe() and return ENXIO when it is not there, as this
function already does for the energy MSRs. Both callers already drop the
class when the probe fails.
Fixes: a99d04f39dab ("hwpmc: add RAPL energy-counter class (AMD + Intel)")
Assisted-by: Claude Code (Opus 5)
route/fib_algo: Free leaked radix_masks in radix_lockless
radix_lockless algorithm creates its own radix tree and
allocates its own radix_masks by directly calling rnh_addaddr().
However, during destruction, it only frees the radix_tree without
freeing its allocated radix_masks.
Fix the leak by calling rn_delete() during radix_destroy().
PR: 297339
Reviewed by: melifaro
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D59112
ixgbe: Probe additional controller variants
The shared base code already selects and configures the 82598 BX,
82599 KR, 82599 SFP Express Module, X552 XFI, X553 QSFP, and X553 N
QSFP device IDs, but the FreeBSD probe table omits them while DPDK lists
them.
MFC after: 2 weeks
Sponsored by: BBOX.io
igb: Report 82580 memory ECC errors
82580 exposes clear-on-read, saturating corrected error counters for
the receive and transmit packet buffers. Its two PCIe command memories
expose RW1C indications for uncorrectable ECC errors.
Sample the packet buffer counters and PCIe indications from the regular
hardware statistics update. Fatal recovery samples the PCIe indications
from the serialized admin path rather than the interrupt filter. Thus,
either the regular statistics pass or recovery reads and clears each
indication, but they cannot both account it. Also preserve indications
observed while initialization is completing.
Expose the exact packet buffer error total and observed PCIe command
memory indications under the memory_errors sysctl node. Multiple PCIe
errors between samples can collapse into one indication per memory.
Validated on an Intel I340-T2 (82580, revision 1). A clean boot and
three down/up cycles left the packet-buffer, PCIe, and region-specific
[10 lines not shown]
e1000: Recover from 82580 memory errors
82580 reports fatal parity and uncorrectable ECC errors through ICR.FER
and its four region PEIND hierarchy. Region specific status registers
identify PCIe, DMA transmit, DMA receive, DMA host, and LAN port
memories that can leave traffic stopped.
Enable the documented DMA, PCIe, packet-buffer, and host-owned LAN
parity and ECC checks only after initializing queue and filter tables.
Leave the flexible filter parity controls under management firmware
ownership. Capture read-clear and RW1C status in the interrupt filter
and keep FER masked until the admin task resolves the event.
Reset for a host-owned region or an unknown FER source. Leave
management-only recovery to firmware. Use CTRL.RST before master
disable because fatal 82580 memory errors can stop PCIe traffic. Do not
use CTRL.DEV_RST: specification update item 9 declares that bit reserved
and says it must always be written as zero. Wait for EEPROM auto read
completion; STATUS bit 21 is reserved on 82580, not PF_RST_DONE.
[21 lines not shown]
ixgbe: Correct the PFVFRSSRK index range comment
PFVFRSSRK contains ten 32-bit RSS key words, numbered 0 through 9.
The previous inclusive range incorrectly ended at 10.
Sponsored by: BBOX.io
(cherry picked from commit f177ff939a91a3d710752438b13aff53d5afc725)
ixv: Reject unsupported E610 Hyper-V VFs
E610 Hyper-V VFs use PCI configuration space communication instead of
the native PF/VF mailbox. The generic E610 match currently attaches
native mailbox operations to those devices, and the imported Hyper-V
subdevice identifier is incorrect.
Correct the subdevice identifier to 0x00ff, as used by DPDK shared
ixgbe code, and reject that subtype until ixv has a complete Hyper-V
operations table.
Sponsored by: BBOX.io
(cherry picked from commit 08c41a679b281505eb7f1fd0cb528f3c1fe87fed)
iflib: Support recoverable initialization failure
The ifdi_init method cannot report an error, so iflib always marks an
interface running and enables its interrupts after the callback returns.
Drivers whose hardware initialization depends on an unavailable peer can
only return early and leave a falsely running interface.
Add iflib_init_failed() so a callback can leave the interface stopped.
Also add a conditional reset request for asynchronous recovery: it is
discarded if the interface is administratively down when the admin task
runs, preventing a queued retry from resurrecting a stopped interface.
Do not restore saved driver flags after an MTU or capability change when
initialization failed. Restoring the pre-init flags would overwrite the
stopped result with stale RUNNING state.
Document that reset requests require the caller to schedule the admin
task, that output remains blocked during recovery, and that iflib rather
than the driver owns the driver flags.
[2 lines not shown]
HBSD: Refer to the right branch in hbsd-update-build(8)
I forgot to switch this over to 15-STABLE as part of the branch
creation.
This is a direct commit to hardened/15-stable/main.
Signed-off-by: Shawn Webb <shawn.webb at hardenedbsd.org>
HBSD: Bump copyright on hbsd-update-build(8)
The last commit to hbsd-update-build was in 2026 to account for the
migration from self-hosted GitLab Enterprise to Radicle.
Signed-off-by: Shawn Webb <shawn.webb at hardenedbsd.org>
MFC-to: 15-STABLE
See-Also: f6cd14174c3289988d2e931862c7861e420e578a
(cherry picked from commit f115cf376fbb7564d27435c9754d773614be2eb6)
Signed-off-by: Shawn Webb <shawn.webb at hardenedbsd.org>
HBSD: Bump copyright on hbsd-update-build(8)
The last commit to hbsd-update-build was in 2026 to account for the
migration from self-hosted GitLab Enterprise to Radicle.
Signed-off-by: Shawn Webb <shawn.webb at hardenedbsd.org>
MFC-to: 15-STABLE
See-Also: f6cd14174c3289988d2e931862c7861e420e578a