Commit graph

292978 commits

Author SHA1 Message Date
Christos Margiolis 95eb4b873b sound tests: Add sndstat nvlist ATF test
Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch, markj
Differential Revision:	https://reviews.freebsd.org/D45901
2024-07-27 14:55:03 +03:00
Christos Margiolis c15c9315b2 sound: Implement dummy driver
Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D45967
2024-07-27 14:54:45 +03:00
Christos Margiolis f08ecd24a1 sound examples: Add sndstat nvlist example
Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D45969
2024-07-27 14:54:40 +03:00
Christos Margiolis cb00491fbc sound examples: Organize files in directories
More examples will be added, so it's better to be organized.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch, markj
Differential Revision:	https://reviews.freebsd.org/D45968
2024-07-27 14:54:35 +03:00
Christos Margiolis bd5bcc848c sound: Add OSS channel capabilities to sndstat nvlist
Assignment taken from dsp_oss_engineinfo().

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D46166
2024-07-27 14:54:27 +03:00
Christos Margiolis a628371757 sound: Add *vchanrate and *vchanformat to sndstat nvlist
Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D46164
2024-07-27 14:54:21 +03:00
Christos Margiolis 810530aa26 sound: Add device status string to sndstat nvlist
Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D46163
2024-07-27 14:54:14 +03:00
Warner Losh 56ecc8a932 pci_user: Rename _old to _freebsd6
The pre-freebsd7 stuff is labeled _old right now. Relabel it as
_freebsd6 instead. No functional change intended. I selected freebsd6
because that's the last version to have the ioctls, although I know
there were changes in the interface for 4, 5 and 6. This broadly batches
what we do with system calls that accumulate changes until we break and
use a new one, we use the last major the system call was in.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D45867
2024-07-26 17:21:22 -06:00
Doug Moore 1d897d19f3 netisr: avoid ffs(0)
A rearrangement to avoid computing ffs(0) saves 128 bytes in resulting
amd64 object code.

Reviewed by:	brooks
Differential Revision:	https://reviews.freebsd.org/D41254
2024-07-26 11:51:17 -05:00
Bjoern A. Zeeb 1f7df75701 LinuxKPI: move __kmalloc from slab.h to slab.c
In order to allow the allocator to change in the future move it into
the implementation file from being an inline function in the header.

While here factor out the size calculation and add a comment as-to why
this is done.  We will need the size (_s) in the future to make a
decision on how to allocate.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D45815
2024-07-26 11:51:04 +00:00
Konrad Witaszczyk 5c3af1d697 nullfs: Use an a_gen field to cast to vop_generic_args
Instead of casting a vop_F_args object to vop_generic_args, use a
vop_F_args.a_gen field when calling null_bypass(). This way we don't
hardcode the vop_generic_args data type in the callers of null_bypass().

Before this change, there were 3 null_bypass() calls using
a vop_F_args.a_gen field and 5 null_bypass() calls using a cast to
vop_generic_args. This change makes all null_bypass() calls consistent
and easier to maintain.

Pointed out by:	jrtc27
Reviewed by:	kib, oshogbo
Accepted by:	oshogbo (mentor)
Differential Revision: https://reviews.freebsd.org/D37359
2024-07-26 11:14:32 +00:00
Bjoern A. Zeeb 9776aba345 net80211: scan/internal: change boolean argument from int to bool
ieee80211_probe_curchan() passes a "force" argument which is bool.
Make it such.  Adjust the (*sc_scan_probe_curchan)() KPI to bool
as well. This is all a big NOP as the only implementor of this
function, ieee80211_swscan_probe_curchan(), does not use the argument
at all.

I came across this when pondering a different scan implementation.
Rather than dropping the change remove the argument from the function,
and push the cleanup out given it is purely net80211 internal code
(the argument may have reason for existance in the future).

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D45816
2024-07-26 11:07:39 +00:00
Bjoern A. Zeeb c179937b98 libc/getnameinfo: stop adding NI_NUMERICHOST where inappropriate
Checking the first nibble of the IPv6 address to be 0 and then
excluding two well known cases (v4-mapped, loopback) leaves us with
more cases where the first nibble could be 0, e.g., the RFC 6052,
2.1 Well-Known Prefix 64:ff9b::/96.
It is not practical to track them all and it is not clear what lead
to this special casing originally, so remove them.

While here also remove the IN6_IS_ADDR_LINKLOCAL() + NI_NUMERICHOST
case as link-local address resolution does exist.

We do leave the IN6_IS_ADDR_MULTICAST() case for now as I could
not find any references to any official reverse lookups for these.

Adding comments for more case (and some historic behaviour) in order
to make it easier to follow the logic.

PR:		279618
Fixes:		6cb9418289
MFC after:	6 weeks
Reviewed by:	hrs
Differential Revision: https://reviews.freebsd.org/D45547
2024-07-26 11:03:56 +00:00
Bjoern A. Zeeb 5668c22a13 LinuxKPI/lindebugfs: stop panicing in lindebugfs, fix simple_read_from_buffer
Trying to use lindebugfs for debugging wirless drivers two issues
became apparent:
(a) a panic in lindebugfs calling a hard coded release function if the
    caller had not provided one.  This seems to be based on assumptions
    that no longer hold up.  Remove the hard coded release function to
    prevent panics.
(b) In LinuxKPI simple_read_from_buffer() would call copy_to_user() but
    buffers weren't setup for this (lindebugfs copies data from its
    own buffer) and then pseudofs will do another copyout to the user
    on this;  remove the copy_to_user() and simply copy the data over
    to the provided buffer; this works for as long as the only consumers
    remain debugfs callers (which currently seems to be the case).
    [the only out-of-tree consumers I am aware off are two drm-kmod
    drivers/gpu/drm/amd/pm/* debugfs functions I cannot test].

Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Tested by:	jfree
Differential Revision: https://reviews.freebsd.org/D45755
2024-07-26 10:53:55 +00:00
Bjoern A. Zeeb 4fab5f0054 kern_malloc: fold free and zfree together into one __always_inline func
free() and zfree() are essentially the same copy and pasted code with
the extra explicit_bzero() (and formerly kasan) calls.  Add a bool to add
the extra functionality and make both functions a wrapper around the common
code and let the compiler do the optimization based on the bool input
when inlining.

No functional changes intended.

Suggested by:	kib (in D45812)
Sponsored by:	The FreeBSD Foundation
MFC after:	10 days
Reviewed by:	kib, markj
Differential Revision: https://reviews.freebsd.org/D46101
2024-07-26 10:46:37 +00:00
Bjoern A. Zeeb d1bdc2821f Deprecate contigfree(9) in favour of free(9)
As of 9e6544dd6e contigfree(9) is no longer
needed and should not be used anymore.  We leave a wrapper for 3rd party
code in at least 15.x but remove (almost) all other cases from the tree.

This leaves one use of contigfree(9) untouched; that was the original
trigger for 9e6544dd6e and is handled in D45813 (to be committed
seperately later).

Sponsored by:	The FreeBSD Foundation
Reviewed by:	markj, kib
Tested by:	pho (10h stress test run)
Differential Revision: https://reviews.freebsd.org/D46099
2024-07-26 10:45:01 +00:00
Alan Cox 5b8c01d13a amd64 pmap: Optimize PKU lookups when creating superpage mappings
Modify pmap_pkru_same() to update the prototype PTE at the same time as
checking the address range.  This eliminates the need for calling
pmap_pkru_get() in addition to pmap_pkru_same().  pmap_pkru_same() was
already doing most of the work of pmap_pkru_get().

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D46135
2024-07-26 00:38:46 -05:00
Brooks Davis f5c894479e Revert "Avoid division in round_up."
This reverts commit 2b229739e7.

Pull Request:	https://github.com/freebsd/freebsd-src/pull/1343
2024-07-26 00:11:11 +01:00
John F. Carr 2b229739e7 Avoid division in round_up.
Division may require a function call, leading to
dynamic function lookup, leading to deadlock in rtld.

Pull Request:	https://github.com/freebsd/freebsd-src/pull/1343
2024-07-26 00:00:28 +01:00
Mark Johnston feda329622 netinet6 tests: Add a regression test for default router handling
This serves as a regression test for commit a48df53e42.

Reviewed by:	bz, allanjude
MFC after:	2 weeks
Sponsored by:	Klara, Inc.
Sponsored by:	Bell Tower Integration
Differential Revision:	https://reviews.freebsd.org/D46136
2024-07-25 17:01:11 -04:00
Michael Tuexen 40299c55a0 tcp: implement challenge ACK throttling for the base stack
Implement ACK throttling of challenge ACKs as described in RFC 5961.

Reviewed by:		Peter Lei, rscheff, cc
MFC after:		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D46066
2024-07-25 13:54:52 +02:00
John Baldwin 399362bac3 nvmfd: Permit setting the MAXH2CDATA value via -H
This value is advertised to the remote host for TCP associations and
determines the maximum data payload size the remote host is permitted
to transmit in a single PDU.

Sponsored by:	Chelsio Communications
2024-07-25 15:33:15 -04:00
John Baldwin 7f73c04895 nvmfd: Correct usage description
During development the command line options for PDU digests for
nvmecontrol(8) and nvmfd(8) were renamed to align with Linux's nvme(1)
command, but the usage description in nvmfd(8) had a mix of the old
and new options.

Sponsored by:	Chelsio Communications
2024-07-25 15:32:44 -04:00
John Baldwin 846d702f23 libnvmf: Reject invalid values of MAXH2CDATA for new associations
Sponsored by:	Chelsio Communications
2024-07-25 15:32:42 -04:00
John Baldwin fd0e6af5e4 libnvmf: Require MAXH2CDATA to be a multiple of 4
The spec says MAXH2CDATA to is "a multiple of dwords and should be no
less than 4,096".

Sponsored by:	Chelsio Communications
2024-07-25 15:32:38 -04:00
John Baldwin 6549718b70 nvmfd: Stop setting MAXR2T in association parameters
This is only used for the host side of an association.  The controller
obtains this value from the host during connection negotiation.

Sponsored by:	Chelsio Communications
2024-07-25 15:30:52 -04:00
John Baldwin 5d0498db47 nvmf_tcp: Rename max_c2hdata sysctl to max_transmit_data
This sysctl sets a cap on the maximum payload of transmitted data PDUs
including both C2H_DATA and H2C_DATA PDUs, not just C2H_DATA PDUs.

Sponsored by:	Chelsio Communications
2024-07-25 15:29:43 -04:00
Bjoern A. Zeeb 4aff4048f5 LinuxKPI: 802.11: support manual lladdr changes
Allow a user to change the "ether" address by ifconfig while a VAP is
not UP.  Compared to net80211 (given we have no callback) we register
an eventhandler per-vif (a global one would force us to use hacks to
derive if a vap is indeed also a lkpi_80211 vif).

Sponsored by:	The FreeBSD Foundation
PR:		277356
Tested by:	lwhsu
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D46121
2024-07-25 18:42:26 +00:00
Osama Abboud 9baed398ee Add osamaabb as src committer and cperciva as mentor
Approved by:   cperciva (mentor)
2024-07-25 18:11:58 +00:00
Dimitry Andric 55a2a91c5e Merge commit 28a2b85602a5 from llvm-project (by Kazu Hirata):
[DeadStoreElimination] Use SmallSetVector (NFC) (#79410)

  The use of SmallSetVector saves 0.58% of heap allocations during the
  compilation of a large preprocessed file, namely X86ISelLowering.cpp,
  for the X86 target.  During the experiment, the final size of ToCheck
  was 8 or less 88% of the time.

Merge commit 9e95c4947d31 from llvm-project (by Nikita Popov):

  [DSE] Fix non-determinism due to address reuse (#84943)

  The malloc->calloc fold creates a new MemoryAccess, which may end of at
  the same address as a previously deleted access inside SkipStores.

  To the most part, this is not a problem, because SkipStores is normally
  only used together with MemDefs. Neither the old malloc access nor the
  new calloc access will be part of MemDefs, so there is no problem here.

  However, SkipStores is also used in one more place: In the main DSE
  loop, ToCheck entries are checked against it. Fix this by not using
  SkipStores here, and instead using a separate set to track deletions
  inside this loop. This way it is not affected by the calloc optimization
  that happens outside it.

  This is all pretty ugly, but I haven't found another good way to fix it.
  Suggestions welcome.

  No test case as I don't have a reliable DSE-only test-case for this.

  Fixes https://github.com/llvm/llvm-project/issues/84458.

This fixes another possible difference in output when building i386
object files with a native or cross build of clang. (Specifically, the
file sbin/ipf/ipmon/ipmon.o.)

PR:		276961
Reported by:	cperciva
MFC after:	3 days
2024-07-25 20:03:01 +02:00
Cheng Cui 9565854ab4
cc_cubic: remove the redundant variable num_cong_events from struct cubic.
Summary:
This variable was added by commit eb5bfdd065, but unnecessarily needed.
No functional change.

Reviewed by: tuexen

Differential Revision: https://reviews.freebsd.org/D46042
2024-07-25 13:11:32 -04:00
Bjoern A. Zeeb e8fe3b9e73 arm64: turn on IEEE80211 debugging and IEEE80211_SUPPORT_MESH too
Like we do for other architectures, add IEEE80211_SUPPORT_MESH support
to the kernel config on arm64.

Like we do with, e.g., USB_DEBUG, add IEEE80211_DEBUG too on main
(std.nodebug will turn this off).

Sponsored by:	The FreeBSD Foundation
X-MFC:		no
Reviewed by:	andrew
Differential Revision: https://reviews.freebsd.org/D45817
2024-07-25 16:29:24 +00:00
Michal Meloun 5670b8cc36 libthr: Preresolve selected EABI symbols on arm.
Add the ability to pre-resolve architecture-specific EABI symbols and
use it on arm for selected EABI functions. These functions can be called
with rtld bind lock write-locked, so they should be resolved in forward.

Reported by:	Mark Millard <marklmi@yahoo.com>, John F Carr <jfc@mit.edu>
Reviewed by:	kib, imp
MFC after:	1 week
Differential Revision:  https://reviews.freebsd.org/D46104
2024-07-25 18:24:22 +02:00
Bjoern A. Zeeb 59d262fe96 LinuxKPI: 802.11 compile in debugging based on IEEE80211 debugging
If IEEE80211 debugging is turned on in kernel configs also turn on
LinuxKPI 802.11 and SKB debugging (sysctls) to have them available.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D45820
2024-07-25 15:06:46 +00:00
Bjoern A. Zeeb db8b357862 LinuxKPI: 802.11: implement ieee80211_sn_*()
Implement ieee80211_sn_*() using the equivalent net80211 macros.
We need those implemented for at least 11n.
While here also sort all the BA functions together next to the
"sn" functions.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D45819
2024-07-25 15:03:42 +00:00
Mark Johnston a48df53e42 nd6: Fix the routing table subscription
The nd6 code listens for RTM_DELETE events so that it can mark the
corresponding default router as inactive in the case where the default
route is deleted.  A subsequent RA from the router may then reinstall
the default route.

Commit fedeb08b6a broke this for non-multipath routes, as
rib_decompose_notification() only invokes the callback for multipath
routes.  Restore the old behaviour.  Also ensure that we update the
router only for RTM_DELETE notifications, lost in commit 2259a03020.

Reviewed by:	bz
Fixes:	fedeb08b6a ("Introduce scalable route multipath.")
Fixes:	2259a03020 ("Rework part of routing code to reduce difference to D26449.")
MFC after:	2 weeks
Sponsored by:	Klara, Inc.
Sponsored by:	Bell Tower Integration
Differential Revision:	https://reviews.freebsd.org/D46020
2024-07-25 10:27:39 -04:00
Bjoern A. Zeeb bd206a6f4a LinuxKPI: 802.11: consistently spell TRACE-RX: as such
We have TRACE in one place and TRACE-RX in another.  Spell it
"TRACE-RX: %s: ..." everywhere.  Helps with pattern matching.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D45818
2024-07-25 13:52:57 +00:00
Kristof Provost 250e074e5f pfctl tests: fix dependency
Ensure that we rebuild the test binary when we add tests (i.e. modify
pfctl_test_list.inc).

MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-07-25 15:06:25 +02:00
Juraj Lutter a8a9527736 pfctl: Allow a semicolon (;) as a comment
To make parsing of, for example, Spamhaus' drop.txt and similar
files that contains semicolons as comments, allow them also
in file-based tables.

Reviewed by:	kp
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D46088
2024-07-25 15:06:24 +02:00
Bjoern A. Zeeb 4d8c65b466 LinuxKPI: remove dummy kstrtox.h
kstrtox.h has an implementation nowadays.  Remove the dummy file
which is no longer needed.

Sponsored by:	The FreeBSD Foundation
2024-07-25 12:42:49 +00:00
Jose Luis Duran 8edd6c07c8 nuageinit: Fix tests
Some checks failed
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-14, /usr/lib/llvm-14/bin, ubuntu-22.04, bmake libarchive-dev clang-14 lld-14, amd64, amd64) (push) Failing after 2m17s
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-14, /usr/lib/llvm-14/bin, ubuntu-22.04, bmake libarchive-dev clang-14 lld-14, arm64, aarch64) (push) Failing after 2m19s
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-13, /opt/homebrew/opt/llvm@13/bin, macos-latest, bmake libarchive llvm@13, arm64, aarch64) (push) Has been cancelled
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-13, /opt/homebrew/opt/llvm@13/bin, macos-latest, bmake libarchive llvm@13, amd64, amd64) (push) Has been cancelled
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-12, /usr/lib/llvm-12/bin, ubuntu-20.04, bmake libarchive-dev clang-12 lld-12, arm64, aarch64) (push) Has been cancelled
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-12, /usr/lib/llvm-12/bin, ubuntu-20.04, bmake libarchive-dev clang-12 lld-12, amd64, amd64) (push) Has been cancelled
Commit 07d17ca189 set the recommended
permissions for the SSH authorized keys file and directory.  The tests,
however, were failing on CI.

Use stat to check for the proper permissions.

Fixes:	07d17ca189 nuageinit: Set recommended SSH permissions
Reported by:	Jenkins
2024-07-25 11:15:29 +02:00
Jose Luis Duran 7aecd689e3 nuageinit: Fix the homedir variable name
cloud-init uses homedir, not home.
2024-07-25 11:15:29 +02:00
Jose Luis Duran 1991946cff CODEOWNERS: Add nuageinit 2024-07-25 11:15:29 +02:00
Alan Cox 98dd639c94 arm64 pmap: Eliminate an unnecessary conditional
Eliminate an unnecessary test whether a pointer is non-NULL from
pmap_bti_same().

Reviewed by:	dougm
2024-07-25 01:46:47 -05:00
Kirk McKusick cab41e0dd3 Do not allow snapshots on UFS filesystems using gjournal.
The gjournal implementation does not properly handle the freeing
of blocks that may be part of a snapshot. Adding this support to
gjournal would require considerable effort. For now we simply
do not allow snapshots to be taken on filesystems using gjournal.

Reported by: ant_mail@inbox.ru
PR:          280216
MFC after:   1 week
2024-07-24 23:10:47 -07:00
Warner Losh 4eee292ab6 Revert "cam: better ioctl compatibility for cd"
This reverts commit 028b16e208.

The wrong version wound up in my branch, revert while I find the right
version.

Sponsored by:		Netflix
2024-07-24 23:09:57 -06:00
Allan Jude 169d069116 smbios: Compile into the kernel more completely
Compile more of the IPMI into the kernel, and include all the
dependencies in ipmi.ko.

Sponsored by:		Netflix
Reviewed by:		andrew
Differential Revision:	https://reviews.freebsd.org/D45765
2024-07-24 23:09:57 -06:00
Warner Losh 5a0e9036d8 ipmi: Sort ipmi lines.
Sponsored by:		Netflix
2024-07-24 23:09:57 -06:00
Warner Losh 2e35684a03 arm64: Add smbios to kernel
Sponsored by:		Netflix
Reviewed by:		gallatin, andrew
Differential Revision:	https://reviews.freebsd.org/D45764
2024-07-24 23:09:57 -06:00
Warner Losh 06326613af smbios: Add length sanity checking
D28743 was commited, reverted and then f689cb23b2 landed before it
was recommitted. However, D28743 included an extra length check. Redo
that functionality so we check both the number of entries as well as the
length checks for wacky data.

Sponsored by:		Netflix
Reviewed by:		gallatin
Differential Revision:	https://reviews.freebsd.org/D45763
2024-07-24 23:09:57 -06:00