snd_uaudio: recognize hardware sidetone as a monitor
The Logitech H390, for instance, has the following interface layout:
~~
7 INPUT 34 INPUT 10 INPUT
Mic (0x201) Mic (0x201) USB Stream (0x101)
| | |
v v |
19 FEATURE 35 FEATURE |
| | |
v v |
25 EXTENSION +------> 36 MIXER <---+
| |
v v
13 OUTPUT 22 FEATURE
USB Stream (0x101) |
v
16 OUTPUT
[29 lines not shown]
routing: Use fib-aware ifa lookup in ifa_ifwithroute()
Use ifa_ifwithaddr_fib() to fix fib-specific ifa lookups with route.
Differential Revision: https://reviews.freebsd.org/D59128
arm64/smmu: Fix undefined behaviour in Q_OVF
"1 << 31" is a signed int left shift 31 which is undefined as the shift
is too large. Use an unsigned int to make the value defined.
Sponsored by: Arm Ltd
arm64: vmm: Move vgic_v3 structures to header file
Move vgic_v3 structures in preparation for vgic interface rework for GICv5
support.
Reviewed by: Sarah Walker <sarah.walker2 at arm.com>
Sponsored by: Arm Ltd
vmm: Emulate CPUID leaf 1Fh for guests
On an Intel N150 host a guest started with sockets=1, cores=4,
threads=1 reports "1 package(s) x 2 core(s) x 2 hardware threads"
instead of four cores with one thread each, while the host itself
detects its topology correctly.
A FreeBSD guest picks the topology leaf in topo_probe_intel_0xb(),
sys/x86/x86/mp_x86.c, and since 6badb512a94d it prefers leaf 1Fh over
leaf 0Bh whenever cpu_high is 1Fh or higher. bhyve passes leaf 0
through unmodified, so the guest sees the maximum basic leaf of the
host, which is 1Fh or above on Alder Lake and newer, and takes that
path. x86_emulate_cpuid(), sys/amd64/vmm/x86.c, derives the topology
from vm_get_topology() for leaves 1, 4 and 0Bh, but has no case for
1Fh, so the request ends up in default_leaf and the host values are
returned verbatim. The guest therefore enumerates the topology of the
host: with an SMT shift of 1 in the host's leaf 1Fh and four vCPUs this
gives core_id_shift = 1 and pkg_id_shift = 2, which is exactly the
reported 2 cores x 2 threads. Hosts whose maximum basic leaf is below
[15 lines not shown]
mkimg: Const correctness for C23
On some platforms, e.g. Linux Clang 22.1.8 / glibc 2.43, strchr()
now implements the C23 behaviour where passing a const pointer to
strchr() also returns a const pointer. This breaks mkimg during
the bootstrap build, since it assumes the return value is always
a mutable pointer.
Make the existing 'sep' pointer const to fix the first case, and
for the second, introduce a new non-const pointer for strchr,
since we do modify the result in that case.
MFC after: 1 week
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58493
(cherry picked from commit 9fd8f5e761ba663c8e99eeff64c5a7fd7bcf1e05)
rpcgen: Const correctness for C23
On some platforms, e.g. Linux Clang 22.1.8 / glibc 2.43, strchr()
now implements the C23 behaviour where passing a const pointer to
strchr() also returns a const pointer. This breaks rpcgen during
the bootstrap build, since it assumes the return value is always
a mutable pointer.
For mkfile_output(), the pointed-to value is never modified, so
fix this by making the pointer const as well.
For open_log_file(), the current code modifies the supposedly const
value in-place to remove the filename suffix, which happens to work
but is wrong even in older versions of C. Change the code to use a
printf "%.*s" format specifier to strip the suffix instead.
MFC after: 1 week
Reviewed by: brooks
Sponsored by: The FreeBSD Foundation
[3 lines not shown]
xinstall: Const correctness for C23
On some platforms, e.g. Linux Clang 22.1.8 / glibc 2.43, strchr()
now implements the C23 behaviour where passing a const pointer to
strchr() also returns a const pointer. This breaks xinstall during
the bootstrap build, since it assumes the return value is always
a mutable pointer.
As the returned pointer is never used to modify the value, fix this
by making the temporary variable const.
MFC after: 1 week
Reviewed by: ray, markj, emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58492
(cherry picked from commit 2296c39a9ebc4f081d90b6554d8839e8cde8490a)
m4: Const correctness for C23
On some platforms, e.g. Linux Clang 22.1.8 / glibc 2.43, strchr()
now implements the C23 behaviour where passing a const pointer to
strchr() also returns a const pointer. This breaks m4 during the
bootstrap build, since it assumes the return value is always a
mutable pointer.
Since the returned value is never modified, simply make the
temporary const.
MFC after: 1 week
Reviewed by: bapt, dim
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58494
(cherry picked from commit 1d94e2e0f2ee21d5a4596efc0570d06e3dea0a6e)
libelftc: Const correctness for C23
On some platforms, e.g. Linux Clang 22.1.8 / glibc 2.43, strchr()
now implements the C23 behaviour where passing a const pointer to
strchr() also returns a const pointer. This breaks libelftc during
the bootstrap build, since it assumes the return value is always
a mutable pointer.
Since the returned pointer is never modified in either case, make
it const.
MFC after: 1 week
Reviewed by: jkoshy, markj, dim, emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58497
(cherry picked from commit 85b07e977b04fceec84783facdb308492f17b155)
libc: getopt{,_long}: Const correctness for C23
On some platforms, e.g. Linux Clang 22.1.8 / glibc 2.43, strchr()
now implements the C23 behaviour where passing a const pointer to
strchr() also returns a const pointer. This breaks getopt during
the bootstrap build, since it assumes the return value is always
a mutable pointer.
Since the pointed-to value is never modified, fix this by making
the pointer const.
MFC after: 1 week
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58488
(cherry picked from commit f1d98862044f7748c6f930e9d4339abc166a5b16)
libucl: Const correctness for C23
On some platforms, e.g. Linux Clang 22.1.8 / glibc 2.43, strchr()
now implements the C23 behaviour where passing a const pointer to
strchr() also returns a const pointer. This breaks libucl during
the bootstrap build, since it assumes the return value is always
a mutable pointer.
Instead of assigning directly to params->prefix (which is const),
use a non-const temporary variable and assign the result after
we've done the modification.
MFC after: 1 week
Reviewed by: bofh, bapt
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58490
(cherry picked from commit bcee560d390eb8aa8fd0f08a7a0bffb6e77fffc6)
mandoc: Const correctness for C23
On some platforms, e.g. Linux Clang 22.1.8 / glibc 2.43, strchr()
now implements the C23 behaviour where passing a const pointer to
strchr() also returns a const pointer. This breaks mandoc during
the bootstrap build, since it assumes the return value is always
a mutable pointer.
In read.c, make the existing temporary pointer const, and for the
mandoc_asprintf() call, add a new mutable local.
In mdoc.c and out.c, since the data is mutable and is mutated here,
remove const from the temporary pointers.
MFC after: 1 week
Reviewed by: fuz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58495
(cherry picked from commit 9f18614d5353ce513511ccbf59d09e76c93f7bc9)
sort: Const correctness for C23
On some platforms, e.g. Linux Clang 22.1.8 / glibc 2.43, strchr()
now implements the C23 behaviour where passing a const pointer to
strchr() also returns a const pointer. This breaks sort during
the bootstrap build, since it assumes the return value is always
a mutable pointer.
As the returned pointer is never used to modify the value, fix this
by making the temporary variable const.
MFC after: 1 week
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58491
(cherry picked from commit 78f842dda35b7280e8682f90506ff05b591c6b3a)
igc: Restore the watchdog event counter
The MFC of the fatal memory-error recovery dropped watchdog_events from
the softc. The driver still increments it, includes it in
IFCOUNTER_OERRORS, and exports it as the watchdog_timeouts sysctl.
Fixes: ee9bbfca423f ("igc: Recover from fatal internal memory errors")
iflib: Allow conditional LED device support
A driver class may implement LED control even though the capability is
not available on every device or firmware version it supports. Add an
optional capability method and consult it before creating the led(4)
device. Default to supported so existing providers are unchanged.
This will be used by bnxt which blends PF and VF in the same driver.
(cherry picked from commit 2519e19f05e0c3e5925bf81b729b4c28f2ad1af6)
igc: Report corrected internal ECC errors
I225 and I226 do not interrupt for corrected internal ECC errors.
Instead, the DMA packet buffer and PCIe memories expose sticky status
bits in PBECCSTS and PCIEECCSTS.
Sample these bits with the regular hardware statistics update, preserve
the PBECCSTS ECC enable state while clearing its RW1C indication, and
expose separate counters for the DMA packet buffer, PCIe transmit-data
memory, and PCIe retry buffer.
These counters represent observed indications rather than an exact error
count because multiple corrections between samples collapse into one
sticky status bit.
Hardware validation used an I225-IT (rev 3) and a debug kernel that
wrote only the documented self-clearing injection bits. Each test
armed the injector, exercised the owning RAM with traffic, and compared
the corresponding counter before and after.
[15 lines not shown]
igc: Recover from fatal internal memory errors
I225 and I226 report uncorrectable internal memory errors through
ICR.FER and identify the affected region in PEIND. Depending on the
region, hardware stops transmit or all PCIe and DMA traffic until the
port is reset and reinitialized.
Enable the fatal error interrupt and capture its read clear status in
the interrupt filter. Mask the cause while an iflib reset is pending,
report the affected memory regions, and expose per region indication
counters.
PCIe region parity failures require a different recovery order from a
normal reset: assert DEV_RST, wait at least 3 ms, disable PCIe master
requests, clear PCIEERRSTS, and then reinitialize the port. Follow that
sequence before entering the normal reset path and clear the remaining
LAN status afterward.
The I225/I226 PBECCSTS layout is unrelated to the PCH layout previously
[21 lines not shown]
ixgbe: Defer E610 thermal shutdown to iflib
The E610 firmware event handler invoked ixgbe_if_stop() directly from
IFDI_UPDATE_ADMIN_STATUS(). This reset the device without the iflib
queue lifecycle and left the interface marked running after its hardware
was stopped.
Request an iflib reset instead. Fail the automatic initialization once
so the reset transaction stops the interface and publishes that state.
A later operator-requested initialization remains possible, matching the
previous recovery policy without bypassing iflib.
(cherry picked from commit 3aac283613bd3fd0228a06d6c854ca0bf190ecfb)
ixgbe: Defer firmware recovery transitions to iflib
The firmware-mode callout invoked ixgbe_if_stop() directly. This
performed a full device reset without the iflib context lock or the
iflib queue lifecycle. It could also poll the E610 firmware command
interface from callout context while identification was active.
Request an iflib reset from the callout instead. Reject initialization
while firmware recovery remains active. This leaves the interface
stopped and lets iflib publish that state. Request initialization when
firmware exits recovery so an administratively-up interface can recover
without operator intervention.
(cherry picked from commit 43aa553ef45a4345bdfabadae40d811730151144)
ixgbe: Defer ECC recovery to iflib
The link interrupt filter performed a full hardware reset in interrupt
context. This bypassed iflib stop and initialization, including queue
quiescence and restoration of temporary LED state.
Record the ECC event in the administrative request mask and ask iflib
to perform the reset from its taskqueue. Keep the ECC cause masked
until reset so the intermediate admin pass cannot re-enable a sticky
condition. Handle ECC independently of Flow Director and in legacy
interrupt mode.
Remove the redundant EICR write; the filter has already cleared the
reported causes. Also remove the accompanying complement-mask update
of mac.flags. It set every flag except DOUBLE_RESET_REQUIRED and had
no place in ECC recovery.
(cherry picked from commit c28f2c551daf07345ac78b74459efe1014c49464)
ixl: Add led(4) identification support
Expose each physical port identification LED through /dev/led/ixl*.
Use the existing GPIO LED helpers for most devices and the PHY
provisioning interface for X710 10GBASE-T adapters.
Preserve and restore the original GPIO or PHY indication mode,
including before the interface is stopped.
(cherry picked from commit 8b2e75970c0328e7397290417cc06e9d9c763d2a)
ixgbe: Add led(4) identification support
Expose the physical port identification LED through /dev/led/ix*.
Save and restore the NVM-selected LEDCTL value around each request.
The X550 operations also clear their PHY manual override before the
register is restored.
Use the dedicated firmware port-identification command on E610. Its
interface selects between firmware blinking and the original mode
rather than directly controlling LEDCTL.
Restore the normal indication before a device stop or reset.
(cherry picked from commit fb7e249ce4fd03fe53e4407efe661f9e94852bb6)
igc: Remove invalid debug ring pointer iteration
The debug routine reads queue registers by queue index. It also
advanced unused pointers to rings embedded in queue structures. Those
pointers had the wrong stride and could proceed beyond the ring object.
Remove the unused pointer arithmetic.
(cherry picked from commit 423927d6c3dc87628fc2a19f25b5b5c07b3b73e2)
e1000: Fix the multiqueue debug register dump
The debug routine advanced ring pointers as if rings were contiguous.
They are embedded in queue structures, so rings beyond queue zero had
the wrong stride. The bogus queue index could cause an invalid MMIO
read and panic the machine.
Index the queue arrays first and then select the embedded ring.
(cherry picked from commit 7dd826171b69a01c234ba6e9117917398ba2705e)
e1000: Identify SerDes adapters with LED blink
The generic LED on and off operations do not handle internal SerDes
media, leaving the led(4) device ineffective on my I210 fiber port.
Use the hardware blink operation for the on phase on internal SerDes.
The off phase restores the saved OEM LED configuration as before.
(cherry picked from commit 28f96cc3748fc46408cc6ab6172f09bc2182cad7)
igc: Add led(4) identification support
I225 and I226 expose three programmable LED outputs. Use LED1 for
adapter identification, following the convention in DPDK. Preserve the
OEM configuration across identification requests.
Restore the OEM configuration before a device reset so an active led(4)
pattern cannot leave the output overridden across stop or detach.
The LED mode values follow the Intel I225 Software User Manual.
(cherry picked from commit 19f75b38199b9d30e85fab83e61ff36b0b9ed015)