]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
3 years agoFix panic when destroying interface with ECMP routes.
Alexander V. Chernikov [Tue, 23 Mar 2021 22:00:04 +0000 (22:00 +0000)]
Fix panic when destroying interface with ECMP routes.

Reported by: Zhenlei Huang <zlei.huang at gmail.com>
PR: 254496
MFC after: immediately

3 years agonfsv4 client: fix forced dismount when sleeping in the renew thread
Rick Macklem [Tue, 23 Mar 2021 20:04:37 +0000 (13:04 -0700)]
nfsv4 client: fix forced dismount when sleeping in the renew thread

During a recent NFSv4 testing event a test server caused a hang
where "umount -N" failed.  The renew thread was sleeping on "nfsv4lck"
and the "umount" was sleeping, waiting for the renew thread to
terminate.

This is the second of two patches that is hoped to fix the renew thread
so that it will terminate when "umount -N" is done on the mount.

This patch adds a 5second timeout on the msleep()s and checks for
the forced dismount flag so that the renew thread will
wake up and see the forced dismount flag.  Normally a wakeup()
will occur in less than 5seconds, but if a premature return from
msleep() does occur, it will simply loop around and msleep() again.
The patch also adds the "mp" argument to nfsv4_lock() so that it
will return when the forced dismount flag is set.

While here, replace the nfsmsleep() wrapper that was used for portability
with the actual msleep() call.

MFC after: 2 weeks

3 years agomakefs: Ignore the "tags" keyword in mtree manifests
Mark Johnston [Tue, 23 Mar 2021 18:38:28 +0000 (14:38 -0400)]
makefs: Ignore the "tags" keyword in mtree manifests

An install using -DNO_ROOT emits mtree entries containing tags used by
pkgbase.  makefs(8) can safely ignore them, so do that rather than
emitting a warning for each entry.

Reviewed by: brooks, imp
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D29384

3 years agodummynet: Move timekeeping information into dn_cfg
Kristof Provost [Tue, 9 Mar 2021 15:44:26 +0000 (16:44 +0100)]
dummynet: Move timekeeping information into dn_cfg

Just like with the packet counters move the timekeeping information into
dn_cfg. This reduces the global name space use for dummynet and will
make subsequent work to add vnet support and re-use in pf easier.

Reviewed by: donner
MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Different Revision: https://reviews.freebsd.org/D29246

3 years agodummynet: Move packet counters into dn_cfg
Kristof Provost [Tue, 9 Mar 2021 15:27:31 +0000 (16:27 +0100)]
dummynet: Move packet counters into dn_cfg

Move the packets counters into the dn_cfg struct. This reduces the
global name space use for dummynet and will make future work for things
like vnet support and re-use in pf easier.

Reviewed by: donner
MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D29245

3 years agoReplace the arm64 initial_fpcr with a macro
Andrew Turner [Tue, 23 Mar 2021 15:28:20 +0000 (15:28 +0000)]
Replace the arm64 initial_fpcr with a macro

This value was never changed from its default value. Replace it with a
macro.

Sponsored by: Innovate UK

3 years agosyslogd: Increase message size limits
Dmitry Wagin [Tue, 23 Mar 2021 16:15:28 +0000 (12:15 -0400)]
syslogd: Increase message size limits

Add a -M option to control the maximum length of forwarded messages.
syslogd(8) used to truncate forwarded messages to 1024 bytes, but after
commit 1a874a126a54 ("Add RFC 5424 syslog message output to syslogd.")
applies a more conservative limit of 480 bytes for IPv4 per RFC 5426
section 3.2.  Restore the old default behaviour of truncating to 1024
bytes.  RFC 5424 specifies no upper limit on the length of forwarded
messages, while for RFC 3164 the limit is 1024 bytes.

Increase MAXLINE to 8192 bytes to correspond to commit 672ef817a192.

Replaced bootfile[] size for MAXPATHLEN used in getbootfile(3) as a
returned value. Using (MAXLINE+1) as a size for bootfile[] is excessive.

PR: 241937
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D27206

3 years agolibc: Some enhancements to syslog(3)
Dmitry Wagin [Tue, 23 Mar 2021 16:01:15 +0000 (12:01 -0400)]
libc: Some enhancements to syslog(3)

- Defined MAXLINE constant (8192 octets by default instead 2048) for
  centralized limit setting up. It sets maximum number of characters of
  the syslog message. RFC5424 doesn't limit maximum size of the message.
  Named after MAXLINE in syslogd(8).
- Fixed size of fmt_cpy buffer up to MAXLINE for rendering formatted
  (%m) messages.
- Introduced autoexpansion of sending socket buffer up to MAXLINE.

MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D27205

3 years agoarm64: Only check for freebsd,dts-version if we are booted in FDT mode.
Emmanuel Vadot [Tue, 23 Mar 2021 15:37:25 +0000 (16:37 +0100)]
arm64: Only check for freebsd,dts-version if we are booted in FDT mode.

Reported by:   andrew

3 years agoarm64: Check dtb version against the one we're expecting to find
Emmanuel Vadot [Tue, 23 Mar 2021 14:24:14 +0000 (15:24 +0100)]
arm64: Check dtb version against the one we're expecting to find

Do for arm64 what was done for armv7 in e63faa9ba832b6

3 years agopf: Handle unmapped mbufs when computing checksums
Mark Johnston [Tue, 23 Mar 2021 13:38:59 +0000 (09:38 -0400)]
pf: Handle unmapped mbufs when computing checksums

PR: 254419
Reviewed by: gallatin, kp
Tested by: Igor A. Valkov <viaprog@gmail.com>
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D29378

3 years agodts: Bump the freebsd branding version to 5.10
Emmanuel Vadot [Tue, 23 Mar 2021 14:02:21 +0000 (15:02 +0100)]
dts: Bump the freebsd branding version to 5.10

3 years agoUpdate DTS files from Linux v5.10
Emmanuel Vadot [Tue, 23 Mar 2021 14:00:35 +0000 (15:00 +0100)]
Update DTS files from Linux v5.10

3 years agoFix scripted installs on EFI systems after default mounting of the ESP.
Nathan Whitehorn [Tue, 23 Mar 2021 13:19:42 +0000 (09:19 -0400)]
Fix scripted installs on EFI systems after default mounting of the ESP.

Because the ESP mount point (/boot/efi) is in mtree, tar will attempt to
extract a directory at that point post-mount when the system is installed.
Normally, this is fine, since tar can happily set whatever properties it
wants. For FAT32 file systems, however, like the ESP, tar will attempt to
set mtime on the root directory, which FAT does not support, and tar will
interpret this as a fatal error, breaking the install (see
https://github.com/libarchive/libarchive/issues/1516). This issue would
also break scripted installs on bare-metal POWER8, POWER9, and PS3
systems, as well as some ARM systems.

This patch solves the problem in two ways:
- If stdout is a TTY, use the distextract stage instead of tar, as in
  interactive installs. distextract solves this problem internally and
  provides a nicer UI to boot, but requires a TTY.
- If stdout is not a TTY, use tar but, as a stopgap for 13.0, exclude
  boot/efi from tarball extraction and then add it by hand. This is a
  hack, and better solutions (as in the libarchive ticket above) will
  obsolete it, but it solves the most common case, leaving only
  unattended TTY-less installs on a few tier-2 platforms broken.

In addition, fix a bug with fstab generation uncovered once the tar issue
is fixed that umount(8) can depend on the ordering of lines in fstab in a
way that mount(8) does not. The partition editor now writes out fstab in
mount order, making sure umount (run at the end of scripted, but not
interactive, installs) succeeds.

PR: 254395
Reviewed by: gjb, imp
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D29380

3 years agogpioc_detach: fix freeing of wrong pointers
Andriy Gapon [Tue, 23 Mar 2021 10:45:18 +0000 (12:45 +0200)]
gpioc_detach: fix freeing of wrong pointers

MFC after: 1 week

3 years agoxen/netback: do not attempt to connect in the Initialised state
Roger Pau Monné [Tue, 16 Mar 2021 11:43:49 +0000 (12:43 +0100)]
xen/netback: do not attempt to connect in the Initialised state

Only attempt to fetch the configuration data and connect the shared
ring once the frontend has switched to the 'Connected' state. This
seems to be inline with what Linux netback does, and is required to
make newer versions of NetBSD netfront work, since NetBSD only
publishes the required configuration before switching to the Connected
state.

MFC after: 1 week
Sponsored by: Citrix Systems R&D

3 years agobhyve amd: Small cleanups in amdvi_dump_cmds
Ka Ho Ng [Tue, 23 Mar 2021 08:11:56 +0000 (16:11 +0800)]
bhyve amd: Small cleanups in amdvi_dump_cmds

Bump offset with MOD_INC instead in amdvi_dump_cmds.

Reviewed by: jhb
Approved by: philip (mentor)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D28862

3 years agoloader: insert spaces around menu title
Toomas Soome [Tue, 23 Mar 2021 05:04:48 +0000 (07:04 +0200)]
loader: insert spaces around menu title

Small visual nit, make menu title more clean

MFC after: 3 days

3 years agoGeneralize bus_space(9) and atomic(9) sanitizer interceptors
Mark Johnston [Tue, 23 Mar 2021 01:44:55 +0000 (21:44 -0400)]
Generalize bus_space(9) and atomic(9) sanitizer interceptors

Make it easy to define interceptors for new sanitizer runtimes, rather
than assuming KCSAN.  Lay a bit of groundwork for KASAN and KMSAN.

When a sanitizer is compiled in, atomic(9) and bus_space(9) definitions
in atomic_san.h are used by default instead of the inline
implementations in the platform's atomic.h.  These definitions are
implemented in the sanitizer runtime, which includes
machine/{atomic,bus}.h with SAN_RUNTIME defined to pull in the actual
implementations.

No functional change intended.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

3 years agoTeach DTrace that unaligned accesses are OK on aarch64, not just x86.
Robert Watson [Mon, 22 Mar 2021 01:50:00 +0000 (01:50 +0000)]
Teach DTrace that unaligned accesses are OK on aarch64, not just x86.

MFC after: 3 days
Reviewed: andrew
Differential Revision: https://reviews.freebsd.org/D29369

3 years agoTune DTrace 'aframes' for the FBT and profile providers on arm64.
Robert Watson [Sun, 21 Mar 2021 00:01:54 +0000 (00:01 +0000)]
Tune DTrace 'aframes' for the FBT and profile providers on arm64.
In both cases, too few frames were trimmed, leading to exception handling
or DTrace internals being exposed in stack traces exposed by D's stack()
primitive.

MFC after: 3 days
Reviewed by: emaste, andrew

3 years agoBump documentation date after recent updates to bsdinstall.8.
Nathan Whitehorn [Mon, 22 Mar 2021 23:41:49 +0000 (19:41 -0400)]
Bump documentation date after recent updates to bsdinstall.8.

3 years agoInclude examples of how to build script-install media.
Nathan Whitehorn [Mon, 22 Mar 2021 14:20:29 +0000 (10:20 -0400)]
Include examples of how to build script-install media.

3 years agoImprove example install scripts, making them simpler and more robust.
Nathan Whitehorn [Mon, 22 Mar 2021 14:08:55 +0000 (10:08 -0400)]
Improve example install scripts, making them simpler and more robust.

In particular:
- There is no need to do anything with gpart (the installer does that
  for you).
- There is no need to specify the network interface, since we have
  an option for defaults.

3 years agoretire obsolete mn(4) sync serial driver
Ed Maste [Mon, 22 Mar 2021 19:06:51 +0000 (15:06 -0400)]
retire obsolete mn(4) sync serial driver

Approved by: phk
Relnotes: yes

3 years agorsu: add KASSERT to document maximum mbuf size in rsu_tx_start
Ed Maste [Mon, 22 Mar 2021 18:34:31 +0000 (14:34 -0400)]
rsu: add KASSERT to document maximum mbuf size in rsu_tx_start

PR: 254479
Reviewed by: markj
Sponsored by: The FreeBSD Foundation

3 years agoSilence unused parameter warnings in the RISC-V fenv.h
Alex Richardson [Mon, 22 Mar 2021 17:47:50 +0000 (17:47 +0000)]
Silence unused parameter warnings in the RISC-V fenv.h

After increasing the lib/msun/tests WARNS to 6, this triggers a
compilation error for RISC-V.

Fixes: 87d65c747a43 ("lib/msun: Allow building tests with WARNS=6")
Reported by: Jenkins

3 years agoCorrect "Fondation" typo (missing "u")
Ed Maste [Mon, 22 Mar 2021 17:06:03 +0000 (13:06 -0400)]
Correct "Fondation" typo (missing "u")

3 years agocxgbei: Enter network epoch and set vnet around t4_push_pdus().
John Baldwin [Mon, 22 Mar 2021 16:59:16 +0000 (09:59 -0700)]
cxgbei: Enter network epoch and set vnet around t4_push_pdus().

Reviewed by: np
MFC after: 2 weeks
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D29302

3 years agocxgbe ddp: Use CPL_COOKIE_DDP* instead of DDP_BUF*_INVALIDATED.
John Baldwin [Mon, 22 Mar 2021 16:59:09 +0000 (09:59 -0700)]
cxgbe ddp: Use CPL_COOKIE_DDP* instead of DDP_BUF*_INVALIDATED.

This avoids mixing the use of two different enums which modern C
compilers warn about.

Reviewed by: np
MFC after: 2 weeks
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D29301

3 years agocxgbei: Pass ULP submode directly to set_ulp_mode_iscsi().
John Baldwin [Mon, 22 Mar 2021 16:59:02 +0000 (09:59 -0700)]
cxgbei: Pass ULP submode directly to set_ulp_mode_iscsi().

Reviewed by: np
MFC after: 2 weeks
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D29300

3 years agocxgbei: Move some function prototypes to cxgbei.h.
John Baldwin [Mon, 22 Mar 2021 16:58:54 +0000 (09:58 -0700)]
cxgbei: Move some function prototypes to cxgbei.h.

Reviewed by: np
MFC after: 2 weeks
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D29299

3 years agocxgbei: Set vnet around tcp_drop() in do_rx_iscsi_ddp().
John Baldwin [Mon, 22 Mar 2021 16:58:28 +0000 (09:58 -0700)]
cxgbei: Set vnet around tcp_drop() in do_rx_iscsi_ddp().

Reviewed by: np
MFC after: 2 weeks
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D29298

3 years agolib/msun/tests: Drop WARNS=6
Alex Richardson [Mon, 22 Mar 2021 16:56:10 +0000 (16:56 +0000)]
lib/msun/tests: Drop WARNS=6

This is the default already, so there is no need to override it.

Reported by: kevans

3 years agolib/msun/tests: Re-enable csqrt_test on AArch64
Alex Richardson [Mon, 22 Mar 2021 16:54:38 +0000 (16:54 +0000)]
lib/msun/tests: Re-enable csqrt_test on AArch64

The LLVM bug was fixed a long time ago and with D29076 this test actually
passes now.

Reviewed By: andrew
Differential Revision: https://reviews.freebsd.org/D29092

3 years agoFix lib/msun/tests/csqrt_test on platforms with 128-bit long double
Alex Richardson [Mon, 22 Mar 2021 16:54:02 +0000 (16:54 +0000)]
Fix lib/msun/tests/csqrt_test on platforms with 128-bit long double

If long double has more than 64 mantissa bits, using uint64_t to hold the
mantissa bits will truncate the value and result in test failures. To fix
this problem use __uint128_t since all platforms that have
__LDBL_MANT_DIG__ > 64 also have compiler support for 128-bit integers.

Reviewed By: rlibby
Differential Revision: https://reviews.freebsd.org/D29076

3 years agoxnb: Don't pass SIOC{ADD,DEL}MULTI to ifmedia_ioctl().
John Baldwin [Mon, 22 Mar 2021 16:55:49 +0000 (09:55 -0700)]
xnb: Don't pass SIOC{ADD,DEL}MULTI to ifmedia_ioctl().

ifmedia_ioctl() doesn't handle these requests, and this matches what
xn does.

Reviewed by: royger
MFC after: 1 week
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D29296

3 years agosctp: fix handling of RTO.initial of 1 ms
Michael Tuexen [Mon, 22 Mar 2021 15:40:41 +0000 (16:40 +0100)]
sctp: fix handling of RTO.initial of 1 ms

MFC after: 3 days
Reported by: syzbot+5eb0e009147050056ce9@syzkaller.appspotmail.com

3 years agoFix build post a0409676120c1e558d0ade943019934e0f15118d.
Cy Schubert [Mon, 22 Mar 2021 15:42:18 +0000 (08:42 -0700)]
Fix build post a0409676120c1e558d0ade943019934e0f15118d.

3 years agotcp: improve handling of SYN segments in SYN-SENT state
Michael Tuexen [Mon, 22 Mar 2021 14:58:49 +0000 (15:58 +0100)]
tcp: improve handling of SYN segments in SYN-SENT state

Ensure that the stack does not generate a DSACK block for user
data received on a SYN segment in SYN-SENT state.

Reviewed by: rscheff
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D29376
Sponsored by: Netflix, Inc.

3 years agolibedit: vendor import snapshot 2020-07-10
Baptiste Daroussin [Mon, 22 Mar 2021 14:34:14 +0000 (15:34 +0100)]
libedit: vendor import snapshot 2020-07-10

3 years agolibedit: vendor import snapshot 20200710
Baptiste Daroussin [Mon, 22 Mar 2021 14:29:33 +0000 (15:29 +0100)]
libedit: vendor import snapshot 20200710

3 years agolibucl: vendor import snapshort 20210314
Baptiste Daroussin [Mon, 22 Mar 2021 14:13:02 +0000 (15:13 +0100)]
libucl: vendor import snapshort 20210314

3 years agolibucl: import latest snapshot from 2021-03-14
Baptiste Daroussin [Mon, 22 Mar 2021 14:07:18 +0000 (15:07 +0100)]
libucl: import latest snapshot from 2021-03-14

3 years agoDTrace: remove sparc64 remnants in non-contrib code
Ed Maste [Sun, 21 Mar 2021 01:19:35 +0000 (21:19 -0400)]
DTrace: remove sparc64 remnants in non-contrib code

Sponsored by: The FreeBSD Foundation

3 years agoFix unused functions in invtrig_test.c
Alex Richardson [Mon, 22 Mar 2021 13:05:28 +0000 (13:05 +0000)]
Fix unused functions in invtrig_test.c

I only tested the WARNS=6 change on AArch64 and AMD64, but this file has
unused functions for architectures with LDBL_PREC == 53.

While touching this file change the LDBL_PREC == 53 checks to i386 checks.
The long double tests should only be disabled for i386 (due to the rather
odd rounding mode that it uses) not all architectures where long double
is the same as double.

PR: 205449
Fixes: 87d65c747a43 ("lib/msun: Allow building tests with WARNS=6")
Reported by: Jenkins

3 years agoDon't add -Winline for WARNS=6
Alex Richardson [Mon, 22 Mar 2021 11:55:45 +0000 (11:55 +0000)]
Don't add -Winline for WARNS=6

This warning is very rarely useful (inline is a hint and not mandatory).
This flag results in many warnings being printed when compiling C++
code that uses the standard library with GCC.

This flag was originally added in back in r94332 but the flag is a no-op
in Clang ("This diagnostic flag exists for GCC compatibility, and has no
effect in Clang"). Removing it should make the GCC build output slightly
more readable.

Reviewed By: jrtc27, imp
Differential Revision: https://reviews.freebsd.org/D29235

3 years agolib/msun/tests: Add more debug output to fenv_test.c
Alex Richardson [Thu, 4 Mar 2021 18:41:06 +0000 (18:41 +0000)]
lib/msun/tests: Add more debug output to fenv_test.c

Output a hex dump of the current fenv and the expected value to allow
comparing them without having to resort to interactive use of GDB.

3 years agotools/build/make.py: Avoid calling brew --prefix on macOS unnecessarily
Alex Richardson [Fri, 5 Mar 2021 10:21:12 +0000 (10:21 +0000)]
tools/build/make.py: Avoid calling brew --prefix on macOS unnecessarily

If all the require variables (XCC/XCXX/XCPP/XLD) are already set in the
environment, we don't have to infer a default value for the cross toolchain
path. This avoids an additional `brew --prefix` call when building with
cheribuild (since it already sets all these variables).

3 years agolib/msun/tests: Skip fenv_test:masking if exceptions can't be trapped
Alex Richardson [Mon, 22 Mar 2021 11:53:40 +0000 (11:53 +0000)]
lib/msun/tests: Skip fenv_test:masking if exceptions can't be trapped

Some CPUs (e.g. AArch64 QEMU) cannot trap on floating point exceptions and
therefore ignore the writes to the floating point control register inside
feenableexcept(). If no exceptions are enabled after
feenableexcept(FE_ALL_EXCEPT), we can assume that the CPU does not
support exceptions and we can then skip the test.

Reviewed By: dim
Differential Revision: https://reviews.freebsd.org/D29095

3 years agolib/msun: Allow building tests with WARNS=6
Alex Richardson [Thu, 25 Feb 2021 14:28:17 +0000 (14:28 +0000)]
lib/msun: Allow building tests with WARNS=6

The only change needed is to mark a few variables as static.

3 years agoImprove test messages for msun tests
Alex Richardson [Mon, 22 Mar 2021 11:42:07 +0000 (11:42 +0000)]
Improve test messages for msun tests

Also print the mismatched values when numbers compare not equal.

Reviewed By: dim
Differential Revision: https://reviews.freebsd.org/D29091

3 years agoRemove XFAILs from fmaxmin test
Alex Richardson [Mon, 22 Mar 2021 11:40:17 +0000 (11:40 +0000)]
Remove XFAILs from fmaxmin test

These appears to have been resolved by compiling the test with -fno-builtin
and/or using a newer compiler.

PR: 208703
Reviewed By: ngie
Differential Revision: https://reviews.freebsd.org/D28884

3 years agoConvert the msun tests to ATF
Alex Richardson [Mon, 22 Mar 2021 11:15:13 +0000 (11:15 +0000)]
Convert the msun tests to ATF

This provides better error messages that just an assertion failure and
also makes it easier to mark individual tests as XFAIL.
It was also helpful when coming up with D28786 and D28787.

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

3 years agotests/sys/net/if_lagg_test: Fix syntax error
Alex Richardson [Mon, 22 Mar 2021 10:30:41 +0000 (10:30 +0000)]
tests/sys/net/if_lagg_test: Fix syntax error

Fixes: ee231b27ff ("Also skip sys/net/if_lagg_test:witness on non-i386")

3 years agostress2: Updated the exclude list
Peter Holm [Mon, 22 Mar 2021 10:32:05 +0000 (11:32 +0100)]
stress2:  Updated the exclude list

3 years agostress2: Added two syzkaller reproducers.
Peter Holm [Mon, 22 Mar 2021 10:26:39 +0000 (11:26 +0100)]
stress2:  Added two syzkaller reproducers.

3 years agoAMD-vi: Fix IOMMU device interrupts being overridden
Ka Ho Ng [Mon, 22 Mar 2021 09:33:43 +0000 (17:33 +0800)]
AMD-vi: Fix IOMMU device interrupts being overridden

Currently, AMD-vi PCI-e passthrough will lead to the following lines in
dmesg:
"kernel: CPU0: local APIC error 0x40
ivhd0: Error: completion failed tail:0x720, head:0x0."

After some tracing, the problem is due to the interaction with
amdvi_alloc_intr_resources() and pci_driver_added(). In ivrs_drv, the
identification of AMD-vi IVHD is done by walking over the ACPI IVRS
table and ivhdX device_ts are added under the acpi bus, while there are
no driver handling the corresponding IOMMU PCI function. In
amdvi_alloc_intr_resources(), the MSI intr are allocated with the ivhdX
device_t instead of the IOMMU PCI function device_t. bus_setup_intr() is
called on ivhdX. the IOMMU pci function device_t is only used for
pci_enable_msi(). Since bus_setup_intr() is not called on IOMMU pci
function, the IOMMU PCI function device_t's dinfo->cfg.msi is never
updated to reflect the supposed msi_data and msi_addr. So the msi_data
and msi_addr stay in the value 0. When pci_driver_added() tried to loop
over the children of a pci bus, and do pci_cfg_restore() on each of
them, msi_addr and msi_data with value 0 will be written to the MSI
capability of the IOMMU pci function, thus explaining the errors in
dmesg.

This change includes an amdiommu driver which currently does attaching,
detaching and providing DEVMETHODs for setting up and tearing down
interrupt. The purpose of the driver is to prevent pci_driver_added()
from calling pci_cfg_restore() on the IOMMU PCI function device_t.
The introduction of the amdiommu driver handles allocation of an IRQ
resource within the IOMMU PCI function, so that the dinfo->cfg.msi is
populated.

This has been tested on EPYC Rome 7282 with Radeon 5700XT GPU.

Sponsored by: The FreeBSD Foundation
Reviewed by: jhb
Approved by: philip (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D28984

3 years agoivrs_drv: Fix IVHDs with duplicated BaseAddress
Ka Ho Ng [Mon, 22 Mar 2021 09:33:43 +0000 (17:33 +0800)]
ivrs_drv: Fix IVHDs with duplicated BaseAddress

Reviewed by: jhb
Approved by: philip (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D28945

3 years agoAdd device and ifnet logging methods, similar to device_printf / if_printf
Adrian Chadd [Sun, 21 Mar 2021 18:49:05 +0000 (18:49 +0000)]
Add device and ifnet logging methods, similar to device_printf / if_printf

* device_printf() is effectively a printf
* if_printf() is effectively a LOG_INFO

This allows subsystems to log device/netif stuff using different log levels,
rather than having to invent their own way to prefix unit/netif  names.

Differential Revision: https://reviews.freebsd.org/D29320
Reviewed by: imp

3 years agosys/ck.h: Add an include guard
Kevin Bowling [Sun, 21 Mar 2021 18:50:30 +0000 (11:50 -0700)]
sys/ck.h: Add an include guard

Approved by: cognet
MFC after: 1 week
Sponsored by: BBOX.io
Differential Revision: https://reviews.freebsd.org/D29357

3 years agortsold: Fix validation of RDNSS options
Mark Johnston [Sun, 21 Mar 2021 18:18:10 +0000 (14:18 -0400)]
rtsold: Fix validation of RDNSS options

The header specifies the size of the option in multiples of eight bytes.
The option consists of an eight-byte header followed by one or more IPv6
addresses, so the option is invalid if the size is not equal to 1+2n for
some n>0.  Check this.

The bug can cause random stack data to be formatted as an IPv6 address
and passed to resolvconf(8), but a host able to trigger the bug may also
specify arbitrary addresses this way.

Reported by: Q C <cq674350529@gmail.com>
Sponsored by: The FreeBSD Foundation
MFC after: 3 days

3 years agoFix kassert panic when inserting multipath routes from multiple threads.
Alexander V. Chernikov [Sun, 21 Mar 2021 18:15:29 +0000 (18:15 +0000)]
Fix kassert panic when inserting multipath routes from multiple threads.

Reported by: Marco Zec <zec at fer.hr>
MFC after: immediately

3 years agousr.sbin/services_mkdb: diff reduction against NetBSD.
Xin LI [Sun, 21 Mar 2021 17:22:50 +0000 (10:22 -0700)]
usr.sbin/services_mkdb: diff reduction against NetBSD.

MFC after: 1 month

3 years agousr.sbin/uefisign: prevent specifying certificate, key or output
Xin LI [Sun, 21 Mar 2021 17:12:34 +0000 (10:12 -0700)]
usr.sbin/uefisign: prevent specifying certificate, key or output
multiple times.

MFC after: 1 month

3 years agoRemove PCPU_INC
Jason A. Harmening [Wed, 10 Mar 2021 04:43:01 +0000 (20:43 -0800)]
Remove PCPU_INC

e4b8deb22227 removed the last in-tree uses of PCPU_INC().  Its
potential benefit is also practically nonexistent.  Non-x86
platforms already implement it as PCPU_ADD(..., 1), and according
to [0] there are no recent x86 processors for which the 'inc'
instruction provides a performance benefit over the equivalent
memory-operand form of the 'add' instruction.  The only remaining
benefit of 'inc' is smaller instruction size, which in this case
is inconsequential given the limited number of per-CPU data consumers.

[0]: https://www.agner.org/optimize/instruction_tables.pdf

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D29308

3 years agozfs: merge OpenZFS master-891568c99
Martin Matuska [Sun, 21 Mar 2021 00:46:08 +0000 (01:46 +0100)]
zfs: merge OpenZFS master-891568c99

Notable upstream pull request merges:
  #11652 Split dmu_zfetch() speculation and execution parts
  #11682 Fix zfs_get_data access to files with wrong generation
  #11735 Clean up RAIDZ/DRAID ereport code
  #11737 Initialize metaslab range trees in metaslab_init
  #11739 FreeBSD: make seqc asserts conditional on replay
  #11763 Allow setting bootfs property on pools with indirect vdevs
  #11767 FreeBSD: Fix memory leaks in kstats

Obtained from: OpenZFS
MFC after: 2 weeks

3 years agoUpdate vendor/openzfs to master-891568c99
Martin Matuska [Sun, 21 Mar 2021 00:39:51 +0000 (01:39 +0100)]
Update vendor/openzfs to master-891568c99

Notable upstream pull request merges:
  #11652 Split dmu_zfetch() speculation and execution parts
  #11682 Fix zfs_get_data access to files with wrong generation
  #11735 Clean up RAIDZ/DRAID ereport code
  #11737 Initialize metaslab range trees in metaslab_init
  #11739 FreeBSD: make seqc asserts conditional on replay
  #11763 Allow setting bootfs property on pools with indirect vdevs
  #11767 FreeBSD: Fix memory leaks in kstats

3 years agorc.conf(5): Remove left-over variables
Tobias Rehbein [Sun, 21 Mar 2021 00:01:31 +0000 (01:01 +0100)]
rc.conf(5): Remove left-over variables

ipv6_ipfilter_rules was obsoleted because of ipfilter was updated, and
rc_parallel_start was reverted to undergo further refinement.

PR: 254398
Fixes: e2ad10e84792f61831d2e8bd

3 years agoMove GH_BC ObsoleteFiles.inc section to OptionalObsoleteFiles.inc
Dimitry Andric [Sat, 20 Mar 2021 22:15:01 +0000 (23:15 +0100)]
Move GH_BC ObsoleteFiles.inc section to OptionalObsoleteFiles.inc

Optional features belong in the latter file, and should be tested using:

.if ${MK_FEATURE} == no
[...]
.endif

3 years agoelftoolchain: Support building on Arm-based Macs
Jessica Clarke [Sat, 20 Mar 2021 17:58:10 +0000 (17:58 +0000)]
elftoolchain: Support building on Arm-based Macs

Currently macOS and DragonFlyBSD get their own special case and only
handle x86. Since all the FreeBSD cases should be general enough for
macOS and DragonFlyBSD (and the x86 ones are identical to the existing
ones) we can just delete the special cases and reuse the FreeBSD ones.

Note that upstream has since removed all the architecture-specific
checks in this file, with the only code relevant to us being an
endianness check that uses the generic compiler-provided macros. Thus
this patch will not be upstreamed, and will be dropped in a future
vendor import.

Reviewed by: dim
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D29352

3 years agonetmap: fix issues in nm_os_extmem_create()
Vincenzo Maffione [Sat, 20 Mar 2021 17:15:50 +0000 (17:15 +0000)]
netmap: fix issues in nm_os_extmem_create()

- Call vm_object_reference() before vm_map_lookup_done().
- Use vm_mmap_to_errno() to convert vm_map_* return values to errno.
- Fix memory leak of e->obj.

Reported by: markj
Reviewed by: markj
MFC after: 1 week

3 years agotools/build: Improve host-symlinks failure mode
Jessica Clarke [Sat, 20 Mar 2021 13:00:34 +0000 (13:00 +0000)]
tools/build: Improve host-symlinks failure mode

Since set -e is enabled by sys.mk, if the tool cannot be found in PATH
then the entire shell command line fails, causing us to not print the
error message below and instead silently (due to the @) fail, only
getting the usual "Error code 1" print from bmake. Thus, provide a dummy
default that will never exist (the same as is used by meta2deps.sh) if
which fails so that we get the error message as intended.

MFC after: 1 week

3 years agovirtio_pci_legacy: Allow memory space for configuration
Ka Ho Ng [Sat, 20 Mar 2021 07:40:55 +0000 (15:40 +0800)]
virtio_pci_legacy: Allow memory space for configuration

For guests running under some kind of VMMs, configuration structure is
available in memory space but not I/O space.

Reported by: Yuan Rui <number201724@me.com>
MFC after: 2 weeks
Reviewed by: rpokala, bryanv, jhb
Approved by: philip (mentor)
Differential Revision: https://reviews.freebsd.org/D28818

3 years agovirtio_pci_legacy: Use the table BAR and PBA BAR from MSI-X cap
Ka Ho Ng [Sat, 20 Mar 2021 07:40:52 +0000 (15:40 +0800)]
virtio_pci_legacy: Use the table BAR and PBA BAR from MSI-X cap

The MSI-X resource shouldn't be assumed to be always on BAR1.
The Virtio v1.1 Spec did not specify that MSI-X table and PBA BAR has to
be BAR1 either.

Reported by: Yuan Rui <number201724@me.com>
MFC after: 2 weeks
Reviewed by: bryanv, jhb
Approved by: philip (mentor)
Differential Revision: https://reviews.freebsd.org/D28817

3 years agofusefs: fix a dead store in fuse_vnop_advlock
Alan Somers [Sat, 20 Mar 2021 01:38:57 +0000 (19:38 -0600)]
fusefs: fix a dead store in fuse_vnop_advlock

kevans actually caught this in the original review and I fixed it, but
then I committed an older copy of the branch.  Whoops.

Reported by: kevans
MFC after: 13 days
MFC with: 929acdb19acb67cc0e6ee5439df98e28a84d4772
Differential Revision: https://reviews.freebsd.org/D29031

3 years agoOnly symlink cryptodev.h into /usr/include/crypto/
John Baldwin [Fri, 19 Mar 2021 23:59:44 +0000 (16:59 -0700)]
Only symlink cryptodev.h into /usr/include/crypto/

I missed updating the symlink side in the earlier commit.

Fixes: 283352dd4f6a3bb2f3c7cb45ce5dca3d86f5e3f4
MFC after: 1 week

3 years agoRemove /usr/include/crypto/rijndael.h as well.
John Baldwin [Fri, 19 Mar 2021 23:31:53 +0000 (16:31 -0700)]
Remove /usr/include/crypto/rijndael.h as well.

I missed this in the earlier commit.

MFC after: 1 week
Fixes: 283352dd4f6a3bb2f3c7cb45ce5dca3d86f5e3f4

3 years agonfsv4 client: fix forced dismount when sleeping on nfsv4lck
Rick Macklem [Fri, 19 Mar 2021 21:09:33 +0000 (14:09 -0700)]
nfsv4 client: fix forced dismount when sleeping on nfsv4lck

During a recent NFSv4 testing event a test server caused a hang
where "umount -N" failed.  The renew thread was sleeping on "nfsv4lck"
and the "umount" was sleeping, waiting for the renew thread to
terminate.

This is the first of two patches that is hoped to fix the renew thread
so that it will terminate when "umount -N" is done on the mount.

nfsv4_lock() checks for forced dismount, but only after it wakes up
from msleep().  Without this patch, a wakeup() call was required.
This patch adds a 1second timeout on the msleep(), so that it will
wake up and see the forced dismount flag.  Normally a wakeup()
will occur in less than 1second, but if a premature return from
msleep() does occur, it will simply loop around and msleep() again.

While here, replace the nfsmsleep() wrapper that was used for portability
with the actual msleep() call and make the same change for nfsv4_getref().

MFC after: 2 weeks

3 years agocxgbe(4): create a separate helper routine to write the global RSS key.
Navdeep Parhar [Fri, 19 Mar 2021 20:28:11 +0000 (13:28 -0700)]
cxgbe(4): create a separate helper routine to write the global RSS key.

While here, make sure only the PF driver attempts to program the global
RSS key (with options RSS).  The VF driver doesn't have access to those
device registers.

MFC after: 1 week
Sponsored by: Chelsio Communications

3 years agox86: consolidate hw watchpoint logic into new file
Mitchell Horne [Fri, 19 Mar 2021 19:39:12 +0000 (16:39 -0300)]
x86: consolidate hw watchpoint logic into new file

This is a prerequisite to using these functions outside of ddb, but also
provides some cleanup and minor refactoring. This code is almost
entirely duplicated between the two implementations, the only
significant difference being the lack of dbreg synchronization on i386.

Cleanups are:
 - demote some internal functions to static
 - use the constant NDBREGS instead of a '4' literal
 - remove K&R definitions
 - some added comments

Reviewed by: kib, jhb
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D29153

3 years agocxgbe(4): make it safe to call setup_memwin repeatedly.
Navdeep Parhar [Fri, 19 Mar 2021 19:30:57 +0000 (12:30 -0700)]
cxgbe(4): make it safe to call setup_memwin repeatedly.

A repeat call will recreate the memory windows in the hardware and move
them to their last-known positions without repeating any of the software
initialization.

MFC after: 1 week
Sponsored by: Chelsio Communications

3 years agoAlso skip sys/net/if_lagg_test:witness on non-i386
Alex Richardson [Fri, 19 Mar 2021 18:35:04 +0000 (18:35 +0000)]
Also skip sys/net/if_lagg_test:witness on non-i386

The LOR also happens on amd64 and other architectures. Ideally we would
fix this. However, in order to get Jenkins green again to catch real
regressions, we should skip this test for now.

PR: 251726
Reviewed By: lwhsu
Differential Revision: https://reviews.freebsd.org/D29341

3 years agotests/sys/netgraph: Further CI fixes
Alex Richardson [Fri, 19 Mar 2021 18:34:29 +0000 (18:34 +0000)]
tests/sys/netgraph: Further CI fixes

I was trying to debug why this test is working locally but failing in CI.
While doing so I made some small changes to allow running it with set -e.

It turns out the problem is that find_iface does not return anything in
Jenkins, so all following tests fail with obscure error messages.
To handle this case exit early if $eth is empty.

Reviewed By: lwhsu
Differential Revision: https://reviews.freebsd.org/D29340

3 years agopfilctl: improve formatting of "hooks" and "heads" command output.
Gleb Smirnoff [Fri, 19 Mar 2021 18:18:05 +0000 (11:18 -0700)]
pfilctl: improve formatting of "hooks" and "heads" command output.

In "heads" output just improve the header to describe all of the columns.
In "hooks" print filter name and hook name delimited with colon, so that
it matches "heads" output and also can be copy-and-pasted straight into
the command line for future "link" command.

3 years agocxgbe(4): use standard sysctl routines to deal with 16b values.
Navdeep Parhar [Fri, 19 Mar 2021 17:56:24 +0000 (10:56 -0700)]
cxgbe(4): use standard sysctl routines to deal with 16b values.

These routines to handle 8b and 16b types were added in r289773 5+ years
ago.

MFC after: 2 weeks
Sponsored by: Chelsio Communications

3 years agoarmv8crypto: note derivation in armv8_crypto_wrap.c
Mitchell Horne [Mon, 15 Mar 2021 13:46:03 +0000 (10:46 -0300)]
armv8crypto: note derivation in armv8_crypto_wrap.c

This file inherits some boilerplate and structure from the analogous
file in aesni(4), aesni_wrap.c. Note the derivation and the copyright
holders of that file.

For example, the AES-XTS bits added in 4979620ece984 were ported from
aesni(4).

Requested by: jmg
Reviewed by: imp, gnn
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D29268

3 years agoClarify that scripted installations don't require specification of boot
Nathan Whitehorn [Fri, 19 Mar 2021 13:44:30 +0000 (09:44 -0400)]
Clarify that scripted installations don't require specification of boot
partitions, as there seems to be widespread confusion on this point.

MFC after: 1 day

3 years agodevelopment(7): mention the Git mirror list in the manual page
Evgeniy Khramtsov [Fri, 19 Mar 2021 12:52:21 +0000 (20:52 +0800)]
development(7): mention the Git mirror list in the manual page

MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D29234

3 years agobc: upgrade to version 3.3.4
Stefan Eßer [Fri, 19 Mar 2021 08:46:12 +0000 (09:46 +0100)]
bc: upgrade to version 3.3.4

This upgrade performs an implicit flush of the output if the script
funcion read() is called, to make sure a prompt that does not end in a
new-line is correctly displayed in line-buffered output mode.

Merge commit '893ecb52db5ed47d6c1e8698334d34e0df651612'

3 years agoVendor import of bc 3.3.4
Stefan Eßer [Fri, 19 Mar 2021 08:39:56 +0000 (09:39 +0100)]
Vendor import of bc 3.3.4

3 years agorc.conf(5): Bump date on .Dd
Daniel Ebdrup Jensen [Fri, 19 Mar 2021 03:52:26 +0000 (04:52 +0100)]
rc.conf(5): Bump date on .Dd

Pointy hat to: me
Reported by: lwhsu

3 years agobhyve: support relocating fbuf and passthru data BARs
D Scott Phillips [Thu, 18 Mar 2021 16:08:52 +0000 (00:08 +0800)]
bhyve: support relocating fbuf and passthru data BARs

We want to allow the UEFI firmware to enumerate and assign
addresses to PCI devices so we can boot from NVMe[1]. Address
assignment of PCI BARs is properly handled by the PCI emulation
code in general, but a few specific cases need additional support.
fbuf and passthru map additional objects into the guest physical
address space and so need to handle address updates. Here we add a
callback to emulated PCI devices to inform them of a BAR
configuration change. fbuf and passthru then watch for these BAR
changes and relocate the frame buffer memory segment and passthru
device mmio area respectively.

We also add new VM_MUNMAP_MEMSEG and VM_UNMAP_PPTDEV_MMIO ioctls
to vmm(4) to facilitate the unmapping needed for addres updates.

[1]: https://github.com/freebsd/uefi-edk2/pull/9/

Originally by: scottph
MFC After: 1 week
Sponsored by: Intel Corporation
Reviewed by: grehan
Approved by: philip (mentor)
Differential Revision: https://reviews.freebsd.org/D24066

3 years agoRefactor configuration management in bhyve.
John Baldwin [Wed, 26 Jun 2019 20:30:41 +0000 (13:30 -0700)]
Refactor configuration management in bhyve.

Replace the existing ad-hoc configuration via various global variables
with a small database of key-value pairs.  The database supports
heirarchical keys using a MIB-like syntax to name the path to a given
key.  Values are always stored as strings.  The API used to manage
configuation values does include wrappers to handling boolean values.
Other values use non-string types require parsing by consumers.

The configuration values are stored in a tree using nvlists.  Leaf
nodes hold string values.  Configuration values are permitted to
reference other configuration values using '%(name)'.  This permits
constructing template configurations.

All existing command line arguments now set configuration values.  For
devices, the "-s" option parses its option argument to generate a list
of key-value pairs for the given device.

A new '-o' command line option permits setting an individual
configuration variable.  The key name is always given as a full path
of dot-separated components.

A new '-k' command line option parses a simple configuration file.
This configuration file holds a flat list of 'key=value' lines where
the 'key' is the full path of a configuration variable.  Lines
starting with a '#' are comments.

In general, bhyve starts by parsing command line options in sequence
and applying those settings to configuration values.  Once this is
complete, bhyve then begins initializing its state based on the
configuration values.  This means that subsequent configuration
options or files may override or supplement previously given settings.

A special 'config.dump' configuration value can be set to true to help
debug configuration issues.  When this value is set, bhyve will print
out the configuration variables as a flat list of 'key=value' lines.

Most command line argments map to a single configuration variable,
e.g.  '-w' sets the 'x86.strictmsr' value to false.  A few command
line arguments have less obvious effects:

- Multiple '-p' options append their values (as a comma-seperated
  list) to "vcpu.N.cpuset" values (where N is a decimal vcpu number).

- For '-s' options, a pci.<bus>.<slot>.<function> node is created.
  The first argument to '-s' (the device type) is used as the value of
  a "device" variable.  Additional comma-separated arguments are then
  parsed into 'key=value' pairs and used to set additional variables
  under the device node.  A PCI device emulation driver can provide
  its own hook to override the parsing of the additonal '-s' arguments
  after the device type.

  After the configuration phase as completed, the init_pci hook
  then walks the "pci.<bus>.<slot>.<func>" nodes.  It uses the
  "device" value to find the device model to use.  The device
  model's init routine is passed a reference to its nvlist node
  in the configuration tree which it can query for specific
  variables.

  The result is that a lot of the string parsing is removed from
  the device models and centralized.  In addition, adding a new
  variable just requires teaching the model to look for the new
  variable.

- For '-l' options, a similar model is used where the string is
  parsed into values that are later read during initialization.
  One key note here is that the serial ports use the commonly
  used lowercase names from existing documentation and examples
  (e.g. "lpc.com1") instead of the uppercase names previously
  used internally in bhyve.

Reviewed by: grehan
MFC after: 3 months
Differential Revision: https://reviews.freebsd.org/D26035

3 years agofusefs: fix two bugs regarding fcntl file locks
Alan Somers [Thu, 18 Mar 2021 20:27:27 +0000 (14:27 -0600)]
fusefs: fix two bugs regarding fcntl file locks

1) F_SETLKW (blocking) operations would be sent to the FUSE server as
   F_SETLK (non-blocking).

2) Release operations, F_SETLK with lk_type = F_UNLCK, would simply
   return EINVAL.

PR: 253500
Reported by: John Millikin <jmillikin@gmail.com>
MFC after: 2 weeks

3 years agoUnbreak MSG_CMSG_CLOEXEC
Alex Richardson [Thu, 18 Mar 2021 20:52:20 +0000 (20:52 +0000)]
Unbreak MSG_CMSG_CLOEXEC

MSG_CMSG_CLOEXEC has not been working since 2015 (SVN r284380) because
_finstall expects O_CLOEXEC and not UF_EXCLOSE as the flags argument.
This was probably not noticed because we don't have a test for this flag
so this commit adds one. I found this problem because one of the
libwayland tests was failing.

Fixes: ea31808c3b07 ("fd: move out actual fp installation to _finstall")
MFC after: 3 days
Reviewed By: mjg, kib
Differential Revision: https://reviews.freebsd.org/D29328

3 years agoAdd Chacha20+Poly1035 to the list of AEAD algorithms.
John Baldwin [Thu, 18 Mar 2021 20:31:39 +0000 (13:31 -0700)]
Add Chacha20+Poly1035 to the list of AEAD algorithms.

Sponsored by: Netflix

3 years agovtnet: fix TSO for TCP/IPv6
Michael Tuexen [Thu, 18 Mar 2021 20:25:47 +0000 (21:25 +0100)]
vtnet: fix TSO for TCP/IPv6

The decision whether a TCP packet is sent over IPv4 or IPv6 was
based on ethertype, which works correctly. In D27926 the criteria
was changed to checking if the CSUM_IP_TSO flag is set in the
csum-flags and then considering it to be TCP/IPv4.
However, the TCP stack sets the flag to CSUM_TSO for IPv4 and IPv6,
where CSUM_TSO is defined as CSUM_IP_TSO|CSUM_IP6_TSO.
Therefore TCP/IPv6 packets gets mis-classified as TCP/IPv4,
which breaks TSO for TCP/IPv6.
This patch bases the check again on the ethertype.
This fix will be MFC instantly as discussed with re(gjb).

MFC after: instantly
PR: 254366
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D29331

3 years agoFix the 'linux' rc script on aarch64.
Edward Tomasz Napierala [Tue, 16 Mar 2021 16:48:13 +0000 (16:48 +0000)]
Fix the 'linux' rc script on aarch64.

Previously it would try to load linux.ko instead of linux64.ko
and fail.  While here, don't try to match 'linuxaout'; even if
implemented, it's the same module as `linuxelf`.

Reviewed By: emaste
Sponsored By: EPSRC
Differential Revision: https://reviews.freebsd.org/D29288

3 years agonfsv4 pnfs client: fix updating of the layout stateid.seqid
Rick Macklem [Thu, 18 Mar 2021 19:20:25 +0000 (12:20 -0700)]
nfsv4 pnfs client: fix updating of the layout stateid.seqid

During a recent NFSv4 testing event a test server was replying
NFSERR_OLDSTATEID for layout stateids presented to the server
for LayoutReturn operations.  Upon rereading RFC5661, it was
apparent that the FreeBSD NFSv4.1/4.2 pNFS client did not
maintain the seqid field of the layout stateid correctly.

This patch is believed to correct the problem.  Tested against
a FreeBSD pNFS server with diagnostics added to check the stateid's
seqid did not indicate problems.  Unfortunately, testing aginst
this server will not happen in the near future, so the fix may
not be correct yet.

MFC after: 2 weeks