bhyve: Tidy lobits handling in pci_passthru
- The lobits field in the "physical" BAR settings is never used, so
don't bother setting it.
- Expand the comment explaining why the existing lobits are preserved
(namely, to preserve the prefetch flag on memory BARs).
Reviewed by: bnovkov
Differential Revision: https://reviews.freebsd.org/D58894
bhyve: Refactor initial PCI BAR setup
Fully initialize BARs with an address of 0 in pci_emul_alloc_bar()
instead of deferring some of that initialization to
pci_emul_assign_bar(). Now, the latter is only used to allocate an
initial address range for PCI BARs.
Note that this means that the pci_passthru model now overrides the
initial lobits after they are set removing the need for a workaround
in pci_emul_assign_bar().
Reviewed by: bnovkov
Differential Revision: https://reviews.freebsd.org/D58893
bhyve: Don't set the prefetch flag for large 64-bit memory BARs
The only device model that can create a large 64-bit memory BAR is the
passthru device model, and that device model reuses the lobits of the
existing BAR explicitly.
Fixes: e87a6f3ef284 ("bhyve: use physical lobits for BARs of passthru devices")
bhyve: Return void from pci_emul_alloc_bar
This function never fails.
Reviewed by: bnovkov, chuck, markj
Differential Revision: https://reviews.freebsd.org/D58579
sockstat: provide more BBLog information
When using -b, provide in addition to the BBLog state also the number
of entries stored at the endpoint, the corresponding upper limit and
the next sequence number to be assigned.
Reviewed by: rrs
MFC after: 1 week
MFC to: stable/15
MFC to: stable/14
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D59131
install: Fix two bugs in stdin code
* Fix case where the source is - and the target exists.
* Only call chflags() (to remove flags that might prevent us from
replacing an existing target) in the exists case; otherwise,
to_sb.st_flags is uninitialized.
* Rename the source file in the stdin test case.
* Extend null and stdin test cases to cover the case where the
target already exists.
PR: 297681
MFC after: 1 week
Fixes: d34870708db9 ("install: Allow installing stdin")
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D59144
intelspi: add Nova Lake SPI controller IDs
Add PCI device IDs for Nova Lake-generation LPSS peripheral SPI
controllers.
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D59013
bhyve: fix byte order for manually set NVMe eui64
Manually specified eui64 value gets converted to big endian twice:
first using htobe64() and then using be64enc(). On little-endian hosts
that results in a little-endian value instead of a big-endian.
Fix by removing htobe64() for a user submitted value.
Fixes: 409a80e5a434 ("bhyve: Create EUI64 for NVMe namespaces")
Reviewed by: chuck
Relnotes: yes
Sponsored by: The FreeBSD Foundation
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D59080
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)