FreeBSD/src 1719886sys/contrib/openzfs/config kernel-blkdev.m4, sys/contrib/openzfs/include/os/linux/spl/sys debug.h

zfs: merge openzfs/zfs at 90ba19eb7

Notable upstream pull request merges:
 #15784 90ba19eb7b Do no use .cfi_negate_ra_state within the assembly
                   on Arm64
 #15942 b6bbaa8372 Give a better message from 'zpool get' with invalid
                   pool name
 #15943 ca678bc0bc Makefile.bsd: sort and cleanup source file list
 #15953 fa480fe5ba zinject: show more device fault fields
 #15983 30c4eba4ea Fix panics when truncating/deleting files
 #15992 99741bde59 zvol: use multiple taskq
 #16015 a100a195fa Add support for zfs mount -R <filesystem>
 #16022 5e5fd0a178 Speculative prefetch for reordered requests
 #16040 997f85b4d3 L2ARC: Relax locking during write
 #16042 b12738182c Improve dbuf_read() error reporting
 #16051 a9a4290173 xdr: header cleanup
 #16052 eeca9a91d6 Fix read errors race after block cloning
 #16057 aa5445c28b Remove db_state DB_NOFILL checks from syncing context
 #16061 76d1dde94c zinject: inject device errors into ioctls

    [7 lines not shown]
DeltaFile
+413-0sys/contrib/openzfs/tests/zfs-tests/tests/functional/vdev_disk/page_alignment.c
+235-54sys/contrib/openzfs/module/zfs/dmu_zfetch.c
+136-83sys/contrib/openzfs/module/os/linux/zfs/vdev_disk.c
+101-93sys/contrib/openzfs/module/zfs/arc.c
+125-34sys/contrib/openzfs/config/kernel-blkdev.m4
+135-17sys/contrib/openzfs/include/os/linux/spl/sys/debug.h
+1,145-28178 files not shown
+2,505-89484 files

FreeBSD/src e4a0c92sys/net iflib.c

iflib: Correct indentation according to style(9)

The indentation style for the SYSCTL_* macros used was not matching KNF.

Reported by:    jhb
Differential Revision:  https://reviews.freebsd.org/D44811
DeltaFile
+135-142sys/net/iflib.c
+135-1421 files

FreeBSD/src d1fb333stand/efi/gptboot Makefile

stand: Install gptboot.efi(8)

We need to include bsd.init.mk first when we have man pages in the boot
loader.

Sponsored by:           Netflix

(cherry picked from commit cfcf475a669738382ac75ea50eb03a20280f7662)
DeltaFile
+1-0stand/efi/gptboot/Makefile
+1-01 files

FreeBSD/src e40703astand/efi/include efichar.h, stand/efi/libefi efichar.c

stand/efi: Changes to efichar to allow it to be used in the kernel

Replace malloc/free with EFICHAR_MALLOC and EFICHAR_FREEE macros.

Obtained from:  Juniper Networks, Inc.
Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D44541

(cherry picked from commit fe429e6794d322636e7c1e520d50ec0cb711dd14)
DeltaFile
+12-5stand/efi/libefi/efichar.c
+8-0stand/efi/include/efichar.h
+20-52 files

FreeBSD/src 41883f5stand/forth loader.4th

loader.4th dictthreshold too small

The dictthreshold in stand/forth/loader.4th is too small
resulting in full dictionary.

Reviewed by:    stevek, imp
Sponsored by:   Juniper Networks, Inc.
Differential Revision:  https://reviews.freebsd.org/D44414

(cherry picked from commit a8eb3b365eb63d2a569b166f2dfc982967d3a7fa)
DeltaFile
+2-2stand/forth/loader.4th
+2-21 files

FreeBSD/src 33d1ce8stand/userboot/userboot Makefile

userboot: allow for overriding the version file location

Use ?= when assigning VERSION_FILE

Reviewed by:    imp
Obtained from:  Juniper Networks, Inc.
Differential Revision:  https://reviews.freebsd.org/D44624

(cherry picked from commit 112783ebbc313f0df73bbec8520a94aba4a4f33d)
DeltaFile
+1-1stand/userboot/userboot/Makefile
+1-11 files

FreeBSD/src 519aef9stand/kboot/kboot hostfs.c

kboot: hostfs -- check for llseek failure correctly

The host_* syscalls are all raw Linux system calls, not the POSIX
wrappers that glibc / musl create. So we have to ranage change the
return value of host_llseek correctly to use the negative value hack
that all Linux system calls use.

This fixes a false positive error detection when we do something like
lseek(fd, 0xf1234567, ...); This returns 0xf1234567, which is a negative
value which used to trigger the error path.  Instead, we check using the
is_linux_error() and store the return value in a long. Translate that
errno to a host errno and set the global errno to that and return
-1. lseek can't otherwise return a negative number, since it's the
offset after seeking into the file, which by definition is positive.

This kept the 'read the UEFI memory map out of physical memory' from
working on aarch64 (whose boot loader falls back to reading it since
there are restrictive kernel options that can also prevent it), since
the physical address the memory map was at on my platform was like

    [6 lines not shown]
DeltaFile
+10-3stand/kboot/kboot/hostfs.c
+10-31 files

FreeBSD/src cb9ef3astand/kboot/kboot main.c

kboot: Use is_linux_error to check mmap return error

Rather than checking against the (incorrect) -511, use the
is_linux_error() function to check to see if host_mmap failed.

Sponsored by:           Netflix

(cherry picked from commit d75524b3fe21752b233f66ae8e9d6450d507f75c)
DeltaFile
+1-1stand/kboot/kboot/main.c
+1-11 files

FreeBSD/src d18377cstand/kboot/kboot hostfs.c

kboot: Avoid UB in signed shift

offset is signed. Copy it to the unsigned res before shifting. This
avoids any possible undefined behavior for right shifting signed
numbers. No functional change intended (and the code generated is the
nearly same for aarch64).

Sponsored by:           Netflix
Differential Revision:  https://reviews.freebsd.org/D44285

(cherry picked from commit 8b1925f29c54f5791db3c8dcdf2b67541bb8ab32)
DeltaFile
+3-2stand/kboot/kboot/hostfs.c
+3-21 files

FreeBSD/src d55ddcestand/kboot/kboot kbootfdt.c

kboot: kbootfdt: fix error handling

If we are able to open /sys/firmware/fdt, but aren't able to read it,
fall back to /proc/device-tree. Remove comment that's not really true,
it turns out.

Sponsored by:           Netflix

(cherry picked from commit 462af7676b3ee8a8bd9ee9b55a35c0cf815a351f)
DeltaFile
+6-7stand/kboot/kboot/kbootfdt.c
+6-71 files

FreeBSD/src 64355a9stand/lua config.lua

loader/lua: Remove workaround for command_error

loader.command_error was available prior to stable/12 branching. No need
to check if it is available or not.

Sponsored by:           Netflix
Reviewed by:            kevans
Differential Revision:  https://reviews.freebsd.org/D44144

(cherry picked from commit 552f3072af54820cf1805f712e2567bc1b7f046d)
DeltaFile
+1-6stand/lua/config.lua
+1-61 files

FreeBSD/src 83bae39stand/uboot Makefile

uboot/Makefile move BINDIR

Set BINDIR before we include bsd.init.mk
so we can override it via local.init.mk

Reviewed by:    imp
Sponsored by:   Juniper Networks, Inc.
Differential Revision:  https://reviews.freebsd.org/D44413

(cherry picked from commit 01f3abbfcd59848e37118e5e2b868a7b3e98cc62)
DeltaFile
+2-1stand/uboot/Makefile
+2-11 files

FreeBSD/src 0bca0destand/kboot/kboot/arch/aarch64 load_addr.c

kboot: Print UEFI memory map

If we can read the UEFI memory map, go ahead and print the memory map.
While the kernel prints this with bootverbose, having it at this stage
is useful for debugging other problems.

Sponsored by:           Netflix
Differential Revision:  https://reviews.freebsd.org/D44287

(cherry picked from commit a9cd3b675e243648aa681bc6ce1bf3e788be88c8)
DeltaFile
+85-0stand/kboot/kboot/arch/aarch64/load_addr.c
+85-01 files

FreeBSD/src 649cc35stand/kboot/include host_syscall.h

kboot: Create function for error checking.

Linux has the convention of returning -ERRNO to flag errors from its
system calls. Sometimes other negative values are returned that are
success...  However, only values -1 to -4096 (inclusive) are really
errors. The rest are either truncated values that only look negative (so
use long instead of int), or are things like addresses or legal unsigned
file offsets or similar that are successful returns. Filter out the
latter.

Sponsored by:           Netflix

(cherry picked from commit 3ae18fdfbcaad827defdc217386e73c993beeba0)
DeltaFile
+20-4stand/kboot/include/host_syscall.h
+20-41 files

FreeBSD/src 216c56fstand/lua core.lua

loader/lua: Remove compat shim for loader.lua_path

loader.lua_path was committed before stable/13 was branched, and merged
in to for 12.2. Remove workaround for it not being present.

Sponsored by:           Netflix
Reviewed by:            kevans
Differential Revision:  https://reviews.freebsd.org/D44143

(cherry picked from commit ab97d42addae97a389c6f22d6bba62ed954bb8e7)
DeltaFile
+1-7stand/lua/core.lua
+1-71 files

FreeBSD/src 7cc0ac5stand/efi/loader Makefile

loader/efi: Only include interpreter's linker script

For safety, only include the interpreter's linker script. Note that the
simple loader doesn't have one, but it's not an error to copy a ELF
section that does not exist. No functional change, however.

Sponsored by:           Netflix
Reviewed by:            tsoome, kevans
Differential Revision:  https://reviews.freebsd.org/D44064

(cherry picked from commit f5f08e41aa57f94e3c127a488a82b4e518781f89)
DeltaFile
+1-1stand/efi/loader/Makefile
+1-11 files

FreeBSD/src 36d49fbstand/efi/loader Makefile, stand/ficl ficl.h loader.c

loader/ficl: Rename the ficl compile set to X4th_compile_set

And upcoming change will need this set to be named this. Since it's only
used in the efi Makefile, and inside if ficl itself, the change should
be a nop.

Sponsored by:           Netflix
Reviewed by:            tsoome, kevans
Differential Revision:  https://reviews.freebsd.org/D44063

(cherry picked from commit 8ec8413faa3573c579d9e6361de904f8251b0c0e)
DeltaFile
+2-2stand/ficl/ficl.h
+1-1stand/ficl/loader.c
+1-1stand/efi/loader/Makefile
+4-43 files

FreeBSD/src 71969b9stand/lua cli.lua

loader/lua: Remove pager shim

Just after 12.2 and before the stable/13 branch, kevans added lpager.c
to provide a pager interface for commands written in lua.  It was merged
into 12.3. Now that 12.2 is long since EOL, we can remove the pager shim
here. Nobody needs that old loader + new lua scripts.  Plus only one
command is affected.

Sponsored by:           Netflix
Reviewed by:            kevans
Differential Revision:  https://reviews.freebsd.org/D44142

(cherry picked from commit 8b9178cd0d35ff2beafebdd51c8c44ba2b5aeb0f)
DeltaFile
+0-12stand/lua/cli.lua
+0-121 files

FreeBSD/src a552d40stand/ficl/mips sysdep.h sysdep.c, stand/ficl/mips64 sysdep.h sysdep.c

stand: Remove dangling mips references

Remove mips support files from ficl.

Sponsored by:           Netflix

(cherry picked from commit 07d600649ef804b9a492ba2d690f676f0513ae08)
DeltaFile
+0-431stand/ficl/mips/sysdep.h
+0-431stand/ficl/mips64/sysdep.h
+0-98stand/ficl/mips/sysdep.c
+0-98stand/ficl/mips64/sysdep.c
+0-1,0584 files

FreeBSD/src d9288e8stand/efi/loader main.c

loader/efi: Small diff reduction

Make doing the boot once protocol more similar to copies of this code.

Sponsored by:           Netflix
Reviewed by:            manu
Differential Revision:  https://reviews.freebsd.org/D44007

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

FreeBSD/src 5e85090stand/liblua lutils.c, stand/lua loader.lua.8

loader: Add loader.exit

Add loader.exit(status). While one can get alomst this behavior with
loader.perform("quit"), quit doesn't allow a value to be returned to the
firmware. The interpretation of 'status' is firmware specific. This can
be used when autobooting doesn't work in scripts, for example, to allow
the firmware to try something else...

Sponsored by:           Netflix

Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D44094

(cherry picked from commit 9398a495eb305d5bf240bc998ee2f6128d75f4ca)
DeltaFile
+12-4stand/liblua/lutils.c
+4-0stand/lua/loader.lua.8
+16-42 files

FreeBSD/src 95497a6stand/kboot/kboot/arch/aarch64 aarch64.ldscript ldscript.aarch64, stand/kboot/kboot/arch/amd64 ldscript.amd64 amd64.ldscript

kboot: Centralize ldscript addition

Make the pattern for ldscripts always be
arch/$MACHINE_ARCH/$MACHINE_ARCH.ldscript so we can add it from a
central Makefile. This also moves from ldscript.arch to arch.ldscript to
match the loader's new convention.

Sponsored by:           Netflix
Reviewed by:            tsoome, kevans
Differential Revision:  https://reviews.freebsd.org/D44057

(cherry picked from commit acb474c084b8e3b7bb738a286f9218f926a15823)
DeltaFile
+0-137stand/kboot/kboot/arch/powerpc64/ldscript.powerpc
+137-0stand/kboot/kboot/arch/powerpc64/powerpc64.ldscript
+71-0stand/kboot/kboot/arch/aarch64/aarch64.ldscript
+0-71stand/kboot/kboot/arch/amd64/ldscript.amd64
+0-71stand/kboot/kboot/arch/aarch64/ldscript.aarch64
+71-0stand/kboot/kboot/arch/amd64/amd64.ldscript
+279-2794 files not shown
+282-28510 files

FreeBSD/src 88ec6cestand/efi/loader Makefile, stand/liblua lutils.h

loader/efi: Use unique linker set for lua

After the linker set cleanup in ldscripts, there's now only one place we
need to know the linkerset name, so go ahead and change the lua
interpreter augmentation linker set to be uniquely named.

Sponsored by:           Netflix
Reviewed by:            tsoome, kevans
Differential Revision:  https://reviews.freebsd.org/D44062

(cherry picked from commit b4e85f760b6b77d276747c9beb6191bfb864e0c2)
DeltaFile
+4-3stand/liblua/lutils.h
+1-1stand/efi/loader/Makefile
+5-42 files

FreeBSD/src 204a5c8stand/common gfx_fb.c gfx_fb.h, stand/ficl gfx_loader.c

loader: rename gfx_interp_md to gfx_interp_ref

We have the call to gfx_interp_ref to bring in the .o so that we get the
linker set item to add the language bindings at the right time. Where we
call it is not the right time... So the _ref name is better. Change it
before we have too many others like it.

Sponsored by:           Netflix

(cherry picked from commit 6faf55c86d9b86f40de8d19970e42cb42a892c47)
DeltaFile
+1-1stand/common/gfx_fb.c
+1-1stand/common/gfx_fb.h
+1-1stand/common/interp_simple.c
+1-1stand/ficl/gfx_loader.c
+1-1stand/liblua/gfx_utils.c
+5-55 files

FreeBSD/src 851c8f5stand/kboot/kboot/arch/aarch64 aarch64.ldscript, stand/kboot/kboot/arch/amd64 amd64.ldscript

loader/kboot: simplify linker set inclusion a little

Linker set sections are included by default. No need to do so
explicitly.  These were bogusly copied from the efi ldscripts. They were
there due to a workaround introduced in 2002 by peter@ for a gcc
upgrade, but whatever bugs necessitated it were filed by 2010 when
rpaulo@ imported the i386 support (though they were copied even though
the objcopy retained them correctly, the gcc bug having been
fixed). They've never been needed.

Sponsored by:           Netflix
Reviewed by:            tsoome, kevans
Differential Revision:  https://reviews.freebsd.org/D44060

(cherry picked from commit ec6cbe468fb364a763fdea3a2803481624702cad)
DeltaFile
+0-11stand/kboot/kboot/arch/aarch64/aarch64.ldscript
+0-11stand/kboot/kboot/arch/amd64/amd64.ldscript
+0-222 files

FreeBSD/src 6cad882stand/efi/loader/arch/amd64 amd64.ldscript, stand/efi/loader/arch/arm arm.ldscript

loader/efi: Linker sets not needed.

We don't need linker sets listed as sections. They are explicitly
included in the objcopy we use to create the .efi file. This practice
was added in 2002 by peter@ in a6d81d83a280 to make ia64 builds
self-hosted. However, it was added back to the objcopy in 2010 by rpaulo
in 8df7a05edd36 for i386 EFI support, though the ldscript file then
retained them needlessly. The gcc/binutils bug having been fixed in the
interim. We've not needed them since then, but the redundancy didn't
matter.

Sponsored by:           Netflix
Reviewed by:            tsoome, kevans
Differential Revision:  https://reviews.freebsd.org/D44061

(cherry picked from commit d024bc7ff5e80537438b4556810782e9a8257b44)
DeltaFile
+0-11stand/efi/loader/arch/amd64/amd64.ldscript
+0-11stand/efi/loader/arch/arm64/arm64.ldscript
+0-11stand/efi/loader/arch/riscv/riscv.ldscript
+0-10stand/efi/loader/arch/arm/arm.ldscript
+0-434 files

FreeBSD/src 295ed27stand/uboot Makefile, stand/uboot/arch/arm ldscript.arm arm.ldscript

loader/uboot: Move to foo.ldconfig

Move to the foo.ldconfig convention to match the rest of the boot
loader. No functional change intended.

Sponsored by:           Netflix
Reviewed by:            tsoome, kevans
Differential Revision:  https://reviews.freebsd.org/D44059

(cherry picked from commit 3d6239d2449ee085a9a078c378659469fd69b135)
DeltaFile
+137-0stand/uboot/arch/powerpc/powerpc.ldscript
+0-137stand/uboot/arch/powerpc/ldscript.powerpc
+0-133stand/uboot/arch/arm/ldscript.arm
+133-0stand/uboot/arch/arm/arm.ldscript
+7-7stand/uboot/arch/arm/Makefile.inc
+1-1stand/uboot/Makefile
+278-2786 files

FreeBSD/src 36653c3stand/powerpc/ofw ldscript.powerpc ldscript.powerpcle

loader/powerpc: Share ldscript

Share ldscript between the different ppc versions. There's two different
scripts since we build 32-bit binaries for all types of powerpc, but
have little endian and big endian variations that are different by only
two lines. Set the output format and include the rest.

Move to foo.ldscript as well.

Sponsored by:           Netflix
Reviewed by:            tsoome, kevans
Differential Revision:  https://reviews.freebsd.org/D44058

(cherry picked from commit fe4ab1fdb0da06ddfbd8bf168db9f91b66609253)
DeltaFile
+0-142stand/powerpc/ofw/ldscript.powerpc
+0-142stand/powerpc/ofw/ldscript.powerpcle
+139-0stand/powerpc/ofw/ppc-common.ldscript
+1-5stand/powerpc/ofw/Makefile
+3-0stand/powerpc/ofw/powerpc64.ldscript
+3-0stand/powerpc/ofw/powerpc64le.ldscript
+146-2892 files not shown
+152-2898 files

FreeBSD/src 5f4d3f8stand/efi/loader/arch/amd64 amd64.ldscript ldscript.amd64, stand/efi/loader/arch/arm64 ldscript.arm64 arm64.ldscript

loader: Move ldscripts to match more standard practices

In the larger open source community, ld scripts are foo.ldscrpt rather
than ldscript.arch like we use here. This moves the EFI ldscripts.

Sponsored by:           Netflix
Reviewed by:            tsoome, kevans, emaste
Differential Revision:  https://reviews.freebsd.org/D44056

(cherry picked from commit 5b3b9a58584b101e3ea0fd8dd50dc8d9157c058e)
DeltaFile
+0-88stand/efi/loader/arch/arm64/ldscript.arm64
+88-0stand/efi/loader/arch/arm64/arm64.ldscript
+87-0stand/efi/loader/arch/riscv/riscv.ldscript
+0-87stand/efi/loader/arch/riscv/ldscript.riscv
+71-0stand/efi/loader/arch/amd64/amd64.ldscript
+0-71stand/efi/loader/arch/amd64/ldscript.amd64
+246-2464 files not shown
+314-31410 files

FreeBSD/src 7209dd3stand/kboot/kboot hostdisk.c

kboot: Implement write support for hostdisk

Don't assume that strategy is only called for read. Check the passed
flag for F_READ or F_WRITE and fail if it is neither. Open the disks for
writing and call host_read/host_write depending on that flag.

Sponsored by:           Netflix
Reviewed by:            kevans, gallatin
Differential Revision:  https://reviews.freebsd.org/D44016

(cherry picked from commit b3e76e3d9e2262c4b79e81e63e09bfe62c1f6baa)
DeltaFile
+8-7stand/kboot/kboot/hostdisk.c
+8-71 files