FreeBSD/src 42e6660sys/amd64/amd64 machdep.c

amd64: do not switch back and restore UEFI IDT in wrmsr_early_safe_end()

(cherry picked from commit 606d3cb1be5fd594c1f51addd063e7c13e16bdbc)
DeltaFile
+0-8sys/amd64/amd64/machdep.c
+0-81 files

FreeBSD/src c6ccef4sys/x86/x86 ucode.c

amd64: there is no reason to copy ucode around in ucode_load_bsp()

PR:     294630

(cherry picked from commit 16f21c5af35002b8361ffb2e83ff3c92cd899a3a)
DeltaFile
+9-11sys/x86/x86/ucode.c
+9-111 files

FreeBSD/src c7ff706stand/lua core.lua cli.lua, stand/man loader.8

lualoader: add be-list and be-switch commands

This is useful for driving BE changes from the loader command prompt,
rather than having to use the menu.  Note that the active carousel in
the boot environment carousel doesn't currently reflect a switch in
boot environments done this way- I'm considering this only a minor bug,
as you probably can't or won't go back to the menu if you're using these
commands.

Reviewed by:    imp (previous version)
DeltaFile
+43-0stand/lua/core.lua
+23-0stand/lua/cli.lua
+16-1stand/lua/core.lua.8
+14-1stand/man/loader.8
+1-6stand/lua/menu.lua
+97-85 files

FreeBSD/src 4f7d987. .git-blame-ignore-revs

.git-blame-ignore-revs: <assert.h> whitespace changes: Fix comment

Fixes:          8ee0f80252d1 (".git-blame-ignore-revs: <assert.h> whitespace changes")
Sponsored by:   The FreeBSD Foundation
DeltaFile
+1-1.git-blame-ignore-revs
+1-11 files

FreeBSD/src 8ee0f80. .git-blame-ignore-revs

.git-blame-ignore-revs: <assert.h> whitespace changes

Reminded by:    brooks
Sponsored by:   The FreeBSD Foundation
DeltaFile
+4-0.git-blame-ignore-revs
+4-01 files

FreeBSD/src eb3a0a7lib/libarchive Makefile.inc, usr.bin/bsdcat Makefile

libarchive: Clean up the build configuration

* Move settings duplicated in libarchive, bsdcat, bsdcpio, bsdtar, and
  bsdunzip into libarchive's Makefile.inc.

* Drop some CFLAGS that merely duplicated some of the contents of our
  platform configuration header.

MFC after:      1 week
Reviewed by:    mm
Differential Revision:  https://reviews.freebsd.org/D57307
DeltaFile
+5-13usr.bin/cpio/Makefile
+6-11usr.bin/bsdcat/Makefile
+11-5lib/libarchive/Makefile.inc
+7-8usr.bin/cpio/tests/Makefile
+7-8usr.bin/bsdcat/tests/Makefile
+4-10usr.bin/unzip/Makefile
+40-555 files not shown
+63-8611 files

FreeBSD/src b3a8659. MAINTAINERS, .github CODEOWNERS

MAINTAINERS, CODEOWNERS: Add myself to fts and stdio
DeltaFile
+9-6MAINTAINERS
+5-2.github/CODEOWNERS
+14-82 files

FreeBSD/src 7487932include assert.h

assert.h: style(9): Space after #define, between #endif and comment

style(9) still allows TAB after #define but this is a historical
artifact and by far the minority of uses cases.  Going forward, we would
like to promote the use of a single space, as it allows alignment to
survive line prefixing (such as in diffs).

style(9) also has prescribed a single space between '#else' or '#endif'
and a comment recalling the guard since 2002.

So, commit 157c184689ea ("assert.h: Remove leading tabs for whitespace
consistency") was good, and in line with rules about whitespace changes
(since the file was heavily modified by surrounding commits).

This commit is thus basically a revert of 439710cf003b ("assert.h:
Revert "Remove leading tabs for whitespace consistency"), which extended
replacing spaces with TABs in the code introduced in the meantime (after
commit 157c184689ea).


    [4 lines not shown]
DeltaFile
+13-13include/assert.h
+13-131 files

FreeBSD/src 0c2d64csys/security/mac_do mac_do.c

MAC/do: Clarify comments about flags attached per-ID or per-ID-type

No functional change.

MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
DeltaFile
+7-5sys/security/mac_do/mac_do.c
+7-51 files

FreeBSD/src 1c0e5c5sys/kern kern_prot.c

kern_prot.c: Belatedly add copyright

See the commit log for the why.

MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
DeltaFile
+5-0sys/kern/kern_prot.c
+5-01 files

FreeBSD/src d52de9alibexec/rc/rc.d defaultroute

defaultroute: Fix dual-stack and IPv6-only handling

Since IPv6-only setups are becoming more common, and IPv6
connectivity is often sufficient for tasks such as DNS
resolution and NTP time synchronization, update defaultroute
rc.d script to support IPv6-only environments.

Reviewed by:    pouria, ae
Differential Revision: https://reviews.freebsd.org/D56797
DeltaFile
+19-11libexec/rc/rc.d/defaultroute
+19-111 files

FreeBSD/src 4258829libexec/rc/rc.d defaultroute

Revert "defaultroute: Fix dual-stack and IPv6-only handling"

This reverts commit 5b5a836e72ec2614def23409674822c907cf3740.

Despite using arcpatch for this commit, I attributed the wrong
author of the patch.
DeltaFile
+11-19libexec/rc/rc.d/defaultroute
+11-191 files

FreeBSD/src 5b5a836libexec/rc/rc.d defaultroute

defaultroute: Fix dual-stack and IPv6-only handling

Since IPv6-only setups are becoming more common, and IPv6
connectivity is often sufficient for tasks such as DNS
resolution and NTP time synchronization, update defaultroute
rc.d script to support IPv6-only environments.

Reviewed by:    pouria, ae
Differential Revision: https://reviews.freebsd.org/D56797
DeltaFile
+19-11libexec/rc/rc.d/defaultroute
+19-111 files

FreeBSD/src a8e709ccontrib/llvm-project/clang/lib/Serialization ASTReaderDecl.cpp

Merge commit 63c29df8eceb from llvm git (by Dmitry Polukhin):

  [Serialization] Fix assertion on re-deserialized friend template spec… (#200566)

  …ialization in PCH (#198133)

  A friend function-template specialization declared inside a class
  template is serialized into a PCH. When the class template is later
  instantiated while loading the PCH, the friend specialization can be
  deserialized re-entrantly (VisitFriendDecl -> VisitFunctionDecl -> ...
  -> VisitFunctionDecl for the same specialization) at the same time as
  the canonical copy, producing two redeclarations of the same
  specialization in the template's specialization set.

  ASTDeclReader::VisitFunctionDecl asserted that this collision could only
  happen when merging declarations from different modules. Since
  38b3d87bd384, friend functions defined inside dependent class templates
  are loaded eagerly, so the collision can now also occur within a single
  PCH/AST file (non-modules build), tripping the assertion:

    [18 lines not shown]
DeltaFile
+0-2contrib/llvm-project/clang/lib/Serialization/ASTReaderDecl.cpp
+0-21 files

FreeBSD/src 2cdb0c0contrib/llvm-project/clang/lib/Serialization ASTReaderDecl.cpp

Merge commit 63c29df8eceb from llvm git (by Dmitry Polukhin):

  [Serialization] Fix assertion on re-deserialized friend template spec… (#200566)

  …ialization in PCH (#198133)

  A friend function-template specialization declared inside a class
  template is serialized into a PCH. When the class template is later
  instantiated while loading the PCH, the friend specialization can be
  deserialized re-entrantly (VisitFriendDecl -> VisitFunctionDecl -> ...
  -> VisitFunctionDecl for the same specialization) at the same time as
  the canonical copy, producing two redeclarations of the same
  specialization in the template's specialization set.

  ASTDeclReader::VisitFunctionDecl asserted that this collision could only
  happen when merging declarations from different modules. Since
  38b3d87bd384, friend functions defined inside dependent class templates
  are loaded eagerly, so the collision can now also occur within a single
  PCH/AST file (non-modules build), tripping the assertion:

    [18 lines not shown]
DeltaFile
+0-2contrib/llvm-project/clang/lib/Serialization/ASTReaderDecl.cpp
+0-21 files

FreeBSD/src a05af6dsys/arm/broadcom/bcm2835 bcm2838_pci.c

pci: bcm2838: cleanup on attach failure to fix devmatch panic

Specifically on the RPi CM4, we currently don't set the controller up
right and it never moves into the ready state (we don't observe the link
active bit).  Failure to cleanup here actually results in a panic not
long after, due to a use-after-free in the rman bits.  Further down in
pci_host_generic, we have some rman stashed in the softc that are
initialized and placed onto the rman tailq, then the softc is later
freed without an rman_fini() to pull them off of the tailq properly.

Note that PCIe on this board won't come up at boot without something
plugged in, so it currently can't be booted with an empty slot with the
intent to hotplug a supported card.  Some issues with controller startup
have been observed with Broadcom NICs in the wild, but no problems have
been observed with other NICs and a variety of different PCIe cards.

Shout-out to Vince <git at darkain.com> for the extensive debugging and
analysis to arrive at this conclusion.


    [2 lines not shown]
DeltaFile
+9-4sys/arm/broadcom/bcm2835/bcm2838_pci.c
+9-41 files

FreeBSD/src 31a94ecsys/dev/pci pci_host_generic_fdt.c pci_host_generic.c

pci: pci_host_generic: provide cleanup methods outside of detach

If device_attach() fails, we're expected to actually cleanup after
ourselves because device_detach() will not be called.  Factor out the
cleanup bits that don't rely on attach having actually succeeded so
that we can cleanup properly in bcm2838_pci.

Reviewed by:    andrew, imp
Differential Revision:  https://reviews.freebsd.org/D56896
DeltaFile
+19-0sys/dev/pci/pci_host_generic_fdt.c
+11-4sys/dev/pci/pci_host_generic.c
+1-0sys/dev/pci/pci_host_generic.h
+1-0sys/dev/pci/pci_host_generic_fdt.h
+32-44 files

FreeBSD/src b230a7bsys/dev/ofw ofw_bus_subr.c ofw_bus_subr.h

kern: ofw: provide ofw_bus_destroy_iinfo to teardown interrupt-map

For symmetry with ofw_bus_setup_iinfo, the next commits will use it to
properly cleanup on failure in bcm2838_pci.

Reviewed by:    andrew
Differential Revision:  https://reviews.freebsd.org/D56895
DeltaFile
+12-0sys/dev/ofw/ofw_bus_subr.c
+1-0sys/dev/ofw/ofw_bus_subr.h
+13-02 files

FreeBSD/src 0696d38sys/amd64/amd64 machdep.c

amd64/machdep.c: explicitly include sys/uio.h

Some kernel configurations result in struct uio being only
forward-declared.

This is direct commit to stable/15.

Sponsored by:   The FreeBSD Foundation
DeltaFile
+1-0sys/amd64/amd64/machdep.c
+1-01 files

FreeBSD/src 72e57bcsys/fs/nfs nfsproto.h nfsrvstate.h, sys/fs/nfsserver nfs_nfsdport.c nfs_nfsdstate.c

nfsd: Add support for striped Flexible File layout

Without this patch, the NFSv4.1/4.2 pNFS server configuration
did not support striping.  This was mainly because the Linux
client driver did not support it either.  The Linux client
driver for Flexible File layout does now support striping.
(Linux kernel version 6.18 or newer)

As such, this patch adds striping support.  The configuration
is currently just two new sysctls called
vfs.nfsd.pnfsstripeunit - Size (in bytes) of a stripe
vfs.nfsd.pnfsstripecnt - # of DSs to stripe across
A setting of 0 for the first sysctl and 1 for the second
disables striping.  A patch that allows use of a different
striping configuration for each exported MDS file system
is planned for the future.

The pnfsdscopymr may be broken by this patch, but since
no one reported that they were actually using a pNFS server

    [12 lines not shown]
DeltaFile
+817-258sys/fs/nfsserver/nfs_nfsdport.c
+47-44sys/fs/nfsserver/nfs_nfsdstate.c
+13-3sys/fs/nfs/nfsproto.h
+11-5sys/fs/nfsserver/nfs_nfsdserv.c
+13-0sys/fs/nfs/nfsrvstate.h
+4-4sys/fs/nfs/nfs_var.h
+905-3141 files not shown
+908-3147 files

FreeBSD/src f0ac411usr.sbin/bsdinstall/distextract distextract.c

bsdinstall: Use libarchive secure flags for extract

This doesn't really matter, as we trust that the installer tarballs are
not malicious, but it doesn't hurt to set these flags.

Reported by: Yuxiang Yang, Yizhou Zhao, Ao Wang, Xuewei Feng, Qi Li, and Ke Xu from Tsinghua University using GLM-5.1 from Z.ai
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57274

(cherry picked from commit f9f46294d6af2a937afa74938bd4bb6826cbb921)
DeltaFile
+2-0usr.sbin/bsdinstall/distextract/distextract.c
+2-01 files

FreeBSD/src cc00806sys/amd64/amd64 machdep.c support.S

x86: for wrmsr_early_safe(), catch all exceptions, not only #GP

(cherry picked from commit 0a02a47fd94a8326e84ac0a6cb857342b59671f8)
DeltaFile
+15-9sys/amd64/amd64/machdep.c
+3-4sys/amd64/amd64/support.S
+18-132 files

FreeBSD/src e5488ddstand/man loader.efi.8, sys/amd64/amd64 machdep.c

amd64: explain in more details why the slop is needed

(cherry picked from commit 963a92d63b7443d27588fb4260bd4226f7525117)
DeltaFile
+7-0sys/amd64/amd64/machdep.c
+3-0stand/man/loader.efi.8
+10-02 files

FreeBSD/src 5377cd6sys/amd64/amd64 machdep.c, sys/sys systm.h

sys: add safe_read(9)

(cherry picked from commit 7b2702ee25f5230011fa7f8f650b65b37248fcca)
DeltaFile
+18-0sys/amd64/amd64/machdep.c
+8-0sys/sys/systm.h
+26-02 files

FreeBSD/src 9681364sys/amd64/amd64 mem.c uio_machdep.c, sys/amd64/include md_var.h

amd64: extract uiomove_mem() from memrw()

(cherry picked from commit 67d61d18bb8debb4ffc51ef2248aa37ed0bfb8f5)
DeltaFile
+11-92sys/amd64/amd64/mem.c
+96-0sys/amd64/amd64/uio_machdep.c
+6-0sys/amd64/include/md_var.h
+113-923 files

FreeBSD/src 2fa4a6bsys/kern imgact_elf.c

imgact_elf: read program headers if not contained in the first page

PR:     295629

(cherry picked from commit 804daf166406a1b0e22f93b9417b90ed7d3aa1ae)
DeltaFile
+62-29sys/kern/imgact_elf.c
+62-291 files

FreeBSD/src 21d0d2asys/kern imgact_elf.c

imgact_elf: add sysctl kern.elfXX.phnums for the number of program headers

(cherry picked from commit 201090678e033237e20d80eb29cc059e0df9a1e1)
DeltaFile
+12-10sys/kern/imgact_elf.c
+12-101 files

FreeBSD/src 5bbd104sys/kern imgact_elf.c kern_exec.c, sys/sys imgact.h

image activators: pass the current thread

(cherry picked from commit 9b729333bb2495afb8821044fa42c9ebe0874703)
DeltaFile
+16-20sys/kern/imgact_elf.c
+1-0sys/kern/kern_exec.c
+1-0sys/sys/imgact.h
+18-203 files

FreeBSD/src 21fb5a5sys/fs/smbfs smbfs_node.c

smbfs: plug smbfs_node_alloc() leak of name buffers when insmntque() fails

PR:     295577

(cherry picked from commit f0e702a7a289f0f350bdaeb943805d6d17f9e403)
DeltaFile
+4-0sys/fs/smbfs/smbfs_node.c
+4-01 files

FreeBSD/src 67df313sys/compat/linuxkpi/common/include/linux pm_qos.h

linuxkpi: Make pm_qos.h self-contained

Include <linux/types.h> for `false`.  This is needed by amdgpu somewhere
between Linux 6.12 and 6.15.

Reviewed by:    Minsoo Choo <minsoo at minsoo.io>, bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57415
DeltaFile
+2-0sys/compat/linuxkpi/common/include/linux/pm_qos.h
+2-01 files