]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
3 years agoFix builds that set LD=ld.lld after r364761
arichardson [Wed, 26 Aug 2020 09:19:44 +0000 (09:19 +0000)]
Fix builds that set LD=ld.lld after r364761

When using relative paths for the linker we have to transform the name
since clang does not like -fuse-ld=ld.lld and instead requires -fuse-ld=lld
(the same also applies for ld.bfd).

3 years agoremove pragma ident lines
tsoome [Wed, 26 Aug 2020 07:29:17 +0000 (07:29 +0000)]
remove pragma ident lines

The #pragma ident is historical relict and not needed any more, this
pragma is actually unknown for common compilers and is only causing
trouble.

3 years agoremove left over empty directory
tsoome [Wed, 26 Aug 2020 07:00:07 +0000 (07:00 +0000)]
remove left over empty directory

364746 did leave empty directory around.

3 years agoApply a big hammer for stale pre-OpenZFS files
emaste [Wed, 26 Aug 2020 04:01:06 +0000 (04:01 +0000)]
Apply a big hammer for stale pre-OpenZFS files

-DNO_CLEAN builds have had trouble across the OpenZFS import.  It's not
worth the effort to try to address this with any granularity; instead,
just trigger on a .depend file indicating a tree from before the import,
and remove the whole cddl object tree.

Reviewed by: mmacy, kevans
Differential Revision: https://reviews.freebsd.org/D26189

3 years agodepend-cleanup.sh: add a note about removing old entries
emaste [Wed, 26 Aug 2020 03:41:29 +0000 (03:41 +0000)]
depend-cleanup.sh: add a note about removing old entries

3 years agogeli: use unmapped I/O
asomers [Wed, 26 Aug 2020 02:44:35 +0000 (02:44 +0000)]
geli: use unmapped I/O

Use unmapped I/O for geli. Unlike most geom providers, geli needs to
manipulate data on every read or write. Previously it would always map bios.

On my 16-core, dual socket server using geli atop md(4) devices, with 512B
sectors, this change increases geli IOPs by about 3x.

Note that geli still can't use unmapped I/O when data integrity verification
is enabled (but it could, with a little more work).  And it can't use
unmapped I/O in combination with ZFS, because ZFS uses mapped bios.

Reviewed by: markj, kib, jhb, mjg, mat, bcr (manpages)
MFC after: 1 week
Sponsored by: Axcient
Differential Revision: https://reviews.freebsd.org/D25671

3 years agocrypto(9): add CRYPTO_BUF_VMPAGE
asomers [Wed, 26 Aug 2020 02:37:42 +0000 (02:37 +0000)]
crypto(9): add CRYPTO_BUF_VMPAGE

crypto(9) functions can now be used on buffers composed of an array of
vm_page_t structures, such as those stored in an unmapped struct bio.  It
requires the running to kernel to support the direct memory map, so not all
architectures can use it.

Reviewed by: markj, kib, jhb, mjg, mat, bcr (manpages)
MFC after: 1 week
Sponsored by: Axcient
Differential Revision: https://reviews.freebsd.org/D25671

3 years agoarm64: Increase dmap size to 95 TiB
scottph [Wed, 26 Aug 2020 02:13:27 +0000 (02:13 +0000)]
arm64: Increase dmap size to 95 TiB

The Ampere Altra has physical memory populated sparsely within the
physical address space. Increase the size of the dmap to cover all
physical memory.

Reviewed by: andrew
Approved by: scottl (implicit)
MFC after: 1 week
Sponsored by: Ampere Computing, Inc.
Differential Revision: https://reviews.freebsd.org/D26134

3 years agoarm64/acpi: Give the real PA limit to ACPI
scottph [Wed, 26 Aug 2020 02:12:15 +0000 (02:12 +0000)]
arm64/acpi: Give the real PA limit to ACPI

Read PA bits from ID_AA64MMFR0_EL1.PARange.

Reviewed by: andrew, markj
Approved by: scottl (implicit)
MFC after: 1 week
Sponsored by: Ampere Computing, Inc.
Differential Revision: https://reviews.freebsd.org/D26133

3 years agobitset: add BIT_FFS_AT() for finding the first bit set greater than a start bit
scottph [Wed, 26 Aug 2020 02:07:46 +0000 (02:07 +0000)]
bitset: add BIT_FFS_AT() for finding the first bit set greater than a start bit

Reviewed by: kib
Approved by: scottl (implicit)
MFC after: 1 week
Sponsored by: Ampere Computing, Inc.
Differential Revision: https://reviews.freebsd.org/D26128

3 years agoefibootmgr: Add option to request booting to the firmware user interface
scottph [Wed, 26 Aug 2020 02:05:58 +0000 (02:05 +0000)]
efibootmgr: Add option to request booting to the firmware user interface

The OsIndications UEFI variable can request the firware to stop at
its UI instead of continuing with boot. Add flags for setting and
clearing this request.

Reviewed by: manu, bcr (manpages)
Approved by: scottl (implicit)
MFC after: 1 week
Sponsored by: Ampere Computing, Inc.
Differential Revision: https://reviews.freebsd.org/D25839

3 years agoarm64: Make local stores observable before sending IPIs
scottph [Wed, 26 Aug 2020 02:04:04 +0000 (02:04 +0000)]
arm64: Make local stores observable before sending IPIs

Add a synchronizing instruction to flush and wait until the local
CPU's writes are observable to other CPUs before sending IPIs.

This fixes an issue where recipient CPUs doing a rendezvous could
enter the rendezvous handling code before the initiator's writes
to the smp_rv_* variables were visible. This manifested as a
system hang, where a single CPU's increment of smp_rv_waiters[0]
actually happened "before" the initiator's zeroing of that field,
so all CPUs were stuck with the field appearing to be at
ncpus - 1.

Reviewed by: andrew, markj
Approved by: scottl (implicit)
MFC after: 1 week
Sponsored by: Ampere Computing, Inc.
Differential Revision: https://reviews.freebsd.org/D25798

3 years agoHandle jail.conf variables that have the same names as parameters.
jamie [Wed, 26 Aug 2020 00:42:59 +0000 (00:42 +0000)]
Handle jail.conf variables that have the same names as parameters.

PR: 248444
Submitted by: Akos Somfai
Reported by: Markus Stoff

3 years agodate.1: note possibly surprising behaviour of -j -f
emaste [Wed, 26 Aug 2020 00:31:59 +0000 (00:31 +0000)]
date.1: note possibly surprising behaviour of -j -f

PR: 248918
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

3 years agoZFS: band-aid for -DNO_CLEAN
mmacy [Tue, 25 Aug 2020 23:35:55 +0000 (23:35 +0000)]
ZFS:  band-aid for -DNO_CLEAN

Submitted by: Neal Chauhan
Approved by: imp@
Differential Revision: https://reviews.freebsd.org/D26183

3 years agoZFS: whitelist zstd and encryption in the loader
mmacy [Tue, 25 Aug 2020 23:26:52 +0000 (23:26 +0000)]
ZFS: whitelist zstd and encryption in the loader

Please note that neither zstd nor encryption is
supported by the loader at this instant. This
change makes it safe to use those features in
one's root pool, but not in one's root dataset.

3 years agovm_pageout: Scale worker threads with CPUs
cem [Tue, 25 Aug 2020 21:36:56 +0000 (21:36 +0000)]
vm_pageout: Scale worker threads with CPUs

Autoscale vm_pageout worker threads from r364129 with CPU count.  The
default is arbitrarily chosen to be 16 CPUs per worker thread, but can
be adjusted with the vm.pageout_cpus_per_thread tunable.

There will never be less than 1 thread per populated NUMA domain, and
the previous arbitrary upper limit (at most ncpus/2 threads per NUMA
domain) is preserved.

Care is taken to gracefully handle asymmetric NUMA nodes, such as empty
node systems (e.g., AMD 2990WX) and systems with nodes of varying size
(e.g., some larger >20 core Intel Haswell/Broadwell Xeon).

Reviewed by: kib, markj
Sponsored by: Isilon
Differential Revision: https://reviews.freebsd.org/D26152

3 years agobsdinstall: Update loader.conf for new OpenZFS deps
freqlabs [Tue, 25 Aug 2020 21:07:27 +0000 (21:07 +0000)]
bsdinstall: Update loader.conf for new OpenZFS deps

zfs.ko now includes the SPL but relies on cryptodev instead.

Reported by: D Scott Phillips
Sponsored by: iXsystems, Inc.

3 years agoAfter r364423, which ensures the callbacks that dl_iterate_phdr(3)
dim [Tue, 25 Aug 2020 20:07:11 +0000 (20:07 +0000)]
After r364423, which ensures the callbacks that dl_iterate_phdr(3)
performs are protected by an exclusive lock, even for statically linked
programs, it is safe to re-enable libunwind's FrameHeaderCache, which I
temporarily disabled in r364263.

Meanwhile upstream has also used the _LIBUNWIND_USE_FRAME_HEADER_CACHE
for this purpose, so the only thing needed is to add this as a
compile-time command line flag.

While here, reformat the CFLAGS lines a little bit.

MFC after: 6 weeks
X-MFC-With: r364284, r364423

3 years agoSkip zpool_clear_005_pos test until bug fixed
freqlabs [Tue, 25 Aug 2020 20:04:35 +0000 (20:04 +0000)]
Skip zpool_clear_005_pos test until bug fixed

Messing with gnop devices under a zpool fails in this test, causing
the pool to be suspended and eventually the system to deadlock.

Skip the test for now until the issue is resolved.

PR: tests/248910
Discussed with: lwhsu
Sponsored by: iXsystems, Inc.

3 years agoAfter r364753, there should be no need to suppress -Watomic-alignment
dim [Tue, 25 Aug 2020 19:57:11 +0000 (19:57 +0000)]
After r364753, there should be no need to suppress -Watomic-alignment
warnings anymore for compiler-rt's atomic.c. This occurred because the
IS_LOCK_FREE_8 macro was not correctly defined to 0 for mips, and this
caused the compiler to emit a runtime call to __atomic_is_lock_free(),
and that triggers the warning.

MFC after: 2 weeks
X-MFC-With: r364753

3 years ago[PowerPC] More preemptive powerpcspe ZFS build fixes
bdragon [Tue, 25 Aug 2020 19:04:54 +0000 (19:04 +0000)]
[PowerPC] More preemptive powerpcspe ZFS build fixes

I went through the merge and found the rest of the instances where
${MACHINE_ARCH} == "powerpc" was being used to detect 32-bit and adjusted
the rest of the instances to also check for powerpcspe.

mips32* will probably want to do the same.

Sponsored by: Tag1 Consulting, Inc.

3 years ago[PowerPC] Apply the ppc32 GOT overflow fix to powerpcspe
bdragon [Tue, 25 Aug 2020 18:54:10 +0000 (18:54 +0000)]
[PowerPC] Apply the ppc32 GOT overflow fix to powerpcspe

powerpcspe is also a 32 bit ppc platform, and also needs to be -fPIC to
avoid overflowing the GOT.

Sponsored by: Tag1 Consulting, Inc.

3 years agosdhci(4): Recognize the Texas Instruments PCIxx12 card reader.
markj [Tue, 25 Aug 2020 18:32:43 +0000 (18:32 +0000)]
sdhci(4): Recognize the Texas Instruments PCIxx12 card reader.

PR: 248650
Submitted by: Lars Herschke <lhersch@dssgmbh.de>
MFC after: 1 week

3 years agoFix the current working directory when setting GITREV and
gjb [Tue, 25 Aug 2020 18:30:12 +0000 (18:30 +0000)]
Fix the current working directory when setting GITREV and
GITBRANCH.

Sponsored by: Rubicon Communications, LLC (netgate.com)

3 years agoFix zstd in OpenZFS module with CPUTYPE?=<something with BMI>
freqlabs [Tue, 25 Aug 2020 18:22:30 +0000 (18:22 +0000)]
Fix zstd in OpenZFS module with CPUTYPE?=<something with BMI>

The build breaks when something adds -march=<something with BMI> to the
compiler flags, for example CPUTYPE?=native.  When the arch supports BMI,
__BMI__ is defined and zstd.c tries to include immintrin.h, which is not
present when building the kernel.

Disable experimental BMI intrinsics in zstd in the OpenZFS kernel module
by explicitly undefining __BMI__ for zstd.c.

A similar fix was needed for the original zstd import, done in r327738.

Reported by: Jakob Alvermark
Discussed with: mmacy
Sponsored by: iXsystems, Inc.

3 years agolibbe: lift the WARNS post-OpenZFS merge
kevans [Tue, 25 Aug 2020 18:16:40 +0000 (18:16 +0000)]
libbe: lift the WARNS post-OpenZFS merge

sys/ccompile.h no longer uses #pragma ident, so we no longer need to worry
about unknown pragmas.

I fixed one WARNS issue in r363409 by annotating be_is_auto_snapshot_name's
lbh parameter __unused, then upstreamed the following changes to OpenZFS
that rode in with the merge:
- zfs_path_to_zhandle now takes a const char *path rather than a char *path,
  since it won't be mutating the string it receives and I had no reason to
  believe it will need to in the future. [OpenZFS PR #10605]
- Annotated some unused parameters on definitions inlined into headers as
  such. [OpenZFS PR #10606]

3 years agoFix userboot after r364355
mmacy [Tue, 25 Aug 2020 17:23:33 +0000 (17:23 +0000)]
Fix userboot after r364355

r364355 replaced init_zfs_bootenv with init_zfs_boot_options and
neglected to update userboot in the process.

3 years agoGive stronger guidance with regards to upgrading root pools
mmacy [Tue, 25 Aug 2020 17:19:15 +0000 (17:19 +0000)]
Give stronger guidance with regards to upgrading root pools

3 years agortsol(d): add script for "M bit"
bz [Tue, 25 Aug 2020 16:09:23 +0000 (16:09 +0000)]
rtsol(d): add script for "M bit"

While we do support the "O bit" running a script (usually to start a
dhcpv6 client) we have no options for setups which set the "M bit" for,
e.g., static address assignment as in EC2.

Duplicate most of the "O bit" logic to also start a script for the
"M bit" with the one difference: if the "M bit" is set we will not
start the script for the "O bit" as well (per RFC 4861, Section 4.2).

Reviewed by: hrs, markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D26099

3 years agoiflib: netmap: publish all the receive buffer
vmaffione [Tue, 25 Aug 2020 15:19:45 +0000 (15:19 +0000)]
iflib: netmap: publish all the receive buffer

At initialization time, the netmap RX refill function used to
prepare the NIC RX ring with N-1 buffers rather than N (with
N equal to the number of descriptors in the NIC RX ring).
This is not how netmap is supposed to work, as it would keep
kring->nr_hwcur not in sync with the NIC "next index to refill"
(i.e., fl->ifl_pidx). Instead we prepare N buffers, although we
still publish (with isc_rxd_flush()) only the first N-1 buffers,
to avoid the NIC producer pointer to overrun the NIC consumer
pointer (for NICs where this is a real issue, e.g. Intel ones).

MFC after: 2 weeks

3 years agovfs: respect PRIV_VFS_LOOKUP in vaccess_smr
mjg [Tue, 25 Aug 2020 14:18:50 +0000 (14:18 +0000)]
vfs: respect PRIV_VFS_LOOKUP in vaccess_smr

Reported by: novel

3 years agoPermit vm_page_wire() to be called on pages not belonging to an object.
markj [Tue, 25 Aug 2020 13:45:06 +0000 (13:45 +0000)]
Permit vm_page_wire() to be called on pages not belonging to an object.

For such pages ref_count is effectively a consumer-managed field, but
there is no harm in calling vm_page_wire() on them.
vm_page_unwire_noq() handles them as well.  Relax the vm_page_wire()
assertions to permit this case which is triggered by some out-of-tree
code. [1]

Also guard a conditional assertion with INVARIANTS.  Otherwise the
conditions are evaluated even though the result is unused. [2]

Reported by: bz, cem [1], kib [2]
Reviewed by: dougm, kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D26173

3 years agoFix -Wundef warnings when building liblua
arichardson [Tue, 25 Aug 2020 13:30:34 +0000 (13:30 +0000)]
Fix -Wundef warnings when building liblua

We need to define the LUA_FLOAT_INT64 macro even if we don't use it (copied
from stand/luaconf.h). While touching luaconf.h.dist also sync it with the
the 5.3.5 release version (matches the one in lib/liblua).

Reviewed By: kevans
Differential Revision: https://reviews.freebsd.org/D25977

3 years agostyle.Makefile: list CSTD between WARNS and CFLAGS
arichardson [Tue, 25 Aug 2020 13:30:29 +0000 (13:30 +0000)]
style.Makefile: list CSTD between WARNS and CFLAGS

This was suggested by emaste in https://reviews.freebsd.org/D25928 and
matches most uses in the tree.

3 years agoFix makefs bootstrap on macOS after D25563
arichardson [Tue, 25 Aug 2020 13:30:24 +0000 (13:30 +0000)]
Fix makefs bootstrap on macOS after D25563

The macOS assert.h header does not define static_assert when compiling in
C99 mode. To fix this compile with -std=c11.

Reviewed By: emaste
Differential Revision: https://reviews.freebsd.org/D25928

3 years agoFix typo in r364325 that broke tinderbox with -DBUILD_WITH_STRICT_TMPPATH
arichardson [Tue, 25 Aug 2020 13:30:19 +0000 (13:30 +0000)]
Fix typo in r364325 that broke tinderbox with -DBUILD_WITH_STRICT_TMPPATH

${TARGET_ARCH} is empty here which results in empy MAKE_PARAMS being
passed to the buildkernel phase. This breaks the build when using the
strict TMPPATH since cc will not be included in $PATH.

Reviewed By: jhb

3 years agoUse bootstrapped install(1) install of tools/install.sh in world stage
arichardson [Tue, 25 Aug 2020 13:30:14 +0000 (13:30 +0000)]
Use bootstrapped install(1) install of tools/install.sh in world stage

This should be noticeably faster due to fewer processes being forked and
also handles other flags such as -S or writing to METALOG.

Reviewed By: brooks
Differential Revision: https://reviews.freebsd.org/D26039

3 years agoFix running the builddtb target on a noexec file system
arichardson [Tue, 25 Aug 2020 13:30:09 +0000 (13:30 +0000)]
Fix running the builddtb target on a noexec file system

Obtained from: CheriBSD

3 years agoPass -fuse-ld=/path/to/ld if ${LD} != "ld"
arichardson [Tue, 25 Aug 2020 13:30:03 +0000 (13:30 +0000)]
Pass -fuse-ld=/path/to/ld if ${LD} != "ld"

This is needed so that setting LD/XLD is not ignored when linking with $CC
instead of directly using $LD. Currently only clang accepts an absolute
path for -fuse-ld= (Clang 12+ will add a new --ld-path flag), so we now
warn when building with GCC and $LD != "ld" since that might result in the
wrong linker being used.

We have been setting XLD=/path/to/cheri/ld.lld in CheriBSD for a long time and
used a similar version of this patch to avoid linking with /usr/bin/ld.
This change is also required when building FreeBSD on an Ubuntu with Clang:
In that case we set XCC=/usr/lib/llvm-10/bin/clang and since
/usr/lib/llvm-10/bin/ does not contain a "ld" binary the build fails with
`clang: error: unable to execute command: Executable "ld" doesn't exist!`
unless we pass -fuse-ld=/usr/lib/llvm-10/bin/ld.lld.

This change passes -fuse-ld instead of copying ${XLD} to WOLRDTMP/bin/ld
since then we would have to ensure that this file does not exist while
building the bootstrap tools. The cross-linker might not be compatible with
the host linker (e.g. when building on macos: host-linker= Mach-O /usr/bin/ld,
cross-linker=LLVM ld.lld).

Reviewed By: brooks, emaste
Differential Revision: https://reviews.freebsd.org/D26055

3 years agoAdd necessary Makefile.inc1 infrastructure for building on non-FreeBSD
arichardson [Tue, 25 Aug 2020 13:29:57 +0000 (13:29 +0000)]
Add necessary Makefile.inc1 infrastructure for building on non-FreeBSD

The most awkward bit in this patch is the bootstrapping of m4:
We can't simply use the host version of m4 since that is not compatible
with the flags passed by lex (at least on macOS, possibly also on Linux).
Therefore we need to bootstrap m4, but lex needs m4 to build and m4 also
depends on lex (which needs m4 to generate any files). To work around this
cyclic dependency we can build a bootstrap version of m4 (with pre-generated
files) then use that to build the real m4.

This patch also changes the xz/unxz/dd tools to always use the host version
since the version in the source tree cannot easily be bootstrapped on macOS
or Linux.

Reviewed By: brooks, imp (earlier version)
Differential Revision: https://reviews.freebsd.org/D25992

3 years agoAdd missing FreeBSD functions to -legacy when building on macOS/Linux
arichardson [Tue, 25 Aug 2020 13:23:31 +0000 (13:23 +0000)]
Add missing FreeBSD functions to -legacy when building on macOS/Linux

In most cases this simply builds the file from lib/libc for missing
functions (e.g. strlcpy on Linux etc.). In cases where this is not possible
I've added an implementation to tools/build/cross-build.

The fgetln.c/fgetwln.c/closefrom.c compatibility code was obtained from
https://gitlab.freedesktop.org/libbsd/libbsd, but I'm not sure it makes
sense to import it into to contrib just for these three bootstrap files.

Reviewed By: brooks
Differential Revision: https://reviews.freebsd.org/D25978

3 years agoAdd mlx5en(4) to the list of supported netdump network drivers.
hselasky [Tue, 25 Aug 2020 13:21:49 +0000 (13:21 +0000)]
Add mlx5en(4) to the list of supported netdump network drivers.

MFC after: 1 week
Sponsored by: Mellanox Technologies

3 years agoAdd Linux/macOS compatibility system headers to tools/build/cross-build
arichardson [Tue, 25 Aug 2020 13:18:53 +0000 (13:18 +0000)]
Add Linux/macOS compatibility system headers to tools/build/cross-build

These headers are required in order to build the bootstrap tools on macOS
and Linux. A follow-up commit will add implementations of functions that
don't exist on those operating systems to -legacy when bootstrapping.

Reviewed By: brooks
Differential Revision: https://reviews.freebsd.org/D14316

3 years agoRFC 3465 defines a limit L used in TCP slow start for limiting the number
tuexen [Tue, 25 Aug 2020 09:42:03 +0000 (09:42 +0000)]
RFC 3465 defines a limit L used in TCP slow start for limiting the number
of acked bytes as described in Section 2.2 of that document.
This patch ensures that this limit is not also applied in congestion
avoidance. Applying this limit also in congestion avoidance can result in
using less bandwidth than allowed.

Reported by: l.tian.email@gmail.com
Reviewed by: rrs, rscheff
MFC after: 3 days
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D26120

3 years agoAdd atomic and bswap functions to libcompiler_rt
dim [Tue, 25 Aug 2020 06:49:10 +0000 (06:49 +0000)]
Add atomic and bswap functions to libcompiler_rt

There have been several mentions on our mailing lists about missing
atomic functions in our system libraries (e.g. __atomic_load_8 and
friends), and recently I saw __bswapdi2 and __bswapsi2 mentioned too.

To address this, add implementations for the functions from compiler-rt
to the system compiler support libraries, e.g. libcompiler_rt.a and and
libgcc_s.so.

This also needs a small fixup in compiler-rt's atomic.c, to ensure that
32-bit mips can build correctly.

Bump __FreeBSD_version to make it easier for port maintainers to detect
when these functions were added.

MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D26159

3 years agoFix libzfs build failures for some
mmacy [Tue, 25 Aug 2020 03:43:52 +0000 (03:43 +0000)]
Fix libzfs build failures for some

In some environments adding zstd/include to the include path
would cause zstd's stdlib.h to hide the system one.

3 years agoMention OpenZFS merge in UPDATING
mmacy [Tue, 25 Aug 2020 02:42:48 +0000 (02:42 +0000)]
Mention OpenZFS merge in UPDATING

3 years agoBump __FreeBSD_version for OpenZFS switchover
mmacy [Tue, 25 Aug 2020 02:22:49 +0000 (02:22 +0000)]
Bump __FreeBSD_version for OpenZFS switchover

3 years agoMerge OpenZFS support in to HEAD.
mmacy [Tue, 25 Aug 2020 02:21:27 +0000 (02:21 +0000)]
Merge OpenZFS support in to HEAD.

The primary benefit is maintaining a completely shared
code base with the community allowing FreeBSD to receive
new features sooner and with less effort.

I would advise against doing 'zpool upgrade'
or creating indispensable pools using new
features until this change has had a month+
to soak.

Work on merging FreeBSD support in to what was
at the time "ZFS on Linux" began in August 2018.
I first publicly proposed transitioning FreeBSD
to (new) OpenZFS on December 18th, 2018. FreeBSD
support in OpenZFS was finally completed in December
2019. A CFT for downstreaming OpenZFS support in
to FreeBSD was first issued on July 8th. All issues
that were reported have been addressed or, for
a couple of less critical matters there are
pull requests in progress with OpenZFS. iXsystems
has tested and dogfooded extensively internally.
The TrueNAS 12 release is based on OpenZFS with
some additional features that have not yet made
it upstream.

Improvements include:
  project quotas, encrypted datasets,
  allocation classes, vectorized raidz,
  vectorized checksums, various command line
  improvements, zstd compression.

Thanks to those who have helped along the way:
Ryan Moeller, Allan Jude, Zack Welch, and many
others.

Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D25872

3 years agoFix hangs with processes stuck sleeping on btalloc on i386.
rmacklem [Tue, 25 Aug 2020 00:58:14 +0000 (00:58 +0000)]
Fix hangs with processes stuck sleeping on btalloc on i386.

r358097 introduced a problem for i386, where kernel builds will intermittently
get hung, typically with many processes sleeping on "btalloc".
I know nothing about VM, but received assistance from rlibby@ and markj@.

rlibby@ stated the following:
   It looks like the problem is that
   for systems that do not have UMA_MD_SMALL_ALLOC, we do
           uma_zone_set_allocf(vmem_bt_zone, vmem_bt_alloc);
   but we haven't set an appropriate free function.  This is probably why
   UMA_ZONE_NOFREE was originally there.  When NOFREE was removed, it was
   appropriate for systems with uma_small_alloc.

   So by default we get page_free as our free function.  That calls
   kmem_free, which calls vmem_free ... but we do our allocs with
   vmem_xalloc.  I'm not positive, but I think the problem is that in
   effect we vmem_xalloc -> vmem_free, not vmem_xfree.

   Three possible fixes:
    1: The one you tested, but this is not best for systems with
       uma_small_alloc.
    2: Pass UMA_ZONE_NOFREE conditional on UMA_MD_SMALL_ALLOC.
    3: Actually provide an appropriate vmem_bt_free function.

   I think we should just do option 2 with a comment, it's simple and it's
   what we used to do.  I'm not sure how much benefit we would see from
   option 3, but it's more work.

This patch implements #2. I haven't done a comment, since I don't know
what the problem is.

markj@ noted the following:
   I think the suggested patch is ok, but not for the reason stated.
   On platforms without a direct map the problem is:
   to allocate btags we need a slab,
   and to allocate a slab we need to map a page, and to map a page we need
   to allocate btags.

   We handle this recursion using a custom slab allocator which specifies
   M_USE_RESERVE, allowing it to dip into a reserve of free btags.
   Because the returned slab can be used to keep the reserve populated,
   this ensures that there are always enough free btags available to
   handle the recursion.

   UMA_ZONE_NOFREE ensures that we never reclaim free slabs from the zone.
   However, when it was removed, an apparent bug in UMA was exposed:
   keg_drain() ignores the reservation set by uma_zone_reserve()
   in vmem_startup().
   So under memory pressure we reclaim the free btags that are needed to
   break the recursion.
   That's why adding _NOFREE back fixes the problem: it disables the
   reclamation.

   We could perhaps fix it more cleverly, by modifying keg_drain() to always
   leave uk_reserve slabs available.

markj@'s initial patch failed testing, so committing this patch was agreed
upon as the interim solution.
Either rlibby@ or markj@ might choose to add a comment to it.

PR: 248008
Reviewed by: rlibby, markj

3 years agoInitial import from vendor-sys branch of openzfs
mmacy [Mon, 24 Aug 2020 23:31:26 +0000 (23:31 +0000)]
Initial import from vendor-sys branch of openzfs

3 years agodrm2: Update deprecation message
zeising [Mon, 24 Aug 2020 22:53:23 +0000 (22:53 +0000)]
drm2: Update deprecation message

Update the deprecation message in the drm2 (aka legacy drm) drivers to point
towards the graphics/drm-kmod ports for all architectures, not just amd64.
drm-kmod has support for more architectures these days, and the
graphics/drm-legacy-kmod port is being deprecated.

Approved by: imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D26174

3 years agoVendor import of openzfs master @ 184df27eef0abdc7ab2105b21257f753834b936b
mmacy [Mon, 24 Aug 2020 22:48:19 +0000 (22:48 +0000)]
Vendor import of openzfs master @ 184df27eef0abdc7ab2105b21257f753834b936b

Sponsored by: iX Systems, Inc.

3 years agoRestore workaround for sysret fault on non-canonical address after LA57.
kib [Mon, 24 Aug 2020 22:12:45 +0000 (22:12 +0000)]
Restore workaround for sysret fault on non-canonical address after LA57.

Sponsored by: The FreeBSD Foundation

3 years agoAfter r364732, we can now enable MK_OPENMP for aarch64 by default.
dim [Mon, 24 Aug 2020 20:40:26 +0000 (20:40 +0000)]
After r364732, we can now enable MK_OPENMP for aarch64 by default.

PR: 248864
MFC after: 2 weeks

3 years agoMerge commit cde8f4c16 from llvm git (by me):
dim [Mon, 24 Aug 2020 20:37:18 +0000 (20:37 +0000)]
Merge commit cde8f4c16 from llvm git (by me):

  Move special va_list handling to kmp_os.h

  Instead of copying and pasting the same #ifdef expressions in
  multiple places, define a type and a pair of macros in kmp_os.h, to
  handle whether va_list is pointer-like or not:

  * kmp_va_list is the type to use for __kmp_fork_call()
  * kmp_va_deref() dereferences a va_list, if necessary
  * kmp_va_addr_of() takes the address of a va_list, if necessary

  Also add FreeBSD to the list of OSes that has a non pointer-like
  va_list. This can now be easily extended to other OSes too.

  Reviewed By: AndreyChurbanov

  Differential Revision: https://reviews.llvm.org/D86397

This should enable building of LLVM's OpenMP on AArch64. Addition to
share/mk will follow in a subsequent commit.

PR: 248864
MFC after: 2 weeks

3 years agonetmap: use FreeBSD guards for epoch calls
vmaffione [Mon, 24 Aug 2020 20:28:21 +0000 (20:28 +0000)]
netmap: use FreeBSD guards for epoch calls

EPOCH calls are FreeBSD specific. Use guards to protect these, so
that the code can compile under Linux.

MFC after: 1 week

3 years agoRemove RT_LOCK mutex from rte.
melifaro [Mon, 24 Aug 2020 20:23:34 +0000 (20:23 +0000)]
Remove RT_LOCK mutex from rte.

rtentry lock traditionally served 2 purposed: first was protecting refcounts,
 the second was assuring consistent field access/changes.
Since route nexthop introduction, the need for the former disappeared and
 the need for the latter reduced.
To be more precise, the following rte field are mutable:

rt_nhop (nexthop pointer, updated with RIB_WLOCK, passed in rib_cmd_info)
rte_flags (only RTF_HOST and RTF_UP, where RTF_UP gets changed at rte removal)
rt_weight (relative weight, updated with RIB_WLOCK, passed in rib_cmd_info)
rt_expire (time when rte deletion is scheduled, updated with RIB_WLOCK)
rt_chain (deletion chain pointer, updated with RIB_WLOCK)
All of them are updated under RIB_WLOCK, so the only remaining concern is the reading.

rt_nhop and rt_weight (addressed in this review) are read under rib lock and
 stored in the rib_cmd_info, so the caller has no problem with consitency.
rte_flags is currently read unlocked in rtsock reporting (however the scope
 is only RTF_UP flag, which is pretty static).
rt_expire is currently read unlocked in rtsock reporting.
rt_chain accesses are safe, as this is only used at route deletion.

rt_expire and rte_flags reads will be dealt in a separate reviews soon.

Differential Revision: https://reviews.freebsd.org/D26162

3 years agoFix silly typo...
imp [Mon, 24 Aug 2020 20:02:13 +0000 (20:02 +0000)]
Fix silly typo...

3 years agoDocument devd event change from r364725
imp [Mon, 24 Aug 2020 19:49:22 +0000 (19:49 +0000)]
Document devd event change from r364725

3 years agoDocument the kern -> kernel name change for resume events.
imp [Mon, 24 Aug 2020 19:35:27 +0000 (19:35 +0000)]
Document the kern -> kernel name change for resume events.

MFC After: 3 days

3 years agoChange the resume notification event from 'kern' to 'kernel'
imp [Mon, 24 Aug 2020 19:35:15 +0000 (19:35 +0000)]
Change the resume notification event from 'kern' to 'kernel'

We have both a system of 'kern' and of 'kernel'. Prefer the latter and
convert this notification to use 'kernel' instead of 'kern'. As a
transition period, continue to also generate the 'kern' notification
until sometime after FreeBSD 13 is branched.

MFC After: 3 days

3 years agoRemove an escape that does not belong.
gjb [Mon, 24 Aug 2020 19:00:57 +0000 (19:00 +0000)]
Remove an escape that does not belong.

Sponsored by: Rubicon Communications, LLC (netgate.com)

3 years agocache: remove leftover assert in vn_fullpath_any_smr
mjg [Mon, 24 Aug 2020 18:23:58 +0000 (18:23 +0000)]
cache: remove leftover assert in vn_fullpath_any_smr

It is only valid when !slash_prefixed. For slash_prefixed the length
is properly accounted for later.

Reported by: markj (syzkaller)

3 years agoUpdate unbound version number.
cy [Mon, 24 Aug 2020 18:17:13 +0000 (18:17 +0000)]
Update unbound version number.

MFC after: 1 month
X-MFC with: r364721

3 years agoMFV 364468:
cy [Mon, 24 Aug 2020 18:14:04 +0000 (18:14 +0000)]
MFV 364468:

Update unbound 1.10.1 --> 1.11.0.

MFH: 1 month

3 years agoMFV 364467:
cy [Mon, 24 Aug 2020 18:13:44 +0000 (18:13 +0000)]
MFV 364467:

Update sqlite to 3.33.0 (3330000).

Release announcement at https://www.sqlite.org/releaselog/3_33_0.html.

MFC after: 1 month

3 years agow(1): Add EXAMPLES to man page
fernape [Mon, 24 Aug 2020 17:57:08 +0000 (17:57 +0000)]
w(1): Add EXAMPLES to man page

Add small example section showing general use and -d and -h flags

Approved by: manpages (bcr@)
Differential Revision: https://reviews.freebsd.org/D26172

3 years agoMerge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
dim [Mon, 24 Aug 2020 17:43:23 +0000 (17:43 +0000)]
Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
release/11.x llvmorg-11.0.0-rc2-0-g414f32a9e86.

MFC after: 6 weeks
X-MFC-With: r364284

3 years agoIn the endless batch mode (-B), terminate if and when stdout is closed.
sobomax [Mon, 24 Aug 2020 16:45:23 +0000 (16:45 +0000)]
In the endless batch mode (-B), terminate if and when stdout is closed.
That mode is useful to call gstat from other app, however kinda useless
since gstat won't exit and stay running forever when its parent process
has long gone.

MFC after: 2 weeks

3 years agoWhen copying over the binaries, use '-p' to preserve date/time
imp [Mon, 24 Aug 2020 16:06:11 +0000 (16:06 +0000)]
When copying over the binaries, use '-p' to preserve date/time

Although I can't reproduce it, others are seeing different lex/yacc
programs always regenerated after my change to copy rather than
symlink the files. The reported fix is to add '-p' to the copies.
Since it doesn't hurt, go head and add it, though the reasons for
this mattering remain at best obscure and poorly articulated.

3 years agos/redundacy/redundancy
blackend [Mon, 24 Aug 2020 14:04:59 +0000 (14:04 +0000)]
s/redundacy/redundancy

MFC after: 1 week

3 years agoAdd missing Korean doc package entry, remove non-existent Serbian doc
blackend [Mon, 24 Aug 2020 14:00:12 +0000 (14:00 +0000)]
Add missing Korean doc package entry, remove non-existent Serbian doc
package entry.

Approved by: re (gjb)
MFC after: 1 week

3 years ago[PowerPC] Make new auxv format default
luporl [Mon, 24 Aug 2020 13:40:35 +0000 (13:40 +0000)]
[PowerPC] Make new auxv format default

Assume ELF images without OSREL use the new auxv format.

This is specially important for rtld, that is not tagged. Using
direct exec mode with new (ELFv2) binaries that expect the new auxv
format would result in crashes otherwise.

Unfortunately, this may break direct exec'ing old binaries,
but it seems better to correctly support new binaries by default,
considering the transition to ELFv2 happened quite some time
ago. If needed, a sysctl may be added to allow old auxv format to
be used when OSREL is not found.

Reviewed by: bdragon
Sponsored by: Eldorado Research Institute (eldorado.org.br)
Differential Revision: https://reviews.freebsd.org/D25651

3 years agonet80211: enhance getflags*() and ieee80211_add_channel*()
bz [Mon, 24 Aug 2020 13:15:08 +0000 (13:15 +0000)]
net80211: enhance getflags*() and ieee80211_add_channel*()

For ieee80211_add_channel+*() we are passing in an int flag for
ht40 and in some cases another int flag for vht80 where we'd only
need two bits really.
Convert these variables to a bitflag and fold them together into one.
This also allows for VHT160 and VHT80P80 and whatever may come to
be considered. Define the various options currently needed.

Change the drivers (rtwn and rsu) which actually set this bit to non-0.
For convenience the "1" currently used for HT40 is preserved.

Enahnce getflags_5ghz() to handle the full set of VHT flags based
on the input flags from the the driver.

Update the regdomain implementation as well to make use of the new
flags and deal with higher [V]HT bandwidths.

ieee80211_add_channel() specifically did not take flags so it will
not support naything beyond 20Mhz channels.

Note: I am not entirely happy with the "cbw_flag[s]" name, but we
do use chan_flags elsewhere already.

MFC after: 2 weeks
Reviewed by: adrian, gnn
Sponsored by: Rubicon Communications, LLC (d/b/a "Netgate")
Differential revision: https://reviews.freebsd.org/D26091

3 years agocpu_auxmsr: assert caller is preventing CPU migration.
grehan [Mon, 24 Aug 2020 11:49:49 +0000 (11:49 +0000)]
cpu_auxmsr: assert caller is preventing CPU migration.

Submitted by: Adam Fenn (adam at fenn dot io)
Requested by: kib
Reviewed by: kib, grehan
Approved by: kib
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D26166

3 years agoiflib: fix isc_rxd_flush call in netmap_fl_refill()
vmaffione [Mon, 24 Aug 2020 11:44:20 +0000 (11:44 +0000)]
iflib: fix isc_rxd_flush call in netmap_fl_refill()

The semantic of the pidx argument of isc_rxd_flush() is the
last valid index of in the free list, rather than the next
index to be published. However, netmap was still using the
old convention. While there, also refactor the netmap_fl_refill()
to simplify a little bit and add an assertion.

MFC after: 2 weeks

3 years agoAlso print number of available CPUs on Linux
arichardson [Mon, 24 Aug 2020 09:20:38 +0000 (09:20 +0000)]
Also print number of available CPUs on Linux

Without this change the buildworld/buildkernel epilogue looks like this:
>>> World built in 249 seconds, sysctl: cannot stat /proc/sys/hw/ncpu: No such file or directory
ncpu: , make -j72.

Reviewed By: emaste, bdrewery
Differential Revision: https://reviews.freebsd.org/D26056

3 years agoAvoid adding duplicates to SRCS/OBJS/SOBJS/POBJS
arichardson [Mon, 24 Aug 2020 09:20:33 +0000 (09:20 +0000)]
Avoid adding duplicates to SRCS/OBJS/SOBJS/POBJS

This is a change in preparation for stopping to use lorder.sh (D26044) and
instead assume that we have a linker newer than ~1990. Without lorder.sh
duplicates end up being passed to the linker when building .so files and this
can result in duplicate symbol definition errors.

There is one minor change: libcompiler_rt.a will no longer provide
gcc_personality_v0 and instead we now only have it in libgcc_eh.a/libgcc_s.so.
This matches GCC's behaviour.

Reviewed By: emaste, cem
Differential Revision: https://reviews.freebsd.org/D26042

3 years agomakefs (msdosfs): Use fprintf instead of debug print for errors
arichardson [Mon, 24 Aug 2020 09:20:27 +0000 (09:20 +0000)]
makefs (msdosfs): Use fprintf instead of debug print for errors

The added print was very helpful for debugging failed disk image creation.

Reviewed By: emaste
Differential Revision: https://reviews.freebsd.org/D23200

3 years agoCorrectly determine the real executable in crunched binaries
arichardson [Mon, 24 Aug 2020 09:20:23 +0000 (09:20 +0000)]
Correctly determine the real executable in crunched binaries

This should fix cases like su setting argv[0] to _su for /bin/sh.
Previously cheribsdbox (a crunched tool we use in CheriBSD to reduce the
size of our minimal disk images to allow loading them onto FPGAs without
waiting forever for the transfer) would complain about _su not being
compiled in, but now that we also look at AT_EXECPATH it correctly
invokes the sh tool.

Note: we use use AT_EXECPATH instead of the KERN_PROC_PATHNAME sysctl to get
the crunchgen binary name since it seems like KERN_PROC_PATHNAME just
returns the last cached path for a given hardlink.
When using `su`, instead of invoking /bin/csh this would invoke the last
used hardlink to cheribsdbox. This caused weird test failures when running
tests due to `id` being executed instead of `echo`:

$ id  # id is a hardlink to /bin/cheribsdbox
$ su postgres -c 'echo 1' # su is also a hardlink
uid=1001(postgres) gid=1001(postgres) groups=1001(postgres)

Obtained from: CheriBSD

Reviewed By: emaste, brooks
Differential Revision: https://reviews.freebsd.org/D25998

3 years agoRe-indent crunched_main.c in preparation for D25998
arichardson [Mon, 24 Aug 2020 09:20:18 +0000 (09:20 +0000)]
Re-indent crunched_main.c in preparation for D25998

3 years agoPass the installworld install(1) flags to make buildenv
arichardson [Mon, 24 Aug 2020 09:20:13 +0000 (09:20 +0000)]
Pass the installworld install(1) flags to make buildenv

This ensure that running make install inside buildenv correctly includes
the METALOG flags when building with -DNO_ROOT.

Reviewed By: brooks
Differential Revision: https://reviews.freebsd.org/D26038

3 years agocache: lockless reverse lookup
mjg [Mon, 24 Aug 2020 09:00:57 +0000 (09:00 +0000)]
cache: lockless reverse lookup

This enables fully scalable operation for getcwd and significantly improves
realpath.

For example:
PATH_CUSTOM=/usr/src ./getcwd_processes -t 104
before:  1550851
after: 380135380

Tested by: pho

3 years agocache: drop the always curthread argument from reverse lookup routines
mjg [Mon, 24 Aug 2020 08:57:02 +0000 (08:57 +0000)]
cache: drop the always curthread argument from reverse lookup routines

Note VOP_VPTOCNP keeps getting it as temporary compatibility for zfs.

Tested by: pho

3 years agocache: perform reverse lookup using v_cache_dd if possible
mjg [Mon, 24 Aug 2020 08:55:55 +0000 (08:55 +0000)]
cache: perform reverse lookup using v_cache_dd if possible

Tested by: pho

3 years agocache: populate v_cache_dd for non-VDIR entries
mjg [Mon, 24 Aug 2020 08:55:04 +0000 (08:55 +0000)]
cache: populate v_cache_dd for non-VDIR entries

It makes v_cache_dd into a little bit of a misnomer and it may be addressed later.

Tested by: pho

3 years agobhyve: NVMe queue create must init head/tail
chuck [Mon, 24 Aug 2020 01:51:21 +0000 (01:51 +0000)]
bhyve: NVMe queue create must init head/tail

The NVMe emulation code did not explicitly initialize queue head and
tail pointers on queue creation. As these pointers are part of
calloc()'ed memory, this only becomes a problem if the queues are
deleted and then recreated.

This error can manifest with messages about completions not matching a
command.

3 years agobhyve: NVMe set nominal health values
chuck [Mon, 24 Aug 2020 01:51:17 +0000 (01:51 +0000)]
bhyve: NVMe set nominal health values

Some operating systems believe bhyve's emulated NVMe drive is failing
based on certain values in the SMART / Health Information log page being
zero. Fix is to set the reported temperature and available spare values
to reasonable defaults.

Submitted by: wanpengqian@gmail.com
Reviewed by:    grehan
MFC after:      2 weeks
Differential Revision: https://reviews.freebsd.org/D24202

3 years agocaroot: switch to using echo+shell glob to enumerate certs
kevans [Sun, 23 Aug 2020 23:56:57 +0000 (23:56 +0000)]
caroot: switch to using echo+shell glob to enumerate certs

This solves an issue on stable/12 that causes certs to not get installed.
ls is apparently not in PATH during installworld, so TRUSTED_CERTS ends up
blank and nothing gets installed. We don't really require anything
ls-specific, though, so let's just simplify it.

MFC after: 3 days

3 years agonet80211: improve media information for VHT5GHZ
bz [Sun, 23 Aug 2020 21:42:23 +0000 (21:42 +0000)]
net80211: improve media information for VHT5GHZ

Improve ieee80211_media_setup(), media2mode(), and
ieee80211_rate2media() for VHT5GHZ at least.

Reviewed by: adrian, gnn
MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC (d/b/a "Netgate")
Differential Revision: https://reviews.freebsd.org/D26089

3 years agonet80211: set_vht_extchan() reverse order to always return best
bz [Sun, 23 Aug 2020 21:37:20 +0000 (21:37 +0000)]
net80211: set_vht_extchan() reverse order to always return best

In set_vht_extchan() the checks are performed in the order of VHT20/40/80.
That means if a channel has a lower and higheer VHT flag set we would
return the lower first.
We normally do not set more than one VHT flag so this change is supposed
to be a NOP but follows the logical thinking order of returning the best
first. Also we nowhere assert a single VHT flag so make sure we'll not
be stuck with VHT20 when we could do more.

While here add the debugging printfs for VHT160 and VHT80P80 which still
need doing once we deal with a driver at that level.

Reviewed by: adrian, gnn
MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC (d/b/a "Netgate")
Differential Revision: https://reviews.freebsd.org/D26088

3 years agovfs: validate ndp state after the lookup
mjg [Sun, 23 Aug 2020 21:06:41 +0000 (21:06 +0000)]
vfs: validate ndp state after the lookup

The intent is to remove known-to-be-nops NDFREE calls after many lookups.

3 years agovfs: convert nameiop into an enum
mjg [Sun, 23 Aug 2020 21:05:39 +0000 (21:05 +0000)]
vfs: convert nameiop into an enum

While here change the field size from long to int and move it into the
gap next to cn_flags.

Shrinks struct componentname from 64 to 56 bytes on amd64.

3 years agovfs: support denying access in vaccess_vexec_smr
mjg [Sun, 23 Aug 2020 21:05:06 +0000 (21:05 +0000)]
vfs: support denying access in vaccess_vexec_smr

3 years agovfs: factor away doomed vnode handling into vdropl_final
mjg [Sun, 23 Aug 2020 21:04:35 +0000 (21:04 +0000)]
vfs: factor away doomed vnode handling into vdropl_final

3 years agoprocctl(8): usermode bits to force LA58/LA57 on exec.
kib [Sun, 23 Aug 2020 20:44:15 +0000 (20:44 +0000)]
procctl(8): usermode bits to force LA58/LA57 on exec.

Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D25273

3 years agoamd64: Handle 5-level paging on wakeup.
kib [Sun, 23 Aug 2020 20:43:23 +0000 (20:43 +0000)]
amd64: Handle 5-level paging on wakeup.

We can switch into long mode directly with LA57 enabled.

Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D25273

3 years agoamd64: Handle 5-level paging for efirt calls.
kib [Sun, 23 Aug 2020 20:40:35 +0000 (20:40 +0000)]
amd64: Handle 5-level paging for efirt calls.

Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D25273