Commit Graph

275640 Commits

Author SHA1 Message Date
Toomas Soome
9cd45772a4 libsa: mark head_errlog feature supported.
head_errlog is new format for errlog, but we do not really
use errlog, so we can just mark it supported, to enable reading
from pool.

MFC after:	1 week
2022-05-21 09:13:06 +03:00
Mike Karels
a30eee517d ping: add missing test files to Makefile
Should fix ATF tests after 5af718a592.
2022-05-20 22:13:02 -05:00
Mike Karels
5af718a592 ping: if -S srcaddr uses a numeric address, use that protocol
The command "ping -S dotted.quad hostname" fails on dual-stack hosts
with the confusing message "ping: invalid source address: Name does
not resolve" because IPv6 is selected in preference.  If the argument
to -S is numeric (likely), select the corresponding address family,
as if -4 or -6 was specified.  Add tests that either IPv4 or IPv6 can
be forced via a -S parameter.

Reviewed by:	asomers
Differential Revision: https://reviews.freebsd.org/D35271
MFC after:	1 week
2022-05-20 18:30:47 -05:00
Rick Macklem
72bf76d6b8 rpc.tlsclntd: Add an option to force use of TLS version 1.2
Commit 0b4f2ab0e9 fixes the krpc so that it can use TLS
version 1.3 for NFS-over-TLS, as required by
the draft (someday to be an RFC).
Since FreeBSD 13.0, 13.1 use TLS version 1.2 for
NFS-over-TLS mounts, this command line option
may be used so that NFS-over-TLS mounts to 13.0, 13.1
servers will still work.

Without the command line option, NFS-over-TLS mounts
will use TLS version 1.3.

The man page update will be a separate commit.

MFC after: 	2 weeks
2022-05-20 14:57:42 -07:00
Rick Macklem
0637b12b13 rpc.tlsservd: Add an option to allow TLS version 1.2
Commit 0b4f2ab0e9 fixes the krpc so that it can use TLS
version 1.3 for NFS-over-TLS, as required by
the draft (someday to be an RFC).
Since FreeBSD 13.0, 13.1 use TLS version 1.2 for
NFS-over-TLS mounts, this command line option
may be used so that mounts from 13.0, 13.1 will still work.

Without the command line option, only TLS version 1.3
mounts are permitted.

The man page update will be a separate commit.

MFC after: 	2 weeks
2022-05-20 14:47:36 -07:00
Mateusz Guzik
cdb337b097 vfs: fix copy-pasto in previous
Reported by:	dchagin
2022-05-20 20:58:11 +00:00
Bjoern A. Zeeb
6cf748ad94 LinuxKPI 802.11 / iwlwifi / rtw88 : re-factor ieee802211_sta for MLO
Working on an update for rtw88 baed on wireless-testing I ran into
a build issue with struct ieee802211_sta.  Some fields were factored
out into their own struct apparently preparing for MLO (Multi Link
Operation).

In order to be able to update one driver we have to adjust both
rtw88 and iwlwifi (and the ones still out-of-tree) now.

This is mostly a sed-replace job and no functional changes are
intended.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2022-05-20 18:45:18 +00:00
Mateusz Guzik
ec3c225711 vfs: call vn_truncate_locked from kern_truncate
This fixes a bug where the syscall would not bump writecount.

PR:	263999
2022-05-20 17:25:51 +00:00
Mateusz Guzik
6b715687bd vfs: make sure truncate always calls NDFREE_*
While here convert it to NDFREE_NOTHING.
2022-05-20 17:25:51 +00:00
John Baldwin
9dfbda254c Switch to GCC 9 for the GCC tinderbox.
This also adds arm and riscv to the GCC tinderbox.

Reviewed by:	emaste (older version)
Differential Revision:	https://reviews.freebsd.org/D26202
2022-05-20 10:16:57 -07:00
John Baldwin
7a0c23da4e vmm: Destroy character devices synchronously.
This fixes a userland race where bhyveload or bhyve can fail to reuse
a VM name after bhyvectl --destroy has returned.

Reported by:	Michael Dexter
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D35186
2022-05-20 09:53:43 -07:00
Brooks Davis
6a968ad5d9 sys/dts: Remove MIPS files
Reviewed by:	manu, imp
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D35263
2022-05-20 17:11:27 +01:00
Mark Johnston
670be460e4 bitstring_test: Add regression tests for bit_ff(c|s)_area_at()
Validate the cases where a match can be found immediately and where no
match can be found.  This extends the existing test cases and is enough
to catch the bug fixed in commit 6e7a585348 ("bitstring: fix ff_area()
when start!=0").

Reviewed by:	dougm
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D35259
2022-05-20 10:36:05 -04:00
Mark Johnston
e097436cb2 libsa: Make the nvlist implementation more self-contained
Move declarations into a new nvlist.h rather than putting everything in
libzfs.h.  This makes this nvlist code easier to reuse elsewhere.  In
particular, the nvlist implementation in sys/contrib/libnv does not
provide XDR encoding, but this is needed when reading from or writing to
ZFS pools.

Also:
- Remove references to boolean_t.  It has to be a 32-bit int here, so
  just reference the underlying type.
- Add includes needed when compiling the nvlist code outside of stand/.

No functional change intended.

Reviewed by:	tsoome
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D35255
2022-05-20 10:35:19 -04:00
Mark Johnston
bcc3148c70 libsa: Fix a bug in nvlist creation
When adding an entry to an nvlist, the data buffer might need to be
resized.  When this happens, the XDR encoder's notion of the buffer size
also needs to be updated, otherwise the operation may erroneously fail.

Reviewed by:	tsoome, imp
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D35254
2022-05-20 10:34:43 -04:00
Mark Johnston
4a3e51335e cpuset: Fix the KASAN and KMSAN builds
Rename the "copyin" and "copyout" fields of struct cpuset_copy_cb to
something less generic, since sanitizers define interceptors for
copyin() and copyout() using #define.

Reported by:	syzbot+2db5d644097fc698fb6f@syzkaller.appspotmail.com
Fixes:	47a57144af ("cpuset: Byte swap cpuset for compat32 on big endian architectures")
Sponsored by:	The FreeBSD Foundation
2022-05-20 10:34:25 -04:00
Kristof Provost
b3fa36efe7 pf tests: extend ethernet dummynet test
Extend the existing ethernet dummynet test to also test dummynet on the
outbound direction.
This used to be a problem as traffic shaping wasn't done in the ethernet
code. It merely tagged the packet and left shaping up to the layer 3 pf
code. This works in the inbound direction, but not for outbound traffic
where we hit the L3 code first and only then the L2 code.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D35258
2022-05-20 14:49:31 +02:00
Kristof Provost
bbec8e698b pf: call dummynet directly from the ethernet code
Until recently dummynet in ethernet rules did not send packets directly
to dummynet but instead marked them and left the interactions with
dummynet to the layer 3 pf code.
This worked fine for incoming packets (where we process ethernet rules
before layer 3 rules), but not for outbound packets (where the order of
operations is the reverse).

Dummynet does support handling layer 2 traffic, so send the packets
directly to dummynet.

The main limitation now is that pf does not inspect layer 4 (i.e.
TCP/UDP) so we don't have protocol information or port numbers. Dummynet
potentially uses this to separate traffic flows, which will not work for
ethernet dummynet rules. However, pipes (i.e. adding latency or
restricting bandwidth) will work exactly as expected.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D35257
2022-05-20 14:49:31 +02:00
Kristof Provost
12c542cd0e dummynet: do not store struct ifnet pointers
The dn_pkt_tag tag contained a struct ifnet pointer. If we persist that
across NET_EPOCH boundaries (as we did in dummynet) we risk panics if
the interface is removed between the packet being enqueued and it being
dequeued.

Convert the pointer into an index/generation pair and restore it when
the packet is taken out of the queue.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D35256
2022-05-20 14:49:30 +02:00
Dmitry Chagin
eca368ecb6 Retire sv_transtrap
Call translate_traps directly from sendsig().

MFC after:		2 weeks
2022-05-20 14:54:03 +03:00
Dmitry Chagin
f34a9180ae linux(4): Retire unneeded translate_traps from arm64
MFC after:	2 weeks
2022-05-20 14:19:51 +03:00
Andrey V. Elsukov
f2ab916084 [vlan + lagg] add IFNET_EVENT_UPDATE_BAUDRATE event
use it to update if_baudrate for vlan interfaces created on the LACP lagg.

Differential revision:	https://reviews.freebsd.org/D33405
2022-05-20 06:38:43 +02:00
Bjoern A. Zeeb
d296b65d89 LinuxKPI: 802.11 updates
Add more values to the ieee80211_min_mpdu_start_spacing enum with
two missing given we do not know how they are called.  Also update
the reference while here.

Add struct ieee80211_hdr_3addr and correct the comment on the
ieee80211_hdr to match the one in net80211 to avoid future confusion.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2022-05-20 01:11:22 +00:00
Bjoern A. Zeeb
85eb99f9a4 LinuxKPI: implement pcie_capability_set_word()
Implement pcie_capability_set_word() using the already available
read/write functions.
Also define the completion timeout disable value to our PCI one.
Both needed by a driver update.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	manu, hselasky
Differential Revision: https://reviews.freebsd.org/D35250
2022-05-20 01:09:08 +00:00
Navdeep Parhar
87c5ff0648 cxgbe/iw_cxgbe: c4iw_zero_addr should not use IN_ZERONET.
c4iw_zero_addr is supposed to check for all-zero addresses but was using
IN_ZERONET (which does something different) for IPv4 addresses.  Fix it
by simply checking for 0 as is done for IPv6 addresses.

Reported by:	karels@
MFC after:	3 days
Sponsored by:	Chelsio Communications
2022-05-19 15:55:08 -07:00
Cy Schubert
e343ebbfbe src.libnames: Replace redundant += with =
The += for unique assignments is equivalent to =. Make these confusing
assignments simply assignments.

Reviewed by:		emaste
MFC after:		1 week
Differential Revision:	https://reviews.freebsd.org/D35242
2022-05-19 15:33:45 -07:00
Dmitry Chagin
b04f5d18b5 linux(4): To improve readability use FUTEX_UNOWNED instead of 0
MFC after:		2 weeks
2022-05-19 21:42:38 +03:00
Dmitry Chagin
89737eb829 Fix the build after 47a57144 2022-05-19 21:40:59 +03:00
Dmitry Chagin
a6f85b12bb linux(4): Convert the native kernel signal codes into the Linux codes
MFC after:		2 weeks
2022-05-19 19:56:50 +03:00
Dmitry Chagin
3030197563 linux(4): Add kernel signal code definitions
In the next commit I'll convert the native signal codes into the Linux codes,
since they are not 1:1 mapped.

MFC after:		2 weeks
2022-05-19 19:55:56 +03:00
Dmitry Chagin
9386e18b39 linux(4): Move signal codes definitions to the appropriate header
In the Linux the struct siginfo related bits are placed into the siginfo.h
header.

MFC after:		2 weeks
2022-05-19 19:55:20 +03:00
Dmitry Chagin
6e2caba7a1 arm64: Enable the floating-point exception traps
To enable it user-space needs to call feenableexcept().

FPE_FLTIDO has been added as the IDF bit can't be mapped to any existing
FPE code.

Reviewed by:		andrew@
Differential revision:	https://reviews.freebsd.org/D35247
MFC after:		2 weeks
2022-05-19 19:53:56 +03:00
Dmitry Chagin
2cd662064a linux(4): Handle cas failure on ll/sc operations
Follow the 11a6ecd4. Check and handle the case when the ll/sc casu fails
even when the compare succeeds.

For more details PR/263825, https://reviews.freebsd.org/D35150.

Obtained from:		Andrew@
MFC after:		2 weeks
2022-05-19 19:52:18 +03:00
Dmitry Chagin
2479e381cd kqueue: Trim trailing whitespace
MFC after:		1 week
2022-05-19 19:52:02 +03:00
Justin Hibbits
47a57144af cpuset: Byte swap cpuset for compat32 on big endian architectures
Summary:
BITSET uses long as its basic underlying type, which is dependent on the
compile type, meaning on 32-bit builds the basic type is 32 bits, but on
64-bit builds it's 64 bits.  On little endian architectures this doesn't
matter, because the LSB is always at the low bit, so the words get
effectively concatenated moving between 32-bit and 64-bit, but on
big-endian architectures it throws a wrench in, as setting bit 0 in
32-bit mode is equivalent to setting bit 32 in 64-bit mode.  To
demonstrate:

32-bit mode:

BIT_SET(foo, 0):        0x00000001

64-bit sees: 0x0000000100000000

cpuset is the only system interface that uses bitsets, so solve this
by swapping the integer sub-components at the copyin/copyout points.

Reviewed by:	kib
MFC after:	3 days
Sponsored by:	Juniper Networks, Inc.
Differential Revision:	https://reviews.freebsd.org/D35225
2022-05-19 10:49:55 -05:00
Mark Johnston
21add93b58 makefs: Remove execute permission from in-tree test scripts
Let the build system set it as needed.  No functional change intended.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-05-19 11:46:02 -04:00
Gleb Popov
7eb6a92e3f jexec man: Explain how PATH is adjusted.
Add a sentence that explains that PATH is set to `/bin:/usr/bin`.
I had to dive into `jexec.c` to find this out.

Reviewed by:	markj
Differential Revision: https://reviews.freebsd.org/D35251
2022-05-19 16:58:32 +03:00
Andrew Turner
f9ca52bab5 Use getpagesize in gcore to find the page size
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35194
2022-05-19 11:32:26 +01:00
Andrew Turner
88ac318759 Support LSE atomics in the arm64 casue* functions
As with atomic(9) use the ARMv8.1 Large System Extension atomic
instructions to implement the userspace compare and swap functions.

Reviewed by:	kib
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35234
2022-05-19 11:30:21 +01:00
Andrew Turner
11a6ecd425 Handle cas failure when the compare succeeds
When locking a priority inherit mutex we perform a compare and swap
operation to try and acquire the mutex. This may fail even when the
compare succeeds.

Check and handle this case.

PR:		263825
Reviewed by:	kib, markj
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35150
2022-05-19 11:30:21 +01:00
Andrew Turner
190abf86bb Fix the name of Makefile.aarch64
Makefile.arm64 relies on being included via Makefile.${MACHINE}. This
only works when arm64 is the only aarch64 architecture. Switch to
Makefile.aarch64 so downstream CheriBSD can use the file when building
for Morello which uses a differen ${MACHINE} value.

Sponsored by:	Innovate UK
2022-05-19 11:30:21 +01:00
Hans Petter Selasky
527762b2f7 mlx4: Fix a memory leak bug.
In function mlx4_opreq_action(), pointer "mailbox" is not released,
when mlx4_cmd_box() return and error, causing a memory leak bug.
Fix this issue by going to "out" label, mlx4_free_cmd_mailbox() can
free this pointer.

Linux commit:
febfd9d3c7f74063e8e630b15413ca91b567f963

PR:		264056
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-05-19 10:13:06 +02:00
Hans Petter Selasky
ad7741ff69 ibcore: Fix possible memory leak in ib_mad_post_receive_mads()
If ib_dma_mapping_error() returns non-zero value,
ib_mad_post_receive_mads() will jump out of loops and return -ENOMEM
without freeing mad_priv. Fix this memory-leak problem by freeing
mad_priv in this case.

Linux commit:
a17f4bed811c60712d8131883cdba11a105d0161

PR:		264057
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-05-19 10:13:06 +02:00
Martin Matuska
716fd348e0 zfs: merge openzfs/zfs@c0cf6ed67
Notable upstream pull request merges:
  #10662 zvol_wait: Ignore locked zvols
  #12789 Improve log spacemap load time
  #12812 Improved zpool status output, list all affected datasets
  #13277 FreeBSD: Use NDFREE_PNBUF if available
  #13302 Make zfs_max_recordsize default to 16M
  #13311 Fix error handling in FreeBSD's get/putpages VOPs
  #13345 FreeBSD: Fix translation from ABD to physical pages
  #13373 zfs: holds: dequadratify
  #13375 Corrected edge case in uncompressed ARC->L2ARC handling
  #13388 Improve mg_aliquot math
  #13405 Reduce dbuf_find() lock contention
  #13406 FreeBSD: use zero_region instead of allocating a dedicated page

Obtained from:	OpenZFS
OpenZFS commit:	c0cf6ed679
2022-05-19 00:55:59 +02:00
Dimitry Andric
4e2d3f26bd Remove accidentally committed diff file
I accidentally added the upstream diff file from the llvm commit I
merged in 1a0329799c. Clean it out.

Noticed by:	markj
Fixes:		1a0329799c
MFC after:	2 weeks
2022-05-18 21:45:40 +02:00
Ed Maste
ec3c01ae72 makefs: sort cd9660 sysid entries in man page
"efi" was added at the end of the sysid list rather than in alpha
order.  Move it as a diff reduction against NetBSD.
2022-05-18 15:42:12 -04:00
Dimitry Andric
1a0329799c Apply llvm fix for "Invalid PPC CTR loop!" error on powerpcspe
Merge commit d9d15af7873f from llvm git (Qiu Chaofan):

  [PowerPC] Treat llvm.fmuladd intrinsic as using CTR

  This fixes bug 55463, similar to D78668. This is a temporary fix since
  we will switch to post-isel CTR loop determination in the future.

  Reviewed By: dim, shchenz

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

MFC after:	2 weeks
2022-05-18 20:29:02 +02:00
Ed Maste
f70de61e56 loader.efi: add cross-reference to loader(8)
The loader.efi man page describes UEFI-specific loader details, but not
general loader information.

MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2022-05-18 10:33:20 -04:00
Ruslan Bukin
41ce5498f8 Add OFW support to arm64's IOMMU framework.
This is needed to support non-PCI devices like memory-mapped
display controllers.
Split-out some initialization code from iommu_ctx_alloc() into
iommu_ctx_init() method so we could pass controller's MD-data
obtained from DTS to the driver prior to a CTX initialization.

Tested on Morello SoC.

Sponsored by:	UKRI
2022-05-18 14:11:23 +01:00
Ruslan Bukin
182a69328d Fix stream table entry (STE) initialization and removal.
For PCI devices we have entire L1 descriptor for every session ID (SID),
but for non-PCI (e.g. Display Processing Unit DPU), a single L1
descriptor serves multiple SIDs.
So prevent re-initialization of L1 descriptor if already initialized.
Don't free entire L1 descriptor on every STE removal.

Sponsored by:	UKRI
2022-05-18 13:42:37 +01:00