jail: clean up locking around do_jail_attach
jail_attach_jd passed PD_DEREF to do_jail_attach, assuming it would take
care of freeing the held prison. This is not true, as do_jail_attach
immediately cleared that flag, leaving the jail stock in dying state
when it is later removed.
Reported by: markj
Reviewed by: markj
MFC after: 3 days
Differential Revision: <https://reviews.freebsd.org/D57674>
kern: osd: trash a slot's methods upon deregistration
This both lets us quickly identify a slot that's been deallocated while
debugging, and forces us to take a fault if something tries to call one
of the methods anyways somehow with osd_destructors[slot - 1] == NULL.
Reviewed by: imp, jamie
Differential Revision: https://reviews.freebsd.org/D48075
kern: osd: abstract away the math for locating a slot method
It's relatively simple, but we'll do it a couple of times; pull it
out into a macro.
Reviewed by: imp (previous version), jamie
Differential Revision: https://reviews.freebsd.org/D48074
adduser: Normalize supplemental groups
Rather than insist on a space-separated list, normalize the input so
that any number of spaces, commas, colons, or semicolons are accepted.
Reviewed by: bcr
Differential Revision: https://reviews.freebsd.org/D57774
fwcam: add IIDC 1394 FireWire camera driver
Add fwcam(4), a driver for IIDC v1.30 (TA Document 1999023) digital
cameras over IEEE 1394.
Supports Format_0 (VGA) video modes with isochronous receive DMA,
feature control (brightness, exposure, gain, shutter, white balance,
focus, etc.), poll/kqueue, and hot-plug via bus reset handling.
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D57685
firewire: add shared helpers for ISO receive drivers
Add fw_helpers.h with common static inline helpers for FireWire ISO
receive drivers: async xfer wait with timeout and tlabel cleanup,
quadlet read/write, and ISO mbuf management.
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D57684
hwpstate_intel(4): Fix error tests
How I failed to notice this during the review will remain a mistery.
Fixes: 29b8220b179b ("hwpstate_intel: Use ipi instead of thread_lock + sched_bind")
Event: Halifax Hackathon 202606
Location: jrm@'s bathroom
Sponsored by: The FreeBSD Foundation
nfs_clvnops.c: Fix the case where va_flags are being cleared
Commits c5d72d2 and 3b6d4c6 broke the case where the
archive/hidden/system attributes are being set false
(UF_ARCHIVE, UF_HIDDEN or UF_SYSTEM bits being cleared.)
and the NFS server does not support those attributes.
These patches only checked for support if the
archive/hidden/system attributes were non-zero.
This patch fixes the problem.
PR: 296088
(cherry picked from commit 572680712c317b81d66475203ac1b9d6bbeca5d5)
hwpstate_intel(4): sysctl_epp_select(): Cache again new EPP value
This caching was removed inadvertently in the commit mentioned below.
Fixes: 8452afeb5682 ("hwpstate_intel: Use 8bit scale instead of percentage scale")
Event: Halifax Hackathon 202606
Location: jrm@'s living room
Sponsored by: The FreeBSD Foundation
hwpstate_intel(4): Fix recent copyright formatting
Add an "empty" (comment) line between copyright and the Foundation text.
Fixes: 29b8220b179b ("hwpstate_intel: Use ipi instead of thread_lock + sched_bind")
Event: Halifax Hackathon 202606
Location: jrm@'s living room
Sponsored by: The FreeBSD Foundation
hwpstate_intel(4): Comment the EPB to EPP computation
Explain why the '* 17' instead of '* 16', as suggested in revision
D55629.
Event: Halifax Hackathon 202606
Location: jrm@'s living room
Sponsored by: The FreeBSD Foundation
uiomove_fault(): initialize save with ~0 when no flags are cleared
Reported by: markj
Fixes: 4c4195700249 ("sys: use curthread_pflags_set/restore to manage TDP_DEADLKTREAT for uio")
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
pciconf: Add option to write into a BAR region
Add option -W that allows to write into a BAR region.
Also, add an option -R that allows to read from a BAR region that
works similar to -r that reads from the PCI config space.
Reviewed by: bcr (manpages), jhb
Differential Revision: https://reviews.freebsd.org/D55915
OFED: Various changes from Linux 4.20
This contains changes from the following Linux commits:
627212c9d49b RDMA/core: Replace open-coded variant of get_device
adee9f3f3bbb RDMA/core: Depend on device_add() to add device attributes
954a8e3aea87 RDMA/cma: Protect cma dev list with lock
722c7b2bfead RDMA/{cma, core}: Avoid callback on rdma_addr_cancel()
f9d08f1e1939 RDMA/core: Rate limit MAD error messages
e1f540c3ed0e RDMA/core: Define client_data_lock as rwlock instead of spinlock
2d65f49ff961 RDMA/core: Use simpler spin lock irq API from blocking context
4512acd0d34c RDMA/core: Remove context entries from list while unregistering device
f7b65d9bf2db RDMA/core: Use simplified list_for_each
93688ddbe1da RDMA/core: No need to protect kfree with spin lock and semaphore
50704e039ab1 RDMA/umem: Restore lockdep check while downgrading lock
eb93c82ed8c7 RDMA/core: Document QP @event_handler function
4269024639f6 RDMA/core: Document CM @event_handler function
77addc524473 RDMA/core: Rename rdma_copy_addr to rdma_copy_src_l2_addr
a362ea1d9e1a RDMA/core: Introduce and use rdma_set_src_addr() between IPv4 and IPv6
[20 lines not shown]
OFED: Various changes from Linux 4.16
This contains changes from the following Linux commits:
c5c4e40e90b5 IB/CM: Change sgid to IB GID when handling CM request
54a6d63f14bd IB/mlx4: Potential buffer overflow in _mlx4_set_path()
56d0a7d9a0f0 IB/core: Depend on IPv6 stack to resolve link local address for RoCEv2
1060f8653414 IB/{core/cm}: Fix generating a return AH for RoCEE
981b5a2384b7 RDMA/cma: Introduce and use helper functions to init work
c42388053758 RDMA/cma: Avoid setting path record type twice
4367ec7fe2dd RDMA/cma: Simplify netdev check
151ed9d70097 IB/core: Refactor to avoid unnecessary check on GID lookup miss
b0dd0d335364 IB/core: Avoid unnecessary type cast
86937fcd6ed2 RDMA/core: Avoid redundant memcpy in rdma_addr_find_l2_eth_by_grh
1c43d5d308f0 IB/core: Avoid exporting module internal ib_find_gid_by_filter()
dbb12562f7c2 IB/{core, ipoib}: Simplify ib_find_gid to search only for IB link layer
f6bdb14267ba IB/{core, umad, cm}: Rename ib_init_ah_from_wc to ib_init_ah_attr_from_wc
4ad6a0245ec8 IB/{core, cm, cma, ipoib}: Rename ib_init_ah_from_path to ib_init_ah_attr_from_path
33f93e1ebcf5 IB/cm: Fix sleeping while spin lock is held
[37 lines not shown]
OFED: Various changes from Linux 4.19
Many of these changes deal with shifting from fetcing SGID attributes
via an index in drivers to including references to SGID attributes in
other structures passed to driver callbacks which can be used directly
avoiding the need for fetching attributes via lookup functions. I had
to fixup the ROCE GID management code directly as the version in
FreeBSD is very different from Linux.
I also tweaked the change from commit
475c8de7bf2dc86d9806709a04e9c8f524d4ec32 to use a goto to reduce diffs
with upstream to minimize conflicts when merging upstream changes.
This contains changes from the following Linux commits:
a1a4caeebac9 IB/core: Do not set the gid type when reserving default entries
1c36cf912ad1 IB/core: Store default GID property per-table instead of per-entry
1dfce2945771 IB: Replace ib_query_gid/ib_get_cached_gid with rdma_query_gid
83f6f8d29dd3 IB/core: Make rdma_find_gid_by_filter support all protocols
[57 lines not shown]
OFED: Various changes from Linux 4.18
This contains changes from the following Linux commits:
e822ff213fe6 IB/cm: Store and restore ah_attr during CM message processing
0e225dcb7681 IB/cm: Store and restore ah_attr during LAP msg processing
a5c57d327272 IB/cm: Avoid AV ah_attr overwriting during LAP message handling
724631a9c6e9 IB/core: Introduce and use rdma_gid_table()
25e62655c793 IB/core: Reduce the places that use zgid
08bb558ac11a IB/core: Make testing MR flags for writability a static inline function
Commit 0e225dcb7681 was partially merged previously as
cm_init_av_for_lap() already existed in FreeBSD matching the version
from the Linux commit.
Tested by: Wafa Hamzah <wafah at nvidia.com> (mlx5_ib)
Tested by: John Baldwin <jhb at FreeBSD.org> (iw_cxgbe)
Sponsored by: Chelsio Communications
OFED: Calculate UDP source port based on flow label or lqpn/rqpn
Calculate and set UDP source port based on the flow label. If flow label
is not defined in GRH then calculate it based on lqpn/rqpn.
Tested by: Wafa Hamzah <wafah at nvidia.com> (mlx5_ib)
Tested by: John Baldwin <jhb at FreeBSD.org> (iw_cxgbe)
Obtained from: Linux commit 18451db82ef7f943c60a7fce685f16172bda5106
Sponsored by: Chelsio Communications
OFED: A few channges from Linux 5.0
The main point of these changes is the last commit adding a couple of
helper functions used in ROCE drivers.
This contains changes from the following Linux commits:
a70c07397fd8 RDMA: Introduce and use GID attr helper to read RoCE L2 fields
8f9748602491 IB/cm: Reduce dependency on gid attribute ndev check
adb4a57a7a1d RDMA/cma: Use rdma_read_gid_attr_ndev_rcu to access netdev
b4fb4cc5ba83 RDMA/cma: Fix unbalanced cm_id reference count during address resolve
d5665a21250e RDMA/core: Add hash functions to calculate RoCEv2 flowlabel and UDP source port
Tested by: Wafa Hamzah <wafah at nvidia.com> (mlx5_ib)
Tested by: John Baldwin <jhb at FreeBSD.org> (iw_cxgbe)
Sponsored by: Chelsio Communications