1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-24 07:40:52 +00:00
Commit Graph

295767 Commits

Author SHA1 Message Date
Warner Losh
17be774ee7 stand: unistd.h is no longer safe
unistd.h includes too much extra stuff for the boot loader. This creates
a fair amount of namespace pollution and it's best to just make it an
alias for stand.h like the other include files already are.

Sponsored by:		Netflix
2024-11-19 20:35:04 -07:00
Warner Losh
7255a2969f stand: Don't need sys/select.h
The boot loader doesn't need the types and prototypes defined in
sys/select.h, so don't indirectly include it.

Sponsored by:		Netflix
2024-11-19 20:35:04 -07:00
Warner Losh
c29cba408d stand: Narrow the 'signal emulation' we provide
We only need to provide sig_atomic_t in emulation. However, including
machine/signal.h brings in too much namespace pollution related to
signals. Instead, define sig_atomic_t as long. Setting long is async
atomic on all platforms (though powerpc64 defines it to an int), though
that doesn't matter since the boot loader doesn't use signals.

Sponsored by:		Netflix
2024-11-19 20:24:41 -07:00
Warner Losh
6a88766ecd stand: We don't want signal definitions in the boot loader
We don't support signals in the boot loader, so we don't need to include
sys/signal.h there. It pollutes the namespace.

Sponsored by:		Netflix
2024-11-19 19:57:46 -07:00
Warner Losh
c82ed437c6 sys/conf.h: Make more self-contained
struct cdev has members of type struct timespec. Include sys/_timespec.h
to so we don't need to rely on namespace pollution to define it.

Sponsored by: Netflix
2024-11-19 19:52:40 -07:00
Ed Maste
62dab3d016 getentropy: Remove fallback code
We don't in general support running newer libc on an older kernel, but
have occasionally added support for specific functionality on a case-by-
case basis.  When we do this it is usually done as an aid for developers
to get across a change that introduced new functionality, as for 64-bit
inodes and the introduction of the getrandom syscall.

The getrandom syscall was added in commit e9ac27430c ("Implement
getrandom(2) and getentropy(3)") in 2018, and exists in all supported
FreeBSD versions.  The ECAPMODE special case applied to a few months
worth of kernel versions also in 2018 -- fixed as of commit ed1fa01ac4
("Regen after r337998.").

The backwards-compatibility support is no longer needed, so remove it.

Relnotes:	Yes
Reviewed by:	brooks, cem, delphij
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D47636
2024-11-19 21:29:46 -05:00
Mark Johnston
3c29734502 hwpmc: Fix whitespace in logging macros
MFC after:	1 week
Sponsored by:	Klara, Inc.
2024-11-19 23:48:53 +00:00
Mark Johnston
e03a056de0 vfs: Fix runningspace tuning after maxphys was bumped
The previous maximum value for the upper watermark was based on the old
value of MAXPHYS.  Raise it to allow more parallel I/O on large systems.

This is still a rather flawed mechanism since it's applied without
regard to the number of filesystems or block devices between which this
mechanism sits, but we might as well bump the limits at this point, as
they haven't been revised in quite a long time.

Reviewed by:	imp, kib
MFC after:	2 weeks
Fixes:		cd85379104 ("Make MAXPHYS tunable. Bump MAXPHYS to 1M.")
Differential Revision:	https://reviews.freebsd.org/D47398
2024-11-19 23:46:50 +00:00
Artem Hevorhian
7678dac437 ktrace: support AF_NETLINK in ktrstruct
Right now, sockaddr_nl parameters are not displayed in kdump output,
however they are present in the structure in ktrace.out file when
ktrace is run.

Reviewed by:		melifaro, markj, glebius
Differential Revision:	https://reviews.freebsd.org/D47411
2024-11-19 14:19:50 -08:00
Mark Johnston
a20249443b makefs.8: Clarify that makefs-generated zpools always have the same GUID
PR:		282832
MFC after:	1 week
2024-11-19 21:18:38 +00:00
Mark Johnston
e19c607ff9 makefs.8: Remove a warning about makefs -t zfs being experimental
This should have been done with commit d9fe718287 but was missed.

Fixes:	d9fe718287 ("makefs: Remove the warning printed when makefs -t zfs is used")
MFC after:	3 days
2024-11-19 21:18:38 +00:00
Mark Johnston
e3f6ef5ade sdt: Stop defining probe and provider structures as arrays
There was no reason I can find for defining them this way.

No functional change intended.

Sponsored by:	Innovate UK
2024-11-19 21:18:34 +00:00
Mark Johnston
48c738b038 jail: Let a couple of parameter types be specified as lists
vnet.interface and zfs.dataset can be used to specify multiple
interfaces/datasets in jail.conf, but not on the command-line, which is
a bit surprising.  Extend the handling of ip(4|6).addr to those
parameters, update the description of vnet.interface in jail.8, and add
a rudimentary regression test.

Reviewed by:	zlei, jamie
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D47651
2024-11-19 21:05:24 +00:00
Mark Johnston
d6b692835e mii_fdt: Search for the "ethernet-ports" subnode
This is a more common name for the parent of the port nodes.

PR:		280770
MFC after:	2 weeks
Reported by:	Mike Belanger <mibelanger@qnx.com>
2024-11-19 21:05:19 +00:00
Mark Johnston
4ff291ebe8 vfs: Fix vop_stdis_text()
atomic(9) primitives are documented as operating on unsigned types.
Here, we need a cast to avoid a tautological comparison.

Add a regression test for access(2), which was affected by the bug.

Reported by:	NetApp
Reviewed by:	kib
Fixes:		e511bd1406 ("vfs: fully lockless v_writecount adjustment")
MFC after:	1 week
Sponsored by:	Klara, Inc.
Sponsored by:	NetApp, Inc.
Differential Revision:	https://reviews.freebsd.org/D47672
2024-11-19 21:03:14 +00:00
Kyle Evans
9ab59e900c daemon: tests: add a test for missed SIGTERM
This is somewhaht hard to test reliably, but we'll give it a shot.  Startup
a sleep(1) daemon with a hefty restart delay.  In refactoring of daemon(8),
we inadvertently started dropping SIGTERMs that came in while we were
waiting to restart the child, so we employ the strategy:

 - Pop the child sleep(1) first
 - Wait for sleep(1) to exit (pid file truncated)
 - Pop the daemon(8) with a SIGTERM
 - Wait for daemon(8) to exit

The pidfile is specifically truncated outside of the event loop so that we
don't have a kqueue to catch it in the current model.

PR:		277959
Reviewed by:	des, markj
Differential Revision:	https://reviews.freebsd.org/D47005
2024-11-19 13:51:27 -06:00
Kyle Evans
bc1dfc316a daemon: stop rebuilding the kqueue every restart of the child
We populate the kqueue with all of four kevents: three signal handlers and
one for read of the child pipe.  Every time we start the child, we rebuild
this kqueue from scratch for the child and tear it down before we exit and
check if we need to restart the child.  As a consequence, we effectively
drop any of the signals we're interested in between restarts.

Push the kqueue out into the daemon state to avoid losing any signal events
in the process, and reimplement the restart timer in terms of kqueue timers.
The pipe read event will be automatically deleted upon last close, which
leaves us with only the signal events that really get retained between
restarts of the child.

PR:		277959
Reviewed by:	des, markj
Differential Revision:	https://reviews.freebsd.org/D47004
2024-11-19 13:51:27 -06:00
Kyle Evans
aa8722cc18 daemon: truncate the pidfile when we're waiting to restart child
We need to be able to test some more restart behavior that depends on
knowing specifically where we're at (inside the event loop or outside of
the event loop).  Truncate the pidfile until the process is restarted to
give the test a clean marker rather than having to add arbitrary delays
and hoping for the best.

Reviewed by:	des, markj
Differential Revision:	https://reviews.freebsd.org/D47003
2024-11-19 13:51:26 -06:00
Andrew Turner
ce284dded5 arm64: Fix comparing ID register fields
The logic in update_special_reg_field was reversed. Fix by swapping the
order of the arguments.

PR:		282505
Fixes:		f1fb1d5c90 ("arm64: Support more ID register field types")
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D47437
2024-11-19 17:31:00 +00:00
Andrew Turner
9ff643a8da arm64: Adjust the MPASS in vfp_save_state_savectx
In vfp_save_state_savectx we check if the pcb has a NULL vfp state.
When it's called multiple times with the same pcb then we can panic
because the vfp state has been set.

Weaken the requirement for the state pointer to be NULL by also
allowing it to point to the pcb vfp state area we are about to use.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D47237
2024-11-19 17:31:00 +00:00
Andrew Turner
a1330a71d2 acpi: Handle multiple interrupts
When multiple IRQs are specified in a single resource then we only
check the first. Change this to check all interrupts for the value
we expect to find.

Without this we may still enable the interrupt, but it can have the
wrong polatiry or trigger. This can cause an interrupt storm if the
interrupt was configured with a level trigger when it should have
been an edge.

PR:		282241
Reported by:	trasz
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D47487
2024-11-19 17:14:42 +00:00
Dmitry Salychev
c2dd2be344
dpaa2: Fix kernel built with ACPI_DEBUG
PR:			282800
Reported by:		phk
Tested by:		bz
MFC after:		3 days
Differential Revision:	https://reviews.freebsd.org/D47666
2024-11-19 16:49:04 +01:00
John Baldwin
c7d29adcb3 vga_pci: Use bus_generic_* directly instead of wrappers
Differential Revision:	https://reviews.freebsd.org/D47375
2024-11-19 10:26:32 -05:00
John Baldwin
48a88a4ee9 socket: Move SO_SPLICE next to other socket option constants
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D47626
2024-11-19 10:25:49 -05:00
John Baldwin
590e7a0eb5 rangelock: Use atomic_testandset_ptr
Reviewed by:	imp, kib
Obtained from:	CheriBSD
Sponsored by:	AFRL, DARPA
Differential Revision:	https://reviews.freebsd.org/D47632
2024-11-19 10:25:08 -05:00
John Baldwin
a80b9ee15a atomic(9): Implement atomic_testand(clear|set)_ptr
For current architectures, these are just aliases for the existing
operation on the relevant scalar integer.

Reviewed by:	imp, kib
Obtained from:	CheriBSD
Sponsored by:	AFRL, DARPA
Differential Revision:	https://reviews.freebsd.org/D47631
2024-11-19 10:24:50 -05:00
John Baldwin
3ca22e1e8f atomic.9: Document atomic_testand*_64 and atomic_testandset_acq_long
Reviewed by:	kib
Sponsored by:	AFRL, DARPA
Differential Revision:	https://reviews.freebsd.org/D47630
2024-11-19 10:24:29 -05:00
John Baldwin
fa2091d757 atomic(9): Remove fcmpset-based fallback for atomic_testand(clear|set)
All architectures implement a MD version

Reviewed by:	kib
Sponsored by:	AFRL, DARPA
Differential Revision:	https://reviews.freebsd.org/D47629
2024-11-19 10:23:15 -05:00
John Baldwin
987c5a1944 arm: Implement atomic_testandset_acq_long as a simple wrapper
Use a memory barrier after calling the existing atomic_testandset_long
rather than using the fcmpset-based fallback version from
<sys/_atomic_subword.h>.

Reviewed by:	kib
Sponsored by:	AFRL, DARPA
Differential Revision:	https://reviews.freebsd.org/D47628
2024-11-19 10:22:50 -05:00
John Baldwin
a474e53d03 riscv: Add implementations of atomic_testand(set|clear)_(32|64|long)
These use amoor and amoand rather than a loop.

Also define atomic_testandset_acq_(64|long) using amoor.aq.

Reviewed by:	mhorne, kib
Sponsored by:	AFRL, DARPA
Differential Revision:	https://reviews.freebsd.org/D47627
2024-11-19 10:20:32 -05:00
Doug Rabson
ca1f1d2c94 release: Add missing dependencies in the minimal OCI image
The pkg-bootstrap binary depends on fetch.

Reviewed by:	cperciva, emaste, bapt
Differential Revision:	https://reviews.freebsd.org/D47661
MFC after:	1 day
2024-11-19 10:39:14 +00:00
Dag-Erling Smørgrav
d4fb5984ab mv: Add test cases for command-line options.
Sponsored by:	Klara, Inc.
Reviewed by:	asomers
Differential Revision:	https://reviews.freebsd.org/D47582
2024-11-19 10:29:15 +01:00
Dag-Erling Smørgrav
2822a79533 mv: Convert tests to ATF.
Sponsored by:	Klara, Inc.
Reviewed by:	asomers, markj
Differential Revision:	https://reviews.freebsd.org/D47569
2024-11-19 10:29:11 +01:00
Dag-Erling Smørgrav
dc6105ebed mv: More style nits.
Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D47568
2024-11-19 10:29:05 +01:00
Adrian Chadd
842a2c1ad3 uath: flush data/commands to the firmware before changing channel / state
The driver wasn't stable - it would start fine, but during scan
it would eventually hang and no further command endpoint transfers
would complete.

After adding some debugging and looking at the logs I noticed that
things went sideways once a /data/ frame was sent.  The channel
change config happened between the data frame being sent and
being completed.

My guess is that the firmware doesn't like a channel change
and reset whilst there's pending data frames.  Checking the Linux
driver I found that it was doing a flush before a channel change,
and we're doing it afterwards.  This acts like a fence around
ensuring scheduled TX work has completed.  In net80211 the
transmit path and the control path aren't serialised, so it's
very often the case that ioctls, state changes, etc occur
whilst in parallel there are frame transmits being scheduled.

This seems to happen more frequently on a more recent, high core
(8) machine with XHCI.  I remember testing this driver years ago
on single and dual core CPU laptops with no problems.

So, add some flushes - before a channel change, and during
a transition to AUTH when the BSS config is being programmed into
the firmware.  These two fences seem enough to reliably
associate as a 2GHz and 5GHz STA.

Note that this isn't entirely blocking all newly queued
transmit work from occuring until after the NIC has finished
configuration.  That will need some further investigation.

Locally tested:

  * Wistron NuWeb AR5523 dual-band NIC, STA mode, 2/5GHz

Differential Revision:	https://reviews.freebsd.org/D47655
2024-11-18 20:50:41 -08:00
Adrian Chadd
7098b90152 usb: fix the ID for the dual-band Wistron AR5523 USB NIC
Use the correct ID, as I have one of these NICs.
Add the previous one back in case it's out there in the wild.

@emaste did a bit of a dig into the product numbers.
@sam did change the ID from 0x0828 -> 082a in a commit
a long while back. It's worth reading the code review for
further details.

However, I do have one of these NICs and I verified that
it indeed has the given ID, and with some follow-up work
to fix some race conditions, it works fine in 2GHz 11bg
and 5GHz 11a operation.

Differential Revision:	https://reviews.freebsd.org/D47654

Obtained from:	Linux, drivers/net/wireless/ath/ar5523/ar5523.c
2024-11-18 20:50:24 -08:00
Adrian Chadd
1375790a15 net80211: add IEEE80211_IS_QOS_NULL()
This will be useful when fixing up the sequence number generation
and checks, as the rules around how sequence numbers are generated
have been clarified in 802.11-2016 and later.  QoS-NULL frames are
explicitly marked as "any sequence number".

But for now, just create a macro and use it in the one place
it's currently being used as a check - ath(4).

* Add IEEE80211_IS_QOS_NULL().
* Change the "will this frame go into the TX block-ack window" check
  in the ath(4) transmit path.  Note this changes the check to be
  more specific, but both paths already had previous checks to ensure
  they're QoS data frames.

Locally tested:

* ath(4), AR9380, STA mode w/ AMPDU TX/RX enabled and negotiated

Differential Revision: https://reviews.freebsd.org/D47645
2024-11-18 20:50:17 -08:00
Jose Luis Duran
21ca690b56
ppp.8: Fix typo cuad0 -> cuau0
Fix a typo that was missed probably because it was capitalized.
Mark up with .Pa and fix capitalization.

Specify that cuaUX and cuauX are for USB and UART attachments
respectively.

- Silence most lint warnings
- Update outdated links
- Minor style fixes
- Some igor(1) warnings were ignored on purpose

PR:		248359
Reviewed by:	imp, mhorne, Alexander Ziaee <concussious.bugzilla@runbox.com>
Approved by:	emaste (mentor)
Fixes:	839f11a4fe ("A number of places in the source tree still reference cuad.* after sio(4) was deprecated by uart(4).")
MFC after:	1 week
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1515
2024-11-19 01:04:20 +00:00
Bjoern A. Zeeb
5399052c63 bsdinstall: wlanconfig: fix interface UP on (re-)starting wpa_supplicant
Make sure an interface is back up before (re-)starting wpa_supplicant
in wlanconfig not relying on wpa to UP the interface (though we fixed
that).

Sponsored by:	The FreeBSD Foundation
Reviewed by:	emaste (in D47491)
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D47491
2024-11-19 00:06:16 +00:00
Gleb Smirnoff
dae64402b3 rtsock: fix panic in rtsock_msg_buffer()
The rtsock_msg_buffer() can be called without walkarg, just to calculate
required length.  It can also be called with a degenerate walkarg, that
doesn't have a w_req.  The latter happens when the function is called from
update_rtm_from_info() for the second time.

Zero init walkarg in update_rtm_from_info() and don't pass random stack
garbage as w_req.

In rtsock_msg_buffer() initialize compat32 boolean only once and take of
possible empty w_req.  Simplify the rest of code once compat32 is already
set.

Reviewed by:		melifaro
Differential Revision:	https://reviews.freebsd.org/D47662
Reported-by: syzbot+d4a2682059e23179e76e@syzkaller.appspotmail.com
Reported-by: syzbot+66d7c9b3062e27a56f3f@syzkaller.appspotmail.com
2024-11-18 14:12:42 -08:00
Franco Fichtner
43e045c173 atf: Guard libexec/atf with WITH_TESTS_SUPPORT
Other atf components are guarded by WITH_TESTS_SUPPORT already.
WITH_TESTS is for actual tests.

Reviewed by:	markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D47660
2024-11-18 18:36:46 +00:00
Kristof Provost
5eee34fa03 pf tests: check counters on anchors
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-11-18 18:57:53 +01:00
Graham Percival
10343013a4 manuals: Fix some .Bl -tag lists
Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Reviewed by:	mhorne, Alexander Ziaee <concussious.bugzilla@runbox.com>
MFC after:	3 days
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1528
2024-11-18 13:30:40 -04:00
Konstantin Belousov
645f8bcba9 ps.1: remove stray tab which breaks columns alignment
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2024-11-18 14:23:43 +02:00
Kristof Provost
83641335f9 pf: clean up pflow sockets on jail removal
pflow opens sockets in the kernel to transmit netflow information.
If this is done in a (vnet) jail these sockets end up preventing the removal of
the jail. The VNET_SYSUNINIT() vnet_pflowdetach() function doesn't get called,
but that's the function that would remove the sockets.

Install a callback on the PR_METHOD_REMOVE jail callback and close the sockets
there. This ensures that the jail can get cleaned up.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D47545
2024-11-18 11:06:46 +01:00
Peter Holm
43778a593f stress2: Added zfs test scenarios 2024-11-18 10:46:28 +01:00
Peter Holm
55aa53fbf2 stress2: Added a zfs regression test scenario 2024-11-18 10:40:16 +01:00
Matthew Nygard Dodd
f4f46a2eef hidraw(4): update hgd_actlen in HIDRAW_GET_REPORT ioctl
HIDRAW_GET_REPORT ioctl is documented to update hgd_actlen on return
with the number of bytes copied.  It does not do this.

Reviewed by:	wulf
PR:		282790
MFC after:	1 week
2024-11-18 07:31:39 +03:00
Matthew Nygard Dodd
0b5d86b38a uhid(4): update ugd_actlen in USB_GET_REPORT ioctl
USB_GET_REPORT ioctl is documented to update ugd_actlen on return with
the number of bytes copied.  It does not do this.

Reviewed by:	wulf
PR:		282790
MFC after:	1 week
2024-11-18 07:31:24 +03:00
Colin Percival
d54fdd1663 release: Remove empty suffix from file names
For "release" builds (as opposed to "snapshot" builds -- in this
context BETAs and RCs are "releases") ${SNAP_SUFFIX} is empty; but it
stuck into some ociimages filenames via a copy-and-paste error.

The final filenames on the download mirrors were not affected, so
this does not need to be merged to releng/14.2.

MFC after:	3 days
Sponsored by:	Amazon
2024-11-17 16:18:20 -08:00