FreeBSD/src 7dd9070lib/libc/include libc_private.h, lib/libc/sys kevent.c clock_nanosleep.c

libc: INTERPOS_SYS macro for interposed syscalls

This macro makes uses the __sys_<foo>_t typedefs from libsys.h to
greatly simplify calling functions in the interposing table.

Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D44389
DeltaFile
+2-4lib/libc/sys/kevent.c
+6-0lib/libc/include/libc_private.h
+1-4lib/libc/sys/clock_nanosleep.c
+1-4lib/libc/sys/send.c
+2-3lib/libc/sys/creat.c
+1-4lib/libc/sys/recvfrom.c
+13-1943 files not shown
+56-12349 files

FreeBSD/src 79b758esys/tools makesyscalls.lua

makesyscalls: generate core libsys header

Create a header covering most of the "stable" libsys interfaces.
Specifically __sys_<foo> syscall stubs and __sys_<foo>_t typedefs for
those interfaces.

Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D44386
DeltaFile
+91-0sys/tools/makesyscalls.lua
+91-01 files

FreeBSD/src 792081alib/libc/include libc_private.h, lib/librt mq.c

lib{c,rt}: use libsys.h for __sys_* declerations

Use the genreated source of truth for system call declerations.

Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D44388
DeltaFile
+2-77lib/libc/include/libc_private.h
+0-12lib/librt/mq.c
+2-892 files

FreeBSD/src 1fd8807lib/libsys _libsys.h libsys.h, sys/kern syscalls.conf

libsys: add a libsys.h

This declares an API for libsys which currently consists of
__sys_<foo>() declarations for system call stubs and function pointer
typedefs of the form __sys_<foo>_t.  The vast majority of the
implementation resides in a generated _libsys.h which ensures that all
system call stub declarations match syscalls.master.

Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D44387
DeltaFile
+865-0lib/libsys/_libsys.h
+25-0lib/libsys/libsys.h
+2-0lib/libsys/Makefile
+1-0sys/kern/syscalls.conf
+893-04 files

FreeBSD/src 894bf6bsys/dev/wg if_wg.c

wg: Use ENETUNREACH when transmitting to a non-existent peer

The old errno value used is specifically for Capsicum and shouldn't be
co-opted in this way.  It has special handling in the generic syscall
layer (see syscallret()).  OpenBSD returns ENETUNREACH in this case;
let's do the same thing.

PR:             266712
Reviewed by:    kevans, imp
MFC after:      2 weeks
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D44582

(cherry picked from commit 63613e3ba1e188e9fece43e1613bd697f04b345e)
DeltaFile
+1-4sys/dev/wg/if_wg.c
+1-41 files

FreeBSD/src 8062f37sys/dev/virtio/network if_vtnet.c

vtnet: set VNET context in RX handler

The context is required for NIC-level pfil(9) filtering.

(cherry picked from commit 3f2b9607756d0f92ca29c844db0718b313a06634)
DeltaFile
+2-0sys/dev/virtio/network/if_vtnet.c
+2-01 files

FreeBSD/src cc16c3csbin/pfilctl pfilctl.c

pfilctl: fix 'pfilctl hooks' when nothing is connected

The 'hooks' command actually worked accidentially until now.  It used
PFILIOC_LISTHEADS to determine current number of hooks.  This worked when
at least one head had a hook connected to it.

(cherry picked from commit 1bfe195143ffb6832ac6702e281964541554fcb3)
DeltaFile
+2-2sbin/pfilctl/pfilctl.c
+2-21 files

FreeBSD/src 73cce7dusr.sbin/mergemaster mergemaster.8

mergemaster: postpone removal to FreeBSD 15

Mergemaster has been deprecated for quite some time, but was not
removed prior to FreeBSD 14.0.  Update the deprecation notice in the man
page to reflect this.

PR:             274967
Reported by:    naddy
Sponsored by:   The FreeBSD Foundation
DeltaFile
+2-2usr.sbin/mergemaster/mergemaster.8
+2-21 files

FreeBSD/src bf4972asbin/bsdlabel bsdlabel.8

bsdlabel: add deprecation notice

gpart is the preferred tool for managing partitions of all types,
including BSD disklabels.

Note that this is only about bsdlabel/disklabel, the tool -- there is no
current plan to remove support for MBR or BSD disk labels from the
kernel or from gpart.

Reviewed by:    imp, olce
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D43563

(cherry picked from commit b6f3cced151f8b7dc3e32977e8f1b826f0654690)
DeltaFile
+17-3sbin/bsdlabel/bsdlabel.8
+17-31 files

FreeBSD/src 7f156d8sys/arm64/nvidia/tegra210 tegra210_xusbpadctl.c

tegra210: change to UTF-8 (from ISO-8859)

Prompted by Phabricator's complaint that a C source file was a binary
file, in D43192.

Reviewed by:    mmel
Differential Revision: https://reviews.freebsd.org/D43229

(cherry picked from commit 56c202de785a5701831ae345a1a5c906e0b2c3e6)
DeltaFile
+2-2sys/arm64/nvidia/tegra210/tegra210_xusbpadctl.c
+2-21 files

FreeBSD/src 40b57cbusr.sbin/tzsetup tzsetup.c

tzsetup: be explicit about *timezone* abbreviation

During the install process tzsetup asks a question like

    Does the abbreviation `EDT' look reasonable?

The installer asks lots of questions, some that relate to the previous
screen or topic and some that do not.  A new user installed FreeBSD for
the first time and was confused by this question, not realizing that it
was asking whether the abbreviation is correct for the selected
timezone.

Reviewed by:    bapt, brooks, imp
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D44500
DeltaFile
+1-1usr.sbin/tzsetup/tzsetup.c
+1-11 files

FreeBSD/src 428f86fbin/mv mv.c

mv: Set file flags after setting file times

Some file flags prevent modification of file times, so they should be
set later.  This matches NetBSD's behaviour.

Reviewed by:    markj
MFC after:      1 week
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1138
DeltaFile
+6-5bin/mv/mv.c
+6-51 files

FreeBSD/src 219d8fbtools/test/stress2/misc all.sh

stress2: Add an option to exit on error
DeltaFile
+9-2tools/test/stress2/misc/all.sh
+9-21 files

FreeBSD/src 02a2005tools/test/stress2/misc unionfs15.sh unionfs17.sh

stress2: Add new unionfs test scenarios
DeltaFile
+86-0tools/test/stress2/misc/unionfs15.sh
+73-0tools/test/stress2/misc/unionfs17.sh
+73-0tools/test/stress2/misc/unionfs18.sh
+65-0tools/test/stress2/misc/unionfs16.sh
+297-04 files

FreeBSD/src f750dcesys/dev/xen/bus xen_intr.c

x86/xen: fix accounted interrupt time

The current addition to the interrupt nesting level in
xen_arch_intr_handle_upcall() needs to be compensated in
xen_intr_handle_upcall(), otherwise interrupts dispatched by the upcall handler
end up seeing a td_intr_nesting_level of 2 or more, which makes them assume
there's been an interrupt nesting.

Such extra interrupt nesting count lead to statclock() reporting idle time as
interrupt, as the call from interrupt context will always be seen as a nested
one (td->td_intr_nesting_level >= 2) due to the nesting count increase done by
both xen_arch_intr_handle_upcall() and intr_execute_handlers().

Fix this by adjusting the nested interrupt count before dispatching interrupts
from xen_intr_handle_upcall().

PR: 277231
Reported by: Matthew Grooms <mgrooms at shrew.net>
Fixes: af610cabf1f4 ('xen/intr: adjust xen_intr_handle_upcall() to match driver filter')

    [2 lines not shown]
DeltaFile
+20-1sys/dev/xen/bus/xen_intr.c
+20-11 files

FreeBSD/src d77e45esys/netgraph ng_socket.c

ng_socket: Treat EEXIST from kern_kldload() as success

EEXIST is possible in a race condition.

Inspired by:    ffc72591b1f5 (Don't worry if a module is already loaded ...)
Reviewed by:    glebius
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D44633

(cherry picked from commit f6f67f58c19db4f25f5c2cf4869efc7054493a55)
(cherry picked from commit 2e8d60c6854006a391491bc2c1c48c459c32e2c4)
DeltaFile
+8-3sys/netgraph/ng_socket.c
+8-31 files

FreeBSD/src 2e8d60csys/netgraph ng_socket.c

ng_socket: Treat EEXIST from kern_kldload() as success

EEXIST is possible in a race condition.

Inspired by:    ffc72591b1f5 (Don't worry if a module is already loaded ...)
Reviewed by:    glebius
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D44633

(cherry picked from commit f6f67f58c19db4f25f5c2cf4869efc7054493a55)
DeltaFile
+8-3sys/netgraph/ng_socket.c
+8-31 files

FreeBSD/src 936c6d5usr.sbin/mountd mountd.8

mountd.8: Document the new -A mountd option

Commit fefb7c399b39 added warning messages noting
that administrative controls that exported directories
that are not local server file system mount points actually
export the entire local server file system.
This commit also added a new command line option "-A' that
silences these warnings.

This patch documents the new "-A' mountd option.

This is a content change.

(cherry picked from commit cce11997a052549933ca1c4d7412bf51137e4d0b)
DeltaFile
+12-2usr.sbin/mountd/mountd.8
+12-21 files

FreeBSD/src 77d298estand/efi/loader main.c, stand/i386/libi386 biosacpi.c

loader: lua: assume late ACPI detection if the feature isn't enabled

While we're here, enable the feature in the places we detect ACPI.  This
lets us side-step the existing issues and provide a path forward for
folks upgrading from previous releases that haven't updated their ESP
yet.

Let's also fix core.setACPI: the hint already indicates that the
user's disabled it more consistently than loader.acpi_disabled_by_user.
Even more, the latter is wrong because we set it by default if we did
not detect ACPI.  The ACPI hint remains even when we're setting defaults
because ACPI loaded into the kernel will make some noise if it's not
hinted off, even when we didn't detect it.

imp notes that this will result in some relatively harmless noise on
platforms that don't support ACPI but aren't using the UEFI loader, as
we would enable the ACPI module for loading on them and then loader
would not be able to find it.  These are non-fatal, but should probably
be fixed by just declaring support for EARLY_ACPI in those loaders since

    [7 lines not shown]
DeltaFile
+11-10stand/lua/core.lua
+2-0stand/i386/libi386/biosacpi.c
+1-0stand/efi/loader/main.c
+14-103 files

FreeBSD/src aa53b6dstand/libsa strcasecmp.c getopt.c, stand/libsa/amd64 _setjmp.S

stand: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by:           Netflix

(cherry picked from commit 6e28a6bc2e83d56a5d2d5ee4f5da72d798de2d07)
DeltaFile
+0-3stand/libsa/strcasecmp.c
+0-3stand/libsa/amd64/_setjmp.S
+0-3stand/libsa/getopt.c
+0-3stand/libsa/inet_ntoa.c
+0-3stand/libsa/strdup.c
+0-2stand/libsa/net.c
+0-1727 files not shown
+0-7133 files

FreeBSD/src 49028a1stand/i386/pmbr pmbr.S

pmbr: Only load the first 545k rather than error out

It would be nice to have larger boot partitions for ESPs to live in one
day. It's trivial to carve out 5M 10M or 200M when provisioning, but
logistical issues may make it hard to do it after the fact. So only warn
when the partition is > 545k. If we ever grow the boot loader larger
than that, then it will be responsible for loading the rest anyway.

Sponsored by:           Netflix
Reviewed by:            tsoome
Differential Revision:  https://reviews.freebsd.org/D42774

(cherry picked from commit c596126a5d3d2ee015ee6807b4041efa5b9d9b07)
DeltaFile
+15-9stand/i386/pmbr/pmbr.S
+15-91 files

FreeBSD/src 5417db3stand/forth menu-commands.4th, stand/lua core.lua core.lua.8

stand: Retire setting hw.eisa_slots.

When the eisa code was removed in 2017, prior to the stable/12 branch,
setting hw.eisa_slots became a nop. The oldest supported branch doesn't
have eisa at all. The need to set it manually on boot disappeared
largely by 2000...

Sponsored by:           Netflix

(cherry picked from commit 21795c374aceb685dbdb1bd18c7a5c41c3cf0baf)
DeltaFile
+0-2stand/forth/menu-commands.4th
+0-2stand/lua/core.lua
+0-1stand/lua/core.lua.8
+0-53 files

FreeBSD/src a0456d3stand/efi/include eficon.h, stand/kboot/arch/aarch64 tramp.S

stand: Fix typo (triple S)

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/955

(cherry picked from commit ed76a9506aaa81426ded64bb0e1f96c6509c32ea)
DeltaFile
+1-1stand/kboot/arch/aarch64/tramp.S
+1-1stand/efi/include/eficon.h
+2-22 files

FreeBSD/src 8b9bc82stand/common ls.c reloc_elf.c, stand/efi/boot1 zfs_module.c ufs_module.c

stand: Automated cleanup of cdefs and other formatting

Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/

Sponsored by:           Netflix

(cherry picked from commit 7c43148a974877188a930e4078a164f83da8e652)
DeltaFile
+0-7stand/i386/boot0/boot0.S
+1-1stand/efi/boot1/zfs_module.c
+1-1stand/efi/boot1/ufs_module.c
+0-1stand/common/ls.c
+0-1stand/common/reloc_elf.c
+0-1stand/common/self_reloc.c
+2-1270 files not shown
+2-8276 files

FreeBSD/src 5029119stand/forth menu-commands.4th, stand/lua core.lua core.lua.8

stand: Retire setting hw.ata.wc: it doesn't exist.

hw.ata.wc was disconnected as part ot the 2013 cam-ification of ata. No
need to continue setting it. It's been unused in FreeBSD 10.x and newer.

Sponsored by:           Netflix

(cherry picked from commit 67d2bd974d34d918255307321107273562f11dde)
DeltaFile
+0-2stand/lua/core.lua
+0-2stand/forth/menu-commands.4th
+0-1stand/lua/core.lua.8
+0-53 files

FreeBSD/src 05cf4ddstand/efi/loader main.c, stand/efi/loader/arch/amd64 elf64_freebsd.c

loader: fix EFI ACPI detection

lua was previously unable to determine ACPI presence because this
probing was postponed until the final loading and execution of the
kernel.

This patch resolves that by detecting ACPI early (similar to
the order of operations in the legacy i386 loader).

Reviewed by:    kevans
Approved by:    kp
Sponsored by:   Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D42459

(cherry picked from commit 0b01d45783c3ee5a544c882d1b147e4a60382c41)
DeltaFile
+1-53stand/efi/loader/arch/arm64/exec.c
+0-44stand/efi/loader/arch/amd64/elf64_freebsd.c
+42-0stand/efi/loader/main.c
+43-973 files

FreeBSD/src 9408d0b. UPDATING, stand/lua core.lua

stand: bandaide for acpi

Old binaries do not set acpi.rsdp early enough. So when we boot with an
older loader.efi from an ESP that's not been updated, we assume there's
no ACPI on this system. This is unwise. Put a band-aide on this until we
can implement a proper 'feature' variable that the binary reports so we
can do conditionals for things like this in the future.

This is at best a rapid-response stop-gap.

Glanced at by: kevans
Sponsored by:           Netflix

(cherry picked from commit 0abe05aeac29d99786401b9078e97dcead35f7f3)
DeltaFile
+11-0UPDATING
+6-1stand/lua/core.lua
+17-12 files

FreeBSD/src 16c09destand/lua core.lua core.lua.8

loader: improve lua ACPI detection and handling

This is a follow-up patch to https://reviews.freebsd.org/D42459
that modifies the loader lua to use the correct loader variables
for determining ACPI availability.

This also fixes a bug where ACPI can be inadvertently disabled when
setting System Defaults at the loader menu.

Reviewed by:    imp, kevans
Approved by:    kp
Sponsored by:   Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D42483

(cherry picked from commit e0f3dc82727f236b0bea495d8a4d6e6dc630854d)
DeltaFile
+15-24stand/lua/core.lua
+9-13stand/lua/core.lua.8
+1-1stand/lua/menu.lua
+25-383 files

FreeBSD/src 56b90f8stand/man loader.efi.8

loader.efi.8: Fix style warnings

This is a follow-up commit to bce728719e7f57272d99b6d039f10b4c636fa024
to address mandoc(1) warnings.

(cherry picked from commit 94eca4b5f38baa03446216f585089852d98c283a)
DeltaFile
+3-1stand/man/loader.efi.8
+3-11 files

FreeBSD/src ac0776estand/efi/include efi.h, stand/efi/include/amd64 efibind.h

stand/efi: Consolidate integer types

We have no need for 5 different copies of these.

Sponsored by:           Netflix
Reviewed by:            rcm, kevans, andrew
Differential Revision:  https://reviews.freebsd.org/D42699

(cherry picked from commit 7a1bc422d109a7cee56dcfbac616eda613c1c43e)
DeltaFile
+0-83stand/efi/include/i386/efibind.h
+0-83stand/efi/include/amd64/efibind.h
+0-76stand/efi/include/arm64/efibind.h
+0-76stand/efi/include/riscv/efibind.h
+0-35stand/efi/include/arm/efibind.h
+31-0stand/efi/include/efi.h
+31-3531 files not shown
+31-3547 files