FreeBSD/src 3c03ab0 — release/tools ec2.conf

EC2: Set hw.dmar.enable="1"

Large EC2 "bare metal" instances route interrupts to APIC IDs > 255,
and unlike the "virtualized" instances, don't support extended APIC
destination IDs (since that's a hypervisor feature, and bare metal
instances have no hypervisor).

Enable the IOMMU for interrupt remapping; this unbreaks booting on
m8i.metal-96xl and variants thereof (e.g. c8in).

MFC after:      1 day
Sponsored by:   Amazon
Tested on:      c5n.9xlarge, c6a.24xlarge, c8in.96xlarge, c5.metal,
                c6in.metal, c6a.metal, c7a.metal-48xl, c7i.metal-24xl,
                c7i.metal-48xl, c8a.metal-24xl, c8a.metal-48xl,
                c8i.metal-48xl, c8i.metal-96xl, c8in.metal-48xl,
                c8in.metal-96xl, m5.metal, m8azn.metal-24xl
DeltaFile
+4-0release/tools/ec2.conf
+4-01 files

FreeBSD/src 0833030 — sys/dev/evdev evdev_utils.c

evdev: Map the HP mic mute and programmable keys on HP only

AT scan codes 0xE0 0x01 and 0x68 are vendor keys: systemd's hwdb gives
them other meanings on Dell, Alienware, Lenovo, Samsung and others,
some of which send no release code.  The shared AT table made Insert
toggle mic mute on an IdeaPad 5 and left KEY_PROG1 held after the Dell
G-Mode key.

Map them only where SMBIOS names an HP business laptop, as hwdb does:
0xE0 0x01 to KEY_MICMUTE on ZBook, EliteBook, ProBook, Elite Dragonfly
and EliteBoard, 0x68 to KEY_PROG1 on the Elite Dragonfly G2 and the
ZBook Ultra G1a.

Reported by:    llm-postcr
Reviewed by:    imp, wulf
Approved by:    wulf
Fixes:          d34baf1b5ca0 ("evdev: Map the HP mic mute and programmable keys")
MFC after:      1 week
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/130
DeltaFile
+53-4sys/dev/evdev/evdev_utils.c
+53-41 files

FreeBSD/src c705ab5 — usr.sbin/rpc.tlsservd rpc.tlsservd.c

Revert "rpc.tlsservd.c: Pin max threads at 1 for now"

This reverts commit 7a289fe3cd5c6de7ddbe394b7700b20b0bafdb3e.

Hopefully, commit fc7993cf2d6d has fixed the underlying
problem reported by PR#289734, so I am reverting this
temporary work-around.

I will delay MFC'ng this for a while, to see if the
problem occurs again.

(cherry picked from commit 62e7ac83ae14fcc1847d607e98284bd4a98e7127)
DeltaFile
+0-7usr.sbin/rpc.tlsservd/rpc.tlsservd.c
+0-71 files

FreeBSD/src 0504bd3 — sys/netinet6 in6.c, tests/sys/netinet6 Makefile in6_control.c

netinet6: check the length of the destination address

in6_validate_ifra() requires ifra_addr to be a struct sockaddr_in6,
but it accepts an AF_INET6 ifra_dstaddr with any sin6_len, and
in6_notify_ifa() stores that address in ia_dstaddr as given.

Reject an AF_INET6 destination address whose sin6_len is not
sizeof(struct sockaddr_in6) with EINVAL, as in_aifaddr() does for
IPv4.  ifconfig(8), the netlink address handler and the kernel's own
callers already pass the right length.

Add tests/sys/netinet6/in6_control, whose cases run in a VNET jail:
- aifaddr_dstaddr: SIOCAIFADDR_IN6 stores a valid destination
  address, and getifaddrs(3) reports it;
- aifaddr_dstaddr_badlen: SIOCAIFADDR_IN6 rejects a destination
  address with sin6_len 255.
aifaddr_dstaddr_badlen fails without the fix.

Reviewed by:    glebius, markj

    [3 lines not shown]
DeltaFile
+201-0tests/sys/netinet6/in6_control.c
+5-1sys/netinet6/in6.c
+4-1tests/sys/netinet6/Makefile
+210-23 files

FreeBSD/src d2bc774 — sys/fs/nfs nfs_commonsubs.c nfs_commonkrpc.c

nfscommon: Fix a couple of slot handling cases

If a server shrinks the slot table for a NFSv4.1/4.2 session
(the FreeBSD server does not do this), it might have failed
to reset the slot's sequence# to 0, do to not handling the
case where the slot# equals the foreslot limit.

Also, a typo would fail when the slot# is greater than 31,
due to the type of the 1 being shifted.

This patch fixes both of these.

Reported by:    Chuck Lever <cel at kernel.org>
MFC after:      2 weeks
DeltaFile
+1-1sys/fs/nfs/nfs_commonsubs.c
+1-1sys/fs/nfs/nfs_commonkrpc.c
+2-22 files

FreeBSD/src ac0cfa4 — sys/powerpc/powerpc trap.c

powerpc: fix an off-by-one when widening 32-bit syscall arguments

cpu_fetch_syscall_args() widens the arguments a 32-bit syscall passes on
the stack. The loop started at narg instead of narg - 1 and wrote
td_sa.args[narg], one past the end of the eight entry array, which is
td_sigblock_ptr in struct thread. NARGREG is 8, so a plain syscall never
enters the loop, but syscall(2) and __syscall(2) lower the register count
to 7 and 6, and an eight argument syscall made that way, like
freebsd32_sendfile with its two slot off_t, corrupted the pointer.

A 32-bit program calling sendfile through syscall(2) changed its own
td_sigblock_ptr (watched with DTrace on cpu_fetch_syscall_args); it
leaves it alone now.

Reviewed by:    jhibbits
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D61884
DeltaFile
+1-1sys/powerpc/powerpc/trap.c
+1-11 files

FreeBSD/src acc46e3 — sys/amd64/amd64 cpu_switch.S

cpu_switch(): Move 'sw1wait' inside the function block

This code block is unrelated to the resumectx() procedure it was after,
and is referenced only by cpu_switch(), so move it between
ENTRY(cpu_switch) and END(cpu_switch).  This, in particular, puts it
inside a .cfi_startproc/.cfi_endproc block, giving clearer debugging
information should a problem arise there.

Keep it at the end so that jumping to it is initially predicted not
taken.

Reviewed by:    kib
Fixes:          73dd84a7a54d ("amd64: clean up cpu_switch.S")
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D61713
DeltaFile
+9-9sys/amd64/amd64/cpu_switch.S
+9-91 files

FreeBSD/src 9508483 — lib/libsysdecode mktables

libsysdecode: Avoid non-portable \> word end boundary in mktables

Whilst we bootstrap our own sed when building on non-FreeBSD, it uses
the system regex(3) implementation, and so inherits its extensions, not
our own. Our implementation and glibc's both include this extension to
POSIX, but macOS's does not, and so even with our bootstrap sed we
cannot use the \> extension when built and run on macOS.

Unfortunately, there is no alternative form we can use; whilst macOS
implements [[:>:]] as an extension that provides this same feature, and
so do we, the regex(3) implementation in glibc does not, and the only
alternative glibc offers is \b, which neither us nor macOS implement.

We could make the form used conditional on the OS, but that starts to
get messy once other Linux libcs enter the picture, which in theory we
somewhat support.

Rewrite both uses to avoid the need for \>. For gen_table, use a pattern
to match the identifier that is precisely the (non-extended) C99

    [25 lines not shown]
DeltaFile
+2-2lib/libsysdecode/mktables
+2-21 files

FreeBSD/src 72d7d15 — contrib/bsnmp/lib snmp.c, contrib/bsnmp/snmpd main.c

bsnmp: drop messages with an unsupported SNMP version

snmp_pdu_decode_header() returned SNMP_CODE_BADENC for an unknown
version.  snmp_input_start() treats BADENC as a bad value in a SET and
carries on, so its version check, which runs only for SNMP_CODE_OK, was
skipped.  The message then reached snmp_pdu_auth_access(), which with
snmp_vacm loaded switched on pdu->version and called abort() for
SNMP_Verr.  A single unauthenticated packet could stop bsnmpd.

Return SNMP_CODE_BADVERS instead, as bsnmplib(3) documents, so the
message is counted in snmpInBadVersions and dropped.  Remove the
mapping in snmp_pdu_decode() that tried to do this but was never
reached, and have snmp_pdu_auth_access() deny an unknown version
rather than abort.

Reported by:    Hila Cohen, Apiiro (hillalee on github)
Reviewed by:    harti
MFC after:      3 days
DeltaFile
+1-5contrib/bsnmp/lib/snmp.c
+1-1contrib/bsnmp/snmpd/main.c
+2-62 files

FreeBSD/src 15199ab — 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 b35cfae — 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 c1a8138 — 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 12ab8fa — 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 7faf4af — 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 17fdbda — 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 798cea6 — 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 051876d — 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 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