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 strdup.c strcasecmp.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/strdup.c
+0-3stand/libsa/amd64/_setjmp.S
+0-3stand/libsa/strcasecmp.c
+0-3stand/libsa/inet_ntoa.c
+0-3stand/libsa/getopt.c
+0-2stand/libsa/stand.h
+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/efi/boot1 ufs_module.c zfs_module.c, stand/efi/fdt efi_fdt.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/ufs_module.c
+1-1stand/efi/boot1/zfs_module.c
+0-1stand/efi/boot1/boot1.c
+0-1stand/efi/boot1/proto.c
+0-1stand/efi/fdt/efi_fdt.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/forth/menu-commands.4th
+0-2stand/lua/core.lua
+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/amd64/efibind.h
+0-83stand/efi/include/i386/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

FreeBSD/src 58b95f5stand/efi/loader main.c

stand/efi: Request ACPI use the system inttypes

With the system inttypes, we build on all platforms again.

Suggested by:   andrew
Fixes:          0b01d45783c3
Sponsored by:   Netflix

(cherry picked from commit 488bc7e9a77763dde6919d3c83e57d1fc8175ca2)
DeltaFile
+1-0stand/efi/loader/main.c
+1-01 files

FreeBSD/src 82b2c7astand/man loader.efi.8

loader.efi.8: Fix a typo

MFC after:      3 days
Sponsored by:   Klara, Inc.

(cherry picked from commit 8ec79e8ae07d34a371eeb09329ad32993aecd906)
DeltaFile
+2-2stand/man/loader.efi.8
+2-21 files

FreeBSD/src beab67cstand/efi/loader main.c

stand/efi: Define ACPI_USE_SYSTEM_INTTYPES to be 1 instead of blank

To avoid a redefinition warning... This needs to be redone correctly,
but this gets amd64 building again...  My amd64 environment is polluted
with something that caues earlier failures which I ignored...

Fixes:          488bc7e9a777
Sponsored by:   Netflix

(cherry picked from commit e4789047ffd1319be337711ae4b6c594378f31b2)
DeltaFile
+1-1stand/efi/loader/main.c
+1-11 files

FreeBSD/src ebdd5d7stand/efi/loader main.c

stand/loader.efi: fix regression with ignoring nvstore

To read/update the boot loader nvstore, we always need to call
zfs_attach_nvstore() regardless of whether we use bootonce key
in nvstore or the bootfs property of the pool.  The call was
unintentionally left in the block of code that is processed
only when bootonce key is present.

In particular this fixes broken 'nextboot -k'.

Reviewed by:            imp
Differential Revision:  https://reviews.freebsd.org/D41795
Fixes:                  e3e2681d0ec28d6661fef6da76c9479049e2761c

(cherry picked from commit d13550f0c9c283e6bf7a2a3ec870f92a882c9f21)
DeltaFile
+1-1stand/efi/loader/main.c
+1-11 files

FreeBSD/src ba1b5e1lib/csu/aarch64 Makefile.depend, lib/csu/riscv Makefile.depend

dirdeps: Add missing dependency files

Some leaf directories were missing Makefile.depend files or needed
architecture-specific Makefile.depend.* files.

(cherry picked from commit e5b786625f7f82a1fa91e41823332459ea5550f9)
DeltaFile
+17-0stand/efi/loader/Makefile.depend.arm
+17-0stand/efi/loader/Makefile.depend.arm64
+14-0lib/liblua/Makefile.depend
+12-0stand/uboot/Makefile.depend
+11-0lib/csu/aarch64/Makefile.depend
+11-0lib/csu/riscv/Makefile.depend
+82-04 files not shown
+125-010 files

FreeBSD/src 25cf4c0stand/man loader.efi.8

Add paragraph documenting loader.env functionlity

Approved by:            docs (carlavilla)
Differential Revision:  https://reviews.freebsd.org/D42476

(cherry picked from commit bce728719e7f57272d99b6d039f10b4c636fa024)
DeltaFile
+8-0stand/man/loader.efi.8
+8-01 files

FreeBSD/src b5cd844stand/efi/loader Makefile.depend.riscv, stand/i386/loader Makefile.depend.options

loader: add target for dirdeps build

Update dependencies for the loader variations used for each
architecture.

Reviewed by:    sjg
Differential Revision:  https://reviews.freebsd.org/D39741

(cherry picked from commit 2008043f386721d58158e37e0d7e50df8095942d)
DeltaFile
+16-0stand/efi/loader/Makefile.depend.riscv
+12-0stand/powerpc/ofw/Makefile.depend
+11-0stand/i386/loader_lua/Makefile.depend
+10-0stand/lua/Makefile.depend
+10-0stand/i386/loader/Makefile.depend.options
+9-0stand/uboot/Makefile.depend.options
+68-019 files not shown
+133-925 files

FreeBSD/src 72eb6d6sys/dev/sound/pcm sndstat.c sound.c

sound: Move sndstat_prepare_pcm() to pcm/sndstat.c and remove sndstat_entry->handler

Since all sndstat_entry->handler fields point to sndstat_prepare_pcm(),
we can just call the function directly, without assigning it to a
function pointer and calling it indirectly.

While here, move sndstat_prepare_pcm() to pcm/sndstat.c, as it is more
suitable there.

No functional change intended.

Sponsored by:   The FreeBSD Foundation
MFC after:      2 weeks
Reviewed by:    dev_submerge.ch, markj
Differential Revision:  https://reviews.freebsd.org/D44571

(cherry picked from commit 9da3b645dbaaad724d524727d003fed7be05ff7c)
DeltaFile
+143-9sys/dev/sound/pcm/sndstat.c
+1-137sys/dev/sound/pcm/sound.c
+1-2sys/dev/sound/pcm/sound.h
+145-1483 files

FreeBSD/src 770e04econtrib/one-true-awk lib.c

awk: revert upstream's attempt to disallow hex strings

Upstream one-true-awk decided to disallow hex strings as numbers. This
is in line with awk's behavior prior to C99, and allowed by the POSIX
standard. The standard, however, allows them to be treated as numbers
because that's what the standard said in the 2001 through 2004 editions.
Since 2001, the nawk in FreeBSD has treated them as numbers, so restore
that behavior, allowed by prior standards, but not the latest POSIX
standard.

A number of scripts in the FreeBSD tree depend on this interpretation,
including scripts to build the kernel which had mysteriously started
failing for some people and not others. By re-allowing 0x hex numbers,
this fixes those scripts and restores POLA.

Upstream issue:         https://github.com/onetrueawk/awk/issues/126
Sponsored by:           Netflix
Reviewed by:            kevans
MFC After:              asap due to regression alrady merged to stable

    [8 lines not shown]
DeltaFile
+9-0contrib/one-true-awk/lib.c
+9-01 files

FreeBSD/src 605a006sys/netinet/tcp_stacks bbr.c

tcp bbr: improve code consistency

Improve code consistency with the RACK stack.
Reviewed by:            gallatin, rscheff
MFC after:              3 days
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D44800
DeltaFile
+3-3sys/netinet/tcp_stacks/bbr.c
+3-31 files

FreeBSD/src 3075939share/mk src.libnames.mk

src.libnames.mk: fix LIBPFCTL definition

Following the convention used in the rest of this file, ${LIBPFCTLDIR}
should refer to the directory, and ${LIBPFCTL} to the library itself.

Instead, both values were assigned to ${LIBPFCTL}, and ${LIBPFCTLDIR} was
not set at all.

This appears to be a simple typo and not a deliberate choice, so fix it
by assigning the directory name to ${LIBPFCTLDIR} instead.
DeltaFile
+1-1share/mk/src.libnames.mk
+1-11 files

FreeBSD/src 5d88a2asys/amd64/linux linux_proto.h, sys/amd64/linux32 linux32_proto.h

sysproto.h: sys/acl.h -> sys/types.h

In sysproto.h, stop including sys/acl.h as syscall defintions now use
__acl* types from sys/_types.h.  Add sys/types.h to provide types
previously provided by sys/param.h (via sys/acl.h).

Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D44467
DeltaFile
+1-1sys/tools/makesyscalls.lua
+1-1sys/arm64/linux/linux_proto.h
+1-1sys/amd64/linux/linux_proto.h
+1-1sys/compat/freebsd32/freebsd32_proto.h
+1-1sys/i386/linux/linux_proto.h
+1-1sys/amd64/linux32/linux32_proto.h
+6-61 files not shown
+7-77 files

FreeBSD/src dcda492sys/sys acl.h

sys/acl.h: reduce header pollution

In commit d1dfd921774f0 the acl allocator was switched from malloc(9) to
uma(9) and done in a way required vm/uma.h and prerequisites.  This added
considerable header pollution to sys/sysproto.h.  The uma details were
hidden in commit b998d381f2868, but the header pollution remained.  Add
less broad includes as required to keep the header self contained.

Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D44468
DeltaFile
+5-3sys/sys/acl.h
+5-31 files

FreeBSD/src 418b4c2lib/libc/posix1e acl_to_text.c

acl_to_text: include sys/param.h for MAXLOGNAME

Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D44474
DeltaFile
+1-1lib/libc/posix1e/acl_to_text.c
+1-11 files