ddb(4), crash(8): Make `show all locks' work without LOCKDEBUG.
Any lwp currently waiting for a _contended_ lock will now record a
pointer to that lock in struct lwp::l_ld_wanted, even without
LOCKDEBUG. We can't tell who holds shared locks or spin locks, but we
can at least tell what lock a thread is waiting for when it's spinning
for a spin lock, and generally present the graph of current lock
dependencies reasonably well this way.
PR kern/60030: ddb/crash: show all locks without LOCKDEBUG
kernel: Track what lock each lwp is waiting for without LOCKDEBUG.
This is reasonably cheap -- one extra pointer on the stack, couple
extra stores when _waiting_ (spinning or sleeping) for a _contended_
lock -- and doesn't change the kernel ABI. Will enable us to get
diagnostics from crash dumps when, e.g., there's a softint deadlock
tripping a heartbeat panic.
PR kern/60030: ddb/crash: show all locks without LOCKDEBUG
linux: unbreak arm64 linux_emul_md.c after pkey syscalls
linux_emul.h uses struct image_args without a file-scope forward
declaration. The new arm64 (and i386) stubs include that header
without imgact.h first, which fails the build under -Werror.
Include it the same way linux_pkru.c already does, and declare the
type next to struct image_params so the header is self-contained.
Reported by: tuexen
Fixes: bdb561843e86
MFC after: 1 month
"if PWD references the current directory, then PWD is assumed to be the
name of the current directory" is tautologically confusing.
Just state that for '-L' $PWD is _printed_ (under the right circumstances).
[SandboxVectorizer] Fix out-of-bounds SeedBundle access on cross-bundle erasure
SeedCollection::runOnFunction() indexed a SeedBundle at
Seeds.getFirstUnusedElementIdx() (and, separately, at a hardcoded 0) without
first checking whether the bundle was already fully used.
getFirstUnusedElementIdx() returns Seeds.size() -- one past the end -- once
everything is used, so indexing there reads out of bounds.
This was always a latent bug, but -sbvec-collect-seeds=stores,loads is what
actually exposes it: store and load seeds share one erase-instruction
callback (SeedContainer::erase()), so when vectorizing a store chain erases
a load it packed as an operand, that erase also marks the same load "used"
in its *independent* LoadSeeds bundle. Store seeds are processed first, so
by the time the outer loop reaches that LoadSeeds bundle, it can already be
fully consumed -- or, since cross-bundle erasure can mark any index used
(not just sequentially from the front), have its element 0 specifically
erased while other elements remain live, which broke the hardcoded Seeds[0]
address-space lookup the same way.
[12 lines not shown]
fts: fix trailing-slash regression in fts_read after fts_children
When fts_read() descends into a directory whose children were
already prefetched by fts_children() (as ls -R does), it changed
directory using p->fts_name instead of p->fts_accpath.
With a trailing slash on a relative root path (e.g. 'dir/'),
the bare name was resolved relative to the wrong directory, so
every sibling directory after the first failed with ENOENT and
was reported as FTS_DNR. This manifested as 'ls -lR dir/'
skipping the contents of all but the first subdirectory.
Restore the use of p->fts_accpath, matching the behavior prior
to 4bd01d6ae016.
Add a regression test that reproduces the exact conditions:
fts_children() on each directory, FTS_PHYSICAL without
FTS_NOCHDIR, and a trailing slash on the root path.
[5 lines not shown]
ixgbe: Report the management packet drop counter
The management_pkts_drpd sysctl was wired to MNGPTC, making it an
alias of management_pkts_txd, instead of MNGPDC.
(cherry picked from commit 435cde959c8823ff38c699d1bc8655918fda57dd)
ixgbe: Re-enable the SFP laser during initialization
ixgbe_if_stop() disables the transmit laser on every 82599 SFP fiber
port, but the iflib initialization path did not re-enable it. Re-enable
the laser before deferred SFP module setup so interface
reinitialization cannot leave either single-speed or multispeed optics
dark.
The hardware wrapper is a no-op when laser control is unavailable. The
placement follows Intel ix-3.4.39; this version deliberately applies to
every SFP port affected by the stop path.
(cherry picked from commit 545779a99290b7b7d94dece6c096ce230be91ff9)
ixgbe: Report the management packet drop counter
The management_pkts_drpd sysctl was wired to MNGPTC, making it an
alias of management_pkts_txd, instead of MNGPDC.
(cherry picked from commit 435cde959c8823ff38c699d1bc8655918fda57dd)
ixgbe: Re-enable the SFP laser during initialization
ixgbe_if_stop() disables the transmit laser on every 82599 SFP fiber
port, but the iflib initialization path did not re-enable it. Re-enable
the laser before deferred SFP module setup so interface
reinitialization cannot leave either single-speed or multispeed optics
dark.
The hardware wrapper is a no-op when laser control is unavailable. The
placement follows Intel ix-3.4.39; this version deliberately applies to
every SFP port affected by the stop path.
(cherry picked from commit 545779a99290b7b7d94dece6c096ce230be91ff9)
iflib: Permit SR-IOV configuration on a down interface
Drivers which remap PF queues need a stop/mutate/restart transaction
only when the interface has live queues. Permit their IOV
initialization callback while the interface is administratively down
and leave it down afterward.
This restores the standard boot-time iovctl.conf workflow and
lets other opt-in drivers configure VFs before netif brings the PF up.
(cherry picked from commit 2cf580c694f6f392531a63f01c3fb89c0244f89a)
iflib: Permit SR-IOV configuration on a down interface
Drivers which remap PF queues need a stop/mutate/restart transaction
only when the interface has live queues. Permit their IOV
initialization callback while the interface is administratively down
and leave it down afterward.
This restores the standard boot-time iovctl.conf workflow and
lets other opt-in drivers configure VFs before netif brings the PF up.
(cherry picked from commit 2cf580c694f6f392531a63f01c3fb89c0244f89a)
pci: Permit function-level reset of 82599 VFs
Intel 82599 supports FLR on VFs but reports FLR support only in the PF
Device Capabilities register. The VF register therefore leaves the FLR
Capable bit clear, and pcie_flr() rejects the reset.
Intel documents the zeroed VF PCIe capability structure as erratum 35
in the 82599 Specification Update (B0=Yes; NoFix).
Add a positive FLR quirk for the 82599 VF. Keep the capability check
for every other function, so an unknown nonconforming VF cannot make
pcie_flr() report success when its reset request was ignored.
SR-IOV requires VFs to support FLR, but a clear capability bit cannot
distinguish the 82599's misadvertisement from a VF that fails to
implement it.
(cherry picked from commit ee776a8e291cb73845a8611d3dec5a2a966106b9)
pci: Ignore SR-IOV VFs when tuning MPS
The VF Device Control MPS and MRRS fields are reserved and preserved.
VF transactions use the PF MPS, so a hardwired VF value must not be
used to retune the shared PCIe hierarchy.
Document the previously undocumented tuning knob and clarify why a VF
may continue to display its reserved hardwired value.
This fixes an instant crash/reboot on my Zen3 system with 82599 VFs.
(cherry picked from commit 5aab6164161db397d84e5fff88e1af1a9e405875)
ixv: reconcile VLAN filters through the mailbox
VLAN registration callbacks only update the software shadow, leaving
the PF unaware until a later full initialization. Initialization then
retries each failed request in a tight loop, while skipping replay
entirely when local hardware filtering is disabled.
Send additions and removals as soon as the desired state changes,
independent of the VF local-filter capability. Replay the desired
memberships after reset and retry a bounded batch per timer tick. Stop
after the first failure so a silent PF can consume only one mailbox
timeout per pass, while a responsive PF can drain several requests.
Treat the retry window as a no-progress deadline: advance it when
pending work succeeds so a large backlog can drain, but leave entries
dormant after a sustained failure.
A successful mailbox request wakes a dormant backlog. Dispatch
timer-driven retries only while iflib marks the VF running, so a stale
timer tick cannot restore PF VLAN state after the stop path resets the
[14 lines not shown]
ixgbe: implement VF secondary MAC filters
The PF advertises the legacy SET_MACVLAN mailbox request but always
rejects it. The request installs secondary unicast addresses.
Allocate an owned RAR pool for VF secondary addresses, reserve low
entries for PF filters, and place VF-primary addresses at the top of
the usable RAR range. Reject address collisions and cap each VF at
three secondary filters so one guest cannot exhaust the shared table.
Clear secondary filters on VF or PF reset and on SR-IOV teardown. This
hardware can anti-spoof only the VF primary source address. Reject
secondary filters while MAC anti-spoofing is configured, so installing
them requires an explicit administrative policy choice. Report optional
filter-table allocation failure without disabling SR-IOV.
Adapt the owned-RAR allocation and reset-cleanup model from igb(4) in
a2ed165f0049 to DPDK's ixgbe SET_MACVLAN mailbox semantics.
[3 lines not shown]
ixgbe: enforce VF promiscuity and multicast policy
The allow-promisc IOV property is advertised but ignored, and the PF
rejects the xcast request used by modern VFs. Negotiate mailbox APIs
1.2 and 1.3, implement pool-scoped xcast modes, and require
allow-promisc for requested all-multicast or unicast-promiscuous modes.
The VF mailbox can carry only 30 multicast hashes. When ixv has a
larger list, request the API 1.2 all-multicast xcast mode instead of
extending the legacy SET_MULTICAST message. The PF grants that fallback
only to VFs configured with allow-promisc; otherwise ixv reports that
only the first 30 addresses are active.
Reset xcast state with the VF and have ixv replay the mode implied by
its interface flags after multicast updates.
Follow DPDK's ixgbe API 1.2/1.3 xcast contract, with allow-promisc
policy adapted from igb(4) in a2ed165f0049.
[3 lines not shown]