FreeBSD/src 03ca8ea — sys/amd64/amd64 pmap.c, sys/arm64/arm64 pmap.c

amd64/arm64 pmap: Mark pmap_enter()'s large page case unlikely

PMAP_ENTER_LARGEPAGE is only used to map non-transparent large page
shared memory objects.  Tell the compiler that this case is unlikely.

This hint stops pmap_enter_largepage() from being inlined into
pmap_enter(), which shortens pmap_enter()'s more common execution path
on both amd64 and arm64.

MFC after:      1 week
DeltaFile
+1-1sys/arm64/arm64/pmap.c
+1-1sys/amd64/amd64/pmap.c
+2-22 files

FreeBSD/src e5477ac — tests/sys/fs/cd9660 cd9660_test.sh

cd9660 tests: Require the cd9660 kernel module

When cd9660(4) is not loaded and cannot be loaded, mount(8) fails
with ENODEV instead of the expected EINVAL, and cd9660_rrip_pr296853
fails rather than skips.

Reviewed by:    jfree
Approved by:    jfree
Fixes:          1a4c2eedad5b ("cd9660: Fix dereferencing invalid RR outlen ptr")
Sponsored by:   Netflix
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/132
DeltaFile
+1-0tests/sys/fs/cd9660/cd9660_test.sh
+1-01 files

FreeBSD/src 5ec1d41 — usr.sbin/bhyve pci_nvme.c config_schema.h, usr.sbin/bhyve/aarch64 bhyverun_machdep.c

bhyve: add command to list config options

For a software built on top of bhyve(8) and/or managing bhyve(8),
it is very convenient to know what specific features the given binary supports.
Currently, bhyve(8) provides some of this information, and it could be
retrieved by parsing `bhyve -h`, `bhyve -s help`, `bhyve -l help`.

Sometimes it is not enough, for example, the recently added
"oemstrings" feature cannot be fully probed using these commands.
Over time, some workarounds were suggested. Specifically:

 - Mapping features to __FreeBSD_version. I see at least two issues with
   that:

     * __FreeBSD_version does not directly map to bhyve(8) features,
       so this is simply not accurate.
     * bhyve(8) might be updated separately from the system, which
       is not so uncommon, especially for development purposes.
       Then such a probing will be inaccurate.

    [34 lines not shown]
DeltaFile
+193-0usr.sbin/bhyve/config_schema.c
+94-0usr.sbin/bhyve/amd64/bhyverun_machdep.c
+40-0usr.sbin/bhyve/config_schema.h
+22-0usr.sbin/bhyve/aarch64/bhyverun_machdep.c
+20-0usr.sbin/bhyve/pci_nvme.c
+18-0usr.sbin/bhyve/riscv/bhyverun_machdep.c
+387-04 files not shown
+412-010 files

FreeBSD/src b65eaa6 — sys/amd64/linux linux_ioctl.h, sys/arm64/linux linux_ioctl.h

linux: Move the machine-dependent ioctl bits into per-arch headers

Move both out of <compat/linux/linux_ioctl.h> and into
<machine/../linux/linux_ioctl.h> and <machine/../linux/linux_termbits.h>,
following the lead of linux_emul_md.h.  Every architecture linuxulator
currently supports uses the asm-generic values, so the new per-arch
headers either spell out the generic encoding or just include the common
termbits set, and nothing changes for them.  This is all in preparation
for powerpc64 linuxulator.

While here, move the termio structures from linux_ioctl.c up to
linux_ioctl.h, next to the constants that size them.

No functional change intended.

Differential Revision:  https://reviews.freebsd.org/D61330
DeltaFile
+38-151sys/compat/linux/linux_ioctl.h
+152-0sys/compat/linux/linux_termbits.h
+0-34sys/compat/linux/linux_ioctl.c
+15-0sys/amd64/linux/linux_ioctl.h
+15-0sys/i386/linux/linux_ioctl.h
+15-0sys/arm64/linux/linux_ioctl.h
+235-1853 files not shown
+256-1859 files

FreeBSD/src 0a005bc — sys/compat/linux linux_util.h

linux: Add a LINUX_TODO() macro

Unimplemented corners of the Linuxulator are easier to find when they
announce themselves instead of silently returning.  LINUX_TODO() prints
a rate-limited message naming the function and what the stub is still
missing, built on the existing LINUX_RATELIMIT_MSG_OPT1().

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D61329
DeltaFile
+7-0sys/compat/linux/linux_util.h
+7-01 files

FreeBSD/src 12751d7 — sys/compat/lindebugfs lindebugfs.c

lindebugfs: Remove unneeded header

linux_ioctl.h is not needed in order to build, so remove it.  A future
change will split linux_ioctl.h into arch-specific headers, and 32-bit
arm does not have a compat linux so would fail the build, and adding a
header just to appease lindebugfs would be superfluous, given that it's
not needed.
DeltaFile
+0-1sys/compat/lindebugfs/lindebugfs.c
+0-11 files

FreeBSD/src 3c52edc — sys/arm64/arm64 pmap.c

sys/arm64: Add ttl parameter to pmap_invalidate_range()

Reviewed by:    alc, andrew
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D61391
DeltaFile
+30-21sys/arm64/arm64/pmap.c
+30-211 files

FreeBSD/src 41d1dd6 — sys/arm64/arm64 pmap.c

sys/arm64: TTL fixes

Set TTL bits in TLBI_RANGE_FIELDS() regardless of FEAT_TTL; these bits are
defined by FEAT_TLBIRANGE.
Set TTL in per-page invalidate path (pmap_s1_invalidate_loop()).

Reported by:    alc
Reviewed by:    alc
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D61390
DeltaFile
+7-7sys/arm64/arm64/pmap.c
+7-71 files

FreeBSD/src d389908 — contrib/llvm-project/clang/lib/Basic/Targets PPC.h, contrib/llvm-project/llvm/lib/Target/PowerPC PPCTargetMachine.cpp

Merge commit 5472aa0c1321 from llvm git (by Piotr Kubaj):

  [PowerPC] Use the 16-byte stack and vector alignment on FreeBSD (#232336)

  FreeBSD uses the ELFv2 ABI on both byte orders, so it has the same
  16-byte stack alignment as Linux. The explicit vector alignment is a
  backend workaround that does not depend on the OS. There is no
  reason for the layouts to differ.

llvm 21 still keeps the data layout in two places, so the check is
changed in both the PowerPC backend and clang. They have to match, or
clang errors out with a data layout mismatch.

Reviewed by:    dim
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D61678

(cherry picked from commit d1470ac7f365a1846b8cc565b76592c7a79a22e3)
DeltaFile
+3-1contrib/llvm-project/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+1-1contrib/llvm-project/clang/lib/Basic/Targets/PPC.h
+4-22 files

FreeBSD/src 496ed83 — sys/powerpc/include cpufunc.h pcpu.h

powerpc: move get_pcpu() to machine/pcpu.h

Every other arch defines get_pcpu() in machine/pcpu.h, powerpc has it in
machine/cpufunc.h, which is entirely under _KERNEL. lsof includes
sys/systm.h without _KERNEL first on purpose, so on powerpc cpufunc.h
turns into an empty header and pcpup later expands to a call of an
undeclared get_pcpu(). Since sys/mount.h started pulling in sys/proc.h
this breaks the lsof build on powerpc64 and powerpc64le.

Reviewed by:    jhibbits
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D61305

(cherry picked from commit 4b3364a4bceb61c5870f50b75bf56272ca850944)
DeltaFile
+0-10sys/powerpc/include/cpufunc.h
+10-0sys/powerpc/include/pcpu.h
+10-102 files

FreeBSD/src aa462d8 — sys/powerpc/powerpc altivec.c

powerpc: save and restore VRSAVE with the vector state

VRSAVE was never saved or restored, although user code can write it
and the mcontext carries it, so every process saw the value the
previous process on that CPU had left there.

Two processes pinned to the same CPU and writing different values to
VRSAVE each read back the other's; each reads back its own now.

Reviewed by:    jhibbits
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D61544

(cherry picked from commit 26b47fd4b63c4e67a952f9a4f0ceb89bcb6a24ac)
DeltaFile
+5-0sys/powerpc/powerpc/altivec.c
+5-01 files

FreeBSD/src 4d0163d — contrib/llvm-project/clang/lib/Basic/Targets PPC.h, contrib/llvm-project/llvm/lib/Target/PowerPC PPCTargetMachine.cpp

Merge commit 5472aa0c1321 from llvm git (by Piotr Kubaj):

  [PowerPC] Use the 16-byte stack and vector alignment on FreeBSD (#232336)

  FreeBSD uses the ELFv2 ABI on both byte orders, so it has the same
  16-byte stack alignment as Linux. The explicit vector alignment is a
  backend workaround that does not depend on the OS. There is no
  reason for the layouts to differ.

llvm 21 still keeps the data layout in two places, so the check is
changed in both the PowerPC backend and clang. They have to match, or
clang errors out with a data layout mismatch.

Reviewed by:    dim
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D61678

(cherry picked from commit d1470ac7f365a1846b8cc565b76592c7a79a22e3)
DeltaFile
+3-1contrib/llvm-project/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+1-1contrib/llvm-project/clang/lib/Basic/Targets/PPC.h
+4-22 files

FreeBSD/src 9745bab — sys/powerpc/powerpc altivec.c

powerpc: save and restore VRSAVE with the vector state

VRSAVE was never saved or restored, although user code can write it
and the mcontext carries it, so every process saw the value the
previous process on that CPU had left there.

Two processes pinned to the same CPU and writing different values to
VRSAVE each read back the other's; each reads back its own now.

Reviewed by:    jhibbits
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D61544

(cherry picked from commit 26b47fd4b63c4e67a952f9a4f0ceb89bcb6a24ac)
DeltaFile
+5-0sys/powerpc/powerpc/altivec.c
+5-01 files

FreeBSD/src c411e13 — sys/powerpc/include cpufunc.h pcpu.h

powerpc: move get_pcpu() to machine/pcpu.h

Every other arch defines get_pcpu() in machine/pcpu.h, powerpc has it in
machine/cpufunc.h, which is entirely under _KERNEL. lsof includes
sys/systm.h without _KERNEL first on purpose, so on powerpc cpufunc.h
turns into an empty header and pcpup later expands to a call of an
undeclared get_pcpu(). Since sys/mount.h started pulling in sys/proc.h
this breaks the lsof build on powerpc64 and powerpc64le.

Reviewed by:    jhibbits
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D61305

(cherry picked from commit 4b3364a4bceb61c5870f50b75bf56272ca850944)
DeltaFile
+0-10sys/powerpc/include/cpufunc.h
+10-0sys/powerpc/include/pcpu.h
+10-102 files

FreeBSD/src 70133cd — sys/net iflib.c

iflib: return one vector when falling back to a legacy interrupt

iflib_msix_init() is documented to "return us the number of supported
vectors (will be 1 for a legacy interrupt and MSI)", and
iflib_device_register() relies on that: it treats a return greater than
one as "MSI-X was set up" and calls IFDI_MSIX_INTR_ASSIGN().

On the legacy fallback the function sets scctx->isc_vectors to 1 but
returns the raw pci_msi_count() it fetched at the msi: label.

Set vectors to 1 alongside isc_vectors so the return value matches both
the documented contract and the interrupt mode that was chosen.

Reported by: llm-postcr
Signed-off-by: Nick Price <nprice at FreeBSD.org>
Reviewed by:    gallatin
Differential Revision:  https://reviews.freebsd.org/D61974
DeltaFile
+2-1sys/net/iflib.c
+2-11 files

FreeBSD/src f19206c — sys/dev/acpica acpi_spmc.c

acpi_spmc: Make Intel device-specific state optional

The Intel Low Power S0 Idle _DSM specification marks the minimum
device-specific state of a constraint package as optional, and its own
example returns {0xFF, 0}.  Requiring three elements rejected such
constraints, with one boot message each.

Reviewed by:    olce
Approved by:    olce
Fixes:          508efe35e577 ("acpi_spmc: Check Intel constraint packages")
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/134
DeltaFile
+4-2sys/dev/acpica/acpi_spmc.c
+4-21 files

FreeBSD/src 3fe8d76 — sys/geom geom_ctl.c

geom: Restore group operator

Traditionally, in BSD, the operator group has been intended for backup
operators and has been granted read-only access to disks and related
devices.  This includes geom.ctl, because backup operators need to be
able to dump partition tables.

Unfortunately, the geom.ctl device previously lacked proper access
control, and anyone with read access to it was able to modify GEOM
configuration, including modifying or destroying partitions, RAID
volumes, etc.  As a workaround, the ownership of geom.ctl was changed to
root:wheel so that only users who presumably already have root
privileges were able to access it.

Now that access control has been implemented, we can restore the
original ownership so backup operators can once more dump partition
tables.

This reverts commit 7d576f1d657fc21f97cedc28cc971621ee2490a7.
DeltaFile
+1-1sys/geom/geom_ctl.c
+1-11 files

FreeBSD/src 9e345ca — sys/netinet tcp_input.c, sys/netinet/tcp_stacks bbr.c rack.c

tcp: improve ISS checking for ghost ACKs

The check in tcp_adapt_iss_check() depends on SND.UNA and therefore
should be performed whenever SND.UNA is incremented.

PR:                     298560
Reviewed by:            Peter Lei
MFC after:              3 days
MFC to:                 stable/14
MFC to:                 stable/15
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D61749
DeltaFile
+4-1sys/netinet/tcp_stacks/rack.c
+2-1sys/netinet/tcp_stacks/bbr.c
+2-1sys/netinet/tcp_input.c
+8-33 files

FreeBSD/src 96c5451 — sys/netpfil/pf pf_ioctl.c

pf: don't allow any ioctl calls until we're fully initialised

We create the /dev/pf node before we're fully initialised, leaving a
(very small) gap where ioctl calls could be made before we're ready
for them.

PR:             301074
MFC after:      2 weeks
Sponsored by:   Rubicon Communications, LLC ("Netgate")
DeltaFile
+4-0sys/netpfil/pf/pf_ioctl.c
+4-01 files

FreeBSD/src ba70b70 — sys/netpfil/pf pf.c

pf: include orig_kif in the mark-and-sweep cleanup mechanism

As part of the purge process we mark all kifs referenced by states, so
that at the end of the sweep we know which ones are no longer referenced
and can be safely cleaned up.
We forgot to mark the orig_kif, so it was possible for a kif to be
referenced only by a state's orig_kif field, and if the interface itself
then went away we might end up freeing the kif while a state still
referenced it.

Reported by:    llm-postcr
Fixes:          d0fdf2b28f9b ("pf: Track the original kif for floating states")
Sponsored by:   Rubicon Communications, LLC ("Netgate")
DeltaFile
+2-0sys/netpfil/pf/pf.c
+2-01 files

FreeBSD/src d5f0768 — sys/dev/acpica acpi_ec.c

acpi_ec: Interpret a relative ECDT's EC_ID as an absolute namepath

This commit makes the Elan touchpad (ELAN06FA) on the Lenovo Thinkbook
14 6G attach at boot by resolving the ECDT's relative EC_ID path from
the namespace root.

The motherboard supports multiple touchpad models (Synaptics, Elan, ...)
As a result, the firmware defers the selection until runtime:
 - touchpad device _INI method queries the embedded controller (EC),
 - determines the actual model installed
 - writes the correct _HID and I²C slave address

In acpi_ec_ecdt_probe(), the ECDT's EC_ID string is resolved with a NULL
scope. However ACPICA only accepts absolute paths in this context, while
the EC_ID provided by this machine's firmware is relative.

Although this is not specification-compliant, this change interprets
the relative EC_ID as an absolute namepath from the namespace root.


    [3 lines not shown]
DeltaFile
+1-1sys/dev/acpica/acpi_ec.c
+1-11 files

FreeBSD/src 73929d1 — sys/netinet tcp_input.c tcp_var.h, sys/netinet/tcp_stacks rack.c bbr.c

tcp: improve consistency

Use an inline function tcp_adapt_iss_check() to perform the check
consistently instead of replicating the code multiple times. These
checks already became inconsistent.
A fix for PR 298560 requires more calls to tcp_adapt_iss_check().

Reviewed by:            Peter Lei
Fixes:                  fa2ad70a4511 ("tcp: make ghost ACK handling more conformant")
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D61685

(cherry picked from commit e3483dbc91b59b5b2c73a4bc792fbb834c3dc111)
DeltaFile
+10-0sys/netinet/tcp_var.h
+1-4sys/netinet/tcp_stacks/rack.c
+1-4sys/netinet/tcp_stacks/bbr.c
+1-4sys/netinet/tcp_input.c
+13-124 files

FreeBSD/src a170546 — sys/netinet tcp_input.c

tcp: make ghost ACK handling more conformant

The latest version of draft-ietf-tcpm-tcp-ghost-acks changed
a condition. This should make no substantial difference, but makei
it compliant to the latest version of the specification.

Reviewed by:            rscheff, Peter Lei
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D58411

(cherry picked from commit fa2ad70a4511e7b379e81de82c9e51b2e0994295)
DeltaFile
+1-1sys/netinet/tcp_input.c
+1-11 files

FreeBSD/src 13357c1 — sys/netinet tcp_output.c

tcp: improve sender side SWS avoidance

When checking for a full sized segment, take all TCP options that will
be included into account. This fixes a bug which can trigger the
"sent too much" KASSERT related to limited transmit.

Reported by:            olivier
Reviewed by:            rscheff, Peter Lei
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D61605

(cherry picked from commit d174085f9f895ed444bd95120da3eff481a58f1a)
DeltaFile
+1-13sys/netinet/tcp_output.c
+1-131 files

FreeBSD/src cbd17b6 — sys/netinet/tcp_stacks bbr.c

tcp bbr: improve handling of retransmissions in LAST-ACK

When performing a timer based retransmission, clear the
BBR_RWND_COLLAPSED flag. If it sticks, t_rxtshift is never incremented
resulting in unlimited retransmissions in the LAST-ACK state.

Reported by:            Illia Vynohradov
Reviewed by:            Peter Lei
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D61586

(cherry picked from commit 3c6fd437b1824caeddb5f0d4570d43cf0c999c14)
DeltaFile
+1-1sys/netinet/tcp_stacks/bbr.c
+1-11 files

FreeBSD/src 3e74519 — sys/netinet/tcp_stacks bbr.c

tcp bbr: improve persits timeout computation

t_srtt and t_rttvar use different lengths of fractions, therefore use
the appropriate shift value.

Reviewed by:            Peter Lei
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D61600

(cherry picked from commit 751882926dc0bb1f7a4834c4b5e8d951cee61c7c)
DeltaFile
+1-1sys/netinet/tcp_stacks/bbr.c
+1-11 files

FreeBSD/src ccf8e37 — sys/netinet/tcp_stacks bbr.c

tcp bbr: improve retransmit timout calculation

The retransmission timeout should the srtt + 4 * rttvar.
The srtt is using 5 bits of fractions and rttvar is using 4 bits of
fractions, some specific shifting is required.

Reviewed by:            Peter Lei
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D61581

(cherry picked from commit 2f98793a13fe3e69cf6b698fa469550b4ba0fea1)
DeltaFile
+1-2sys/netinet/tcp_stacks/bbr.c
+1-21 files

FreeBSD/src 158dcb8 — sys/netinet/tcp_stacks bbr.c

tcp bbr: improve invalidating rtt

Invalidate the rtt based on t_rxtshift instead of resetting t_srtt to 0,
because using the latter also affects the retransmission timeout.

Reviewed by:            Peter Lei
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D61585

(cherry picked from commit 8018d75601dfe804a8d70f4f08bdb0e4e3a8c5c9)
DeltaFile
+2-4sys/netinet/tcp_stacks/bbr.c
+2-41 files

FreeBSD/src c8ca5fa — sys/netinet/tcp_stacks bbr.c

tcp bbr: cleanup

No functional change intended.

Sponsored by:   Netflix, Inc.

(cherry picked from commit 34436bb7cf971dba1c0dcdb1d45f22fff1a4b6c1)
DeltaFile
+3-4sys/netinet/tcp_stacks/bbr.c
+3-41 files

FreeBSD/src a82c042 — lib/libvmmapi vmmapi.c

libvmmapi: Size the guard reservation from existing memory

When the VM's memory already exists, as it does after bhyveload(8),
vm_setup_memory_domains() maps the existing segment but sizes its
address space reservation from the requested size.  If the existing
segment is larger, the mapping runs past the reservation and replaces
the guard region after it, and anything else mapped there.

Look for existing memory before sizing the reservation.

Reviewed by:    bnovkov, markj
Approved by:    markj
Fixes:          08c7dd2fbe4f (libvmmapi: Add support for setting up and configuring guest NUMA domains)
MFC after:      1 week
Sponsored by:   Alchemilla Ventures Private Limited
Differential Revision:  https://reviews.freebsd.org/D61917
DeltaFile
+28-20lib/libvmmapi/vmmapi.c
+28-201 files