Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge FreeBSD 2024-07-12 #2242

Merged
merged 266 commits into from
Oct 30, 2024
Merged

Merge FreeBSD 2024-07-12 #2242

merged 266 commits into from
Oct 30, 2024

Conversation

bsdjhb
Copy link
Collaborator

@bsdjhb bsdjhb commented Oct 30, 2024

PR for CI

christosmarg and others added 30 commits July 6, 2024 20:22
midistat_lock is used outside midi/midi.c as well, so implement lock,
unlock and lockassert functions in order not to expose the lock in the
header file.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D45857
Since we allow feeding of any rate within the [feeder_rate_min,
feeder_rate_max] range, report this as the min/max rate as well. Only
exceptions are when we the device is opened in exclusive or bitperfect
mode.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D45862
The current implementation of sndstat_get_caps() does not work properly
when VCHANs are enabled, as it skips all information about physical
channels, and also assigns the min/max rates and channels to same
values, which is usually not the case. A device either supports any
sample rate within the [feeder_rate_min, feeder_rate_max] range, or
[hw_rate_min, hw_rate_max] range when the device is opened in exclusive
or bitperfect mode. The number of channels can also vary and is not
always the same for both min and max.

Refactor the whole function to resemble the way we handle fetching of
these values in dsp_oss_audioinfo() and dsp_oss_engineinfo().

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D45872
If the channel list is empty, min_rate and min_channels will be INT_MAX.
Instead, assign them to 0, like we do in sndstat_get_caps().

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D45876
In sndstat_build_sound4_nvlist(), if we have INVARIANTS or
SND_DIAGNOSTIC enabled, we will hit a lock assertion panic when we call
CHN_GETVOLUME(). Also lock the channel in the sndstat_prepare_pcm() loop
for good measure.

Fixes:		bbca3a7 ("sound: Include sound(4) channel information in sndstat nvlist")
Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D45898
For some reason, my tests were fine with this like it was, but CI for
gcc12 and gcc13 is complaining. Revert to the old form until that can be
worked out why the mismatch.

Fixes: 0b82dac
Sponsored by:		Netflix
In our products, we need those options to support our features.

Add daemon mode option for mountd, nfsd.
Add skip local host binding option for rpcd.
Add skip local host binding option for mountd.

Reviewed by:	rmacklem
Differential Revision:	https://reviews.freebsd.org/D45118
In pmap_protect(), when the mapping isn't changing, we don't need to
perform a superpage demotion, even though the requested change doesn't
cover the entire superpage.

Reviewed by:	kib
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45886
When the module is loaded on a system running on qemu/kvm the "modern"
virtio infrastructure is used and virtio_read_device_config() will end
up calling vtpci_modern_read_dev_config(). This function cannot read
values of arbitrary sizes and will panic if the p9fs mount tag size is
not supported by it.

Use virtio_read_device_config_array() instead. It was tested on both
bhyve and qemu/kvm.

PR: 280098
Co-authored-by: Mark Peek <mp@FreeBSD.org>
Reviewed by: imp
Pull Request: freebsd/freebsd-src#1320
This GPU is found in Ryzen 7000 series CPUs.

For future reference, the list of firmware versions for amdgpu drivers
can be found in [1].

[1] - https://docs.kernel.org/gpu/amdgpu/driver-misc.html

Reviewed by: imp, Christos Longros
Pull Request: freebsd/freebsd-src#1308
The command openssl-rsautl(1) has been deprecated in OpenSSL 3.0.  The
openssl-pkeyutl(1) command should be used instead.

Signed-off-by: Jose Luis Duran <jlduran@gmail.com>
Reviewed by: imp
Pull Request: freebsd/freebsd-src#1309
This commit enables NPAR support for Broadcom 57504 10/25GbE NICs

Signed-off-by: Vinícius Ferrão <vinicius@ferrao.net.br>
Reviewed by: imp,ssaxena,nightquick@proton.me
Pull Request: freebsd/freebsd-src#1306
MFC after: 2 weeks
Reviewed by: imp, Alexander Ziaee,
Pull Request: freebsd/freebsd-src#1294
…a FreeBSD system

You can run the script before or after `make installworld'

You may also check your local ports with:

  env STALE_SYMLINK_BUILDWORLD_DIRS=/usr/local ./stale-symlink-buildworld.sh

PR: 276235
- s/elasped/elapsed/

MFC after:	5 days
Update the man page descriptions so that apropos {console,keyboard}
finds more relevant man pages.

MFC after:	3 days
Reviewed by:	imp, emase
Pull Request:	freebsd/freebsd-src#1275
Update the man page descriptions so that apropos are more consistent for
console related man pages.

Motive:		apropos results: clarify consistently
MFC after:	3 days
Reviewed by:	emaste, imp
Pull Request:	freebsd/freebsd-src#1275
Commit d8a99ea added a new command line option "-I".  This patch
updates the man page for this.

This is a content change.

Reviewed by:	Alexander Ziaee <concussious.bugzilla@runbox.com> (manpages)
Differential Revision:	https://reviews.freebsd.org/D45118
Add a parameter to swp_pager_meta_build, for the benefit of
swp_pager_meta_transfer.

swp_pager_meta_transfer calls swp_pager_xfer_source, which may look up
the same trie entry twice - first, by calling sw_pager_meta_lookup,
and then as the first step in swp_pager_meta_build. A boolean
parameter to swp_pager_meta_build tells that function not to replace a
previously assigned swapblk with a new one, and setting it in this
call makes the first meta_lookup call unnecessary.

swp_pager_meta_transfer calls swp_pager_xfer_source, which may release
and reacquire the source object write lock, because the call to
swp_pager_meta_build may acquire and then release the destination
object write block. But it probably doesn't, so fiddling with the
source object write block was probably unnecessary. This boolean
parameter to swp_pager_meta_build tells it to return immediately if
memory allocation problems are about to require a lock
release/reacquisitiion, so that the caller can release/reacquire the
source object write lock only if truly necessary, around a second call
the swp_pager_meta_build with that boolean parameter not set. This
should make manipulation of the source object write lock rarer.

Reviewed by:	alc, kib (previous version)
Tested by:	pho
Differential Revision:	https://reviews.freebsd.org/D45781
The call to memcpy() meant to cause plt resolution in _thr_rtld_init()
was getting optimized by the compiler.  Tell the compiler not to use its
builtins in thr_rtld.c.  We could avoid just the memcpy builtin but
disabling all will be more robust against future changes.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D45891
Reported by:	GCC -Wrestrict
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D45892
On read error, we would return -1, but not handle it, causing a zero
size malloc of value, and then we wouldd unconditionally write
value[-1 + 1] = '\0'.  This should be harmless in terms of buffer
overflow because we should get a minimum non-zero size allocation from
malloc, but it also effectively swallowed the error.

Reported by:	GCC -Wstringop-overflow
Reviewed by:	kib, se
Differential Revision:	https://reviews.freebsd.org/D45895
As explained in the comment in the code it is a bottleneck in certain
workloads. On the other hand it does not need to be skipped in most
cases, while transiently running into the lock being contended happens a
lot.
It is rarely used but trivially supported; add the missing stat calls
and enable it in LINT.

Reviewed by:	markj, br (previous version), jhb (previous version)
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D45475
Un-ifdef the call to dump_add_page() in reserve_pv_entries(). We want PV
chunks available in the kernel dump, in case they need inspection.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D45760
The loop condition in the dmamap_load_buffer() method is 'buflen > 0',
and buflen is an unsigned type (bus_size_t).

A recent change made it possible for sgsize to exceed the remaining
buflen, when the tag has a large alignment requirement. The result is
that we would not break out of the loop at the correct time. Fix this by
avoiding underflow in the subtraction at the end of the loop.

PR:		279383
Reported by:	Robert Morris <rtm@lcs.mit.edu>
Reviewed by:	jhibbits
Fixes:		a77e1f0 ("busdma: better handling of small segment bouncing")
Differential Revision:	https://reviews.freebsd.org/D45732
The subr_physmem.c facility provides guarantees about non-empty ranges.
Push this into pmap_bootstrap_dmap() and simplify; the lowest physical
memory range is always in the first item.

No functional change intended.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D45759
kostikbel and others added 28 commits October 30, 2024 11:45
The information about the interface is needed to coordinate inline
offloading of IPSEC processing with corresponding driver.

Sponsored by:	NVIDIA networking
Differential revision:	https://reviews.freebsd.org/D44223
Similarly, mtu is needed to decide inline IPSEC offloiad for the driver.

Sponsored by: NVIDIA networking
Differential revision:	https://reviews.freebsd.org/D44224
The tags are used to pass the information about SA to/from the driver
doing inline IPSEC offload.

Sponsored by:	NVIDIA networking
To be able to pass ifp and mtu to the ipsec_output() and ipsec
accelerator filter.

Sponsored by:	NVIDIA networking
Differential revision:	https://reviews.freebsd.org/D44225
The extensions allow to restrict interface where SP or SA are offloaded,
and to receive software and hardware offload counters for given SA.

Sponsored by:	NVIDIA networking
Differential revision:	https://reviews.freebsd.org/D44316
Sponsored by:	NVIDIA networking
Sponsired by:	NVIDIA networking
Reviewed by:	glebius
Sponsored by:	NVIDIA networking
Differential revision:	https://reviews.freebsd.org/D44314
Sponsored by:	NVIDIA networking
Allow for TSO to operate if network interface supports ipsec inline
offload and supports TSO over it.

Reviewed by:	tuexen
Sponsored by:	NVIDIA networking
Differential revision:	https://reviews.freebsd.org/D44222
Inline IPSEC offload moves almost whole IPSEC processing from the
CPU/MCU and possibly crypto accelerator, to the network card.

The transmitted packet content is not touched by CPU during TX
operations, kernel only does the required policy and security
association lookups to find out that given flow is offloaded, and then
packet is transmitted as plain text to the card. For driver convenience,
a metadata is attached to the packet identifying SA which must process
the packet. Card does encryption of the payload, padding, calculates
authentication, and does the reformat according to the policy.

Similarly, on receive, card does the decapsulation, decryption, and
authentification.  Kernel receives the identifier of SA that was
used to process the packet, together with the plain-text packet.

Overall, payload octets are only read or written by card DMA engine,
removing a lot of memory subsystem overhead, and saving CPU time because
IPSEC algos calculations are avoided.

If driver declares support for inline IPSEC offload (with the
IFCAP2_IPSEC_OFFLOAD capability set and registering method table struct
if_ipsec_accel_methods), kernel offers the SPD and SAD to driver.
Driver decides which policies and SAs can be offloaded based on
hardware capacity, and acks/nacks each SA for given interface to
kernel.  Kernel needs to keep this information to make a decision to
skip software processing on TX, and to assume processing already done
on RX.  This shadow SPD/SAD database of offloads is rooted from
policies (struct secpolicy accel_ifps, struct ifp_handle_sp) and SAs
(struct secasvar accel_ipfs, struct ifp_handle_sav).

Some extensions to the PF_KEY socket allow to limit interfaces for
which given SP/SA could be offloaded (proposed for offload).  Also,
additional statistics extensions allow to observe allocation/octet/use
counters for specific SA.

Since SPs and SAs are typically instantiated in non-sleepable context,
while offloading them into card is expected to require costly async
manipulations of the card state, calls to the driver for offload and
termination are executed in the threaded taskqueue.  It also solves
the issue of allocating resources needed for the offload database.
Neither ipf_handle_sp nor ipf_handle_sav do not add reference to the
owning SP/SA, the offload must be terminated before last reference is
dropped.  ipsec_accel only adds transient references to ensure safe
pointer ownership by taskqueue.

Maintaining the SA counters for hardware-accelerated packets is the
duty of the driver.  The helper ipsec_accel_drv_sa_lifetime_update()
is provided to hide accel infrastructure from drivers which would use
expected callout to query hardware periodically for updates.

Reviewed by:	rscheff	(transport, stack integration), np
Sponsored by:	NVIDIA networking
Differential revision:	https://reviews.freebsd.org/D44219
and allow the interface driver to declare such support.

Sponsored by:	NVIDIA networking
Differential revision:	https://reviews.freebsd.org/D44221
after the interface ipsec_accel method if_hwassist() is consulted.

Sponsored by:	NVIDIA networking
With it planned that armv7 will be the only 32-bit kernel when 15.0 is
released remove support for armv6.

Remove the top level build infrastructure. It was already removed from
universe, this just stops it from being built directly.

Reviewed by:	mmel, emaste
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45634
It is being removed from the tree. Remove the build infrastructure to
configure armv6 builds.

Reviewed by:	manu, imp, emaste
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45643
We just need to check we are building for arm.

Reviewed by:	manu, emaste
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45644
Only the Raspberry Pi config was supported on armv6. Remove it in
preparation for removing armv6 support from the kernel.

Reviewed by:	manu, emaste
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45646
+ shorter example filename to minimize line wrap
+ standards macro clarifying posix => posix.2
+ align options + tag spdx

Reviewed by:	mhorne
MFC after:	3 days
Pull-Request:	freebsd/freebsd-src#1315
Instead of locking both the lower and upper vnodes, which is both
complex and deadlock-prone, only lock the upper vnode, or the lower
vnode if no upper vnode is present.

In most cases this is all that is needed; for the cases in which
both vnodes do need to be locked, this change also employs deadlock-
avoiding techniques such as LK_NOWAIT and vn_lock_pair().

There are still some corner cases in which the current implementation
ends up taking multiple vnode locks across different filesystems
without taking special steps to avoid deadlock; those cases have
been noted in the comments.

Differential Revision:	https://reviews.freebsd.org/D45398
Reviewed by:		olce
Tested by:		pho
Split the portion of unionfs_get_node_status() that searches for an
existing status object into a new helper function,
unionfs_find_node_status(), and use that in unionfs_close().

Additionally, modify unionfs_close() to accept a NULL status object
if unionfs_find_node_status() does not find a matching status
object.  This can happen due to the unconditional VOP_CLOSE()
operation issued by vgonel().

Differential Revision:	https://reviews.freebsd.org/D45398
Reviewed by:		olce
Tested by:		pho
+ service routing restart breaks on dhcp
+ change my copyright from inbox to home

Fixes:		75eda00
MFC after:	3 days
Reported by:	Graham Perrin, zlei
Reviewed by:	imp
Pull Request:	freebsd/freebsd-src#1316
This code is using the vnode after it has been released and causing a
panic when a p9fs shared volume is unmounted. In fact, it seems like it's
just duplicated code left behind from a bad merge.

PR:		279887
Reported by:	Michael Dexter

Reviewed by: imp
Pull Request: freebsd/freebsd-src#1323
Fix a stale variable name that snuck into a tracepoint from an earlier
version of the change.

Fixes:		eb60ff1 "unionfs: rework locking scheme to only lock a single
vnode"
Reported by:	jenkins
@bsdjhb bsdjhb merged commit 9acb00f into CTSRD-CHERI:dev Oct 30, 2024
29 checks passed
@bsdjhb bsdjhb deleted the merge-freebsd-20240712 branch October 30, 2024 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.