sound: Pass format and speed as arguments to sndbuf_create()
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
(cherry picked from commit 815dc35b7b5ed694fc1986d054149e375b8a17bd)
sound: Remove dead code in dsp_ioctl()
Sponsored by; The FreeBSD Foundation
MFC after: 1 week
(cherry picked from commit 69c4e2b68a588272de6ab86e302d87188bfef2a6)
virtio: Accept VIRTIO_F_RING_RESET in the modern PCI transport
Accept per-virtqueue reset when the device offers it, alongside
the V1 flag. Negotiating the feature merely permits the use of
per-virtqueue reset and imposes no obligation on a driver that
never uses it, while refusing capability-only transport features
can make strict devices reject the feature set altogether.
No functional change on hosts that do not offer RING_RESET.
Signed-off-by: Faraz Vahedi <kfv at kfv.io>
Reviewed-by: ngie
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2319
fibs_test: Mark same_ip_multiple_ifaces_fib0 as expected to fail
The test relies on being able to assign the same interface address to
two different tap interfaces; it then removes one of the addresses,
which at one point would trigger a kernel panic.
Since 361a8395f0b0 it is not possible to assign an address multiple
times this way, so the test fails. Just mark it as expected to fail for
now: if the kernel's behaviour here changes again, this test might be a
useful seatbelt.
MFC after: 2 weeks
(cherry picked from commit 6bdc9743d8f8c9727e5101d6cb6f2a85a13c5acb)
accept_filter: return different errors for non-listener and a busy socket
The fact that an accept filter needs to be cleared first before setting to
a different one isn't properly documented. The requirement that the
socket needs already be listening, although trivial, isn't documented
either. At least return a more meaningful error than EINVAL for an
existing filter. Cover this with a test case.
(cherry picked from commit 19307b86d31b7dea4bb5c3f7e233ee0e59049258)
netinet6: Remove ndpr_raf_ra_derived flag
This flag was introduced at 8036234c72c9361711e867cc1a0c6a7fe0babd84
to prevent the SIOCSPFXFLUSH_IN6 ioctl from removing manually-added
entries. However, this flag did actually not work due to an
incomplete implementation making prelist_update() not handle it before
calling nd6_prelist_add().
This patch removes the flag because a prefix is derived from an RA
always has an entry in the ndpr_advrtrs member in the struct
nd_prefix. Having a separate flag is not a good idea because it can
cause a mismatch between the flag and the ndpr_advrtrs entry. Testing
using LIST_EMPTY() is simpler for the origial goal.
This also removes in a prefix check in the ICMPV6CTL_ND6_PRLIST sysctl
to exclude manually-added entries. This ioctl is designed to list all
entries, and there is no relationship to SIOCSPFXFLUSH_IN6.
Differential Revision: https://reviews.freebsd.org/D46441
[2 lines not shown]
snd_uaudio: Initialize mixer_lock with MTX_RECURSE
Fixes: fc9dc8482396 ("snd_uaudio: Lock usbd_transfer_start() in uaudio_mixer_ctl_set()")
PR: 296682
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
mlx5ib: use the eventfd_ctx API for DEVX event subscriptions
The DEVX_SUBSCRIBE_EVENT redirect path resolved the user's eventfd with
fdget(), which on FreeBSD only finds LinuxKPI files. rdma-core creates
the eventfd with the native FreeBSD eventfd(2), so the lookup failed and
subscription returned EBADF; the delivery side likewise assumed a
LinuxKPI-pollable file.
Use the LinuxKPI eventfd_ctx API instead: eventfd_ctx_fdget() resolves
the native eventfd, eventfd_signal() notifies it, and eventfd_ctx_put()
releases it. DEVX async events can then be delivered through a redirect
eventfd.
Reviewed by: kib
Sponsored by: Nvidia networking
MFC after: 1 month
bsd.cpu.mk: Add a workaround for erratum 843419
Add a workaround for the Arm Cortex-A53 erratum 843419. This has been
targeted when the build is either unoptimised for any CPU/architecture
or targets the Cortex-A53 or ARMv8.0 architecture.
PR: 296240
PR: 296395
Reported by: Hal Murray <halmurray+freebsd at sonic.net>
Reported by: Andreas Schuh <x55839 at icloud.com>
Reviewed by: cognet, mmel
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D58212
init(8): extract reroot transient code into reroot_seed
Since init become dynamically linked, reroot appeared to be broken
because init copies itself into a transient tmpfs mount to continue
controlling execution right after the reboot(REROOT) syscall. Because
the binary is dynamically linked, it cannot be properly executed.
Provide a minimal static binary 'reroot_seed' embedded into the init as
byte stream, which performs what the 'init -r' did, namely, the second
phase reroot.
For the static build of init as part of the /rescue crunch, keep the
inline reroot code.
Reported and tested by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D58164
Revert "rk_gpio: defer level-IRQ EOI until source line is driven low"
There is a more correct / preferable scheme for handling of EOI.
Requested-by: mmel
This reverts commit 8ffb400bfd64102ac2a49639ccbbfffbe0c6f127.
tests: Add pjdfstest integration
Use ATF to wrap the new reimplementation of pjdfstest that came out of
GSOC 2022, now available in the ports tree as filesystems/pjdfstest.
So far I added tests for UFS (with several different option
combinations), tmpfs and ZFS, plus ZFS+nullfs. All of these create a
memory disk, initialize the filesystem, and point the pjdfstest
executable at it.
In the future it would be good to add tests for at least NFS and p9fs.
Reviewed by: asomers
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D56605
(cherry picked from commit 8fd4d1c0fff8441b42dbab767810db7aeaf796c3)
linux/futex: Don't load a timeout when try-locking a mutex
linux_sys_futex() does not copyin a timespec for the timeout if the
operation is LINUX_FUTEX_TRYLOCK_PI, presumably because it doesn't make
sense to specify a timeout for a try-lock operation. However, this
means that we pass a userspace timespec pointer to
linux_umtx_abs_timeout_init().
Modify linux_futex_lock_pi() to not initialize the timeout if we're
try-locking.
Reviewed by: kib, dchagin
Reported by: Yuxiang Yang, Yizhou Zhao, Ao Wang, Xuewei Feng, Qi Li,
and Ke Xu from Tsinghua University using GLM-5.2 from Z.ai
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58061
(cherry picked from commit 407c7c339adb429efcb6658accd16399031c34ca)
install: Explicitly include sys/param.h for MAXPATHLEN
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
(cherry picked from commit ca89b0fa1a93744a5bbf7a5c949826bbee4e2559)
makefs/zfs: Explicitly include sys/param.h for nitems()
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 88deb1cff92cb3620c248f32fa6e7bdbc5301213)
librpcsec_gss: Fix an off-by-one in rpc_gss_get_principal_name()
Include an extra byte for the nul-terminator, otherwise we may end up
with an out-of-bounds write.
The corresponding bug in the kernel implementation was fixed by commit
e3081f7e3e2d ("kgssapi(4): Fix string overrun in Kerberos principal construction").
Reviewed by: markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D57738
(cherry picked from commit 635ad6f2ec97e9c6b1f15620cd5ee84eb632082f)
Reset kvo_laundry to prevent it being cumulative
`sysctl vm.objects`, used by `vmstat -o` was not resetting the
laundry counter to 0 inside the loop, causing it to show the sum of
the laundry count for all previous objects instead of only the laundry
count for the current object.
Fixes: a86373bc93ee1c850943e8585d0d426479378145
Reviewed by: markj
Sponsored by: Klara, Inc.
Sponsored by: Modirum MDPay
Differential Revision: https://reviews.freebsd.org/D50907
(cherry picked from commit 32f9c9699a5a56ef8ef1da8e2974a8b34e2b84f5)
kinst/arm64: Fix return values from kinst_invop()
After commit 853cd8723494 it became invalid for kinst_invop() to return
0: dtrace_invop_start() would convert this to a sentinel value
indicating that it did not consume the breakpoint, and so we'd just
call kdb_trap() to handle it.
Change kinst_invop() to return NOP_INSTR after handling a matching
breakpoint. NOP_INSTR is handled by advancing the ELR, so we have to
compensate by subtracting INSTR_SIZE before returning.
Reviewed by: christos
MFC after: 1 week
Fixes: 853cd8723494 ("arm64: Clean up usage of the dtrace invop handler")
Differential Revision: https://reviews.freebsd.org/D56987
(cherry picked from commit d6f0e671d0797b56011880f84d12ce5fb20bf099)
sound: track kqueue low watermark per-knote for mmaped channels
Use kn->kn_sdata to track the last bs->total value for each knote
attached to an mmaped channel. An event is delivered only when the total
byte counter has advanced by at least c->lw since the last delivery.
After delivery kn_sdata is updated to the current total.
Each knote tracks its own watermark independently, so multiple knotes
attached to the same mmaped channel all receive events correctly.
Non-mmap channels keep the existing level-triggered behavior via
chn_polltrigger().
MFC after: 1 week
Reviewed by: christos
Differential Revision: https://reviews.freebsd.org/D57833
(cherry picked from commit 24576c39789ca13846b9450155923ee0e377aeb4)