Commit graph

291519 commits

Author SHA1 Message Date
Gavin Atkinson 71ed1adda8 grdc: add countdown timer mode
PR: 35113
Differential Revision:	https://reviews.freebsd.org/D43463
2024-05-10 09:22:38 -06:00
Warner Losh 06af7bd12a posix: POSIX-1.2008 moved SA_* from XSI to base standard
Starting with POSIX-1.2008, "The SA_RESETHAND, SA_RESTART, SA_SIGINFO,
SA_NOCLDWAIT, and SA_NODEFER constants are moved from the XSI option to
the Base." Make them so visible.

PR: 275328
Sponsored by:		Netflix
2024-05-10 09:20:21 -06:00
Justin Hibbits de1ac9462f conf: Generate fdt_static_dtb.h in OBJDIR
Though the kernel build expects ${.OBJDIR} to be equal to ${.CURDIR}
that may not always be the case.  Correctly generate fdt_static_dtb.h in
${.OBJDIR}, which is conceptually more correct anyway.

Obtained from:	Juniper Networks, Inc.
2024-05-10 14:35:50 -04:00
Justin Hibbits 10eea8dc8c tpm20: Support partial reads
Summary:
In some cases the TPM utilities may read only a partial block, instead
of a full block.  If a new command starts while in the middle of a read
it may cause the TPM to go catatonic and no longer respond to SPI.

Reviewed by:	kd
Obtained from:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D45140
2024-05-10 14:35:28 -04:00
Ed Maste 2e0c027e69 ukswitch: fix non-debug build
PR:		278847
Sponsored by:	The FreeBSD Foundation
2024-05-10 08:53:15 -04:00
Dag-Erling Smørgrav ad4f3bdf73 cat: Missed a couple.
MFC after:	3 days
Sponsored by:	Klara, Inc.
2024-05-10 13:05:45 +02:00
Dag-Erling Smørgrav c6f9df7064 cat: Check for lack of success rather than a specific failure.
MFC after:	3 days
Sponsored by:	Klara, Inc.
Reviewed by:	oshogbo
Differential Revision:	https://reviews.freebsd.org/D45149
2024-05-10 12:59:30 +02:00
Andrew Turner 634dd430b9 arm64: Update the page table list in locore
The comment describing the page tables was out of date. Update it with
the current list.

Sponsored by:	Arm Ltd
2024-05-10 09:29:24 +00:00
Andrew Turner 719908c813 arm64: Merge common page table creation code
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45061
2024-05-10 09:29:24 +00:00
Andrew Turner 4ab0f5ab3f arm64/gicv3: Check if the hardware supports LPIs
Some simulators have the ITS in the DTB passed to the kernel, however
it is a runtime configuration option to enable it.

Check the GICD_TYPER register to see if LPIs are enabled before
attaching the ITS driver.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D44914
2024-05-10 09:29:24 +00:00
Andrew Turner f91e9401c2 dev/psci: Check all compat strings
When searching for the PSCI FDT node we only check a few compat strings.
Use the existing compat_data array to check all strings the driver may
attach to.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D44913
2024-05-10 09:29:24 +00:00
Andrew Turner 797f1c7c3d arm64: Flush the spintable release address
Ensure the spintable release address is written back from the cache
to memory. The other CPUs reading this may not be reading it with the
cache enabled so ensure it is written to the point of coherency
before issuing the wakeup sev.

As cpu_dcache_wbinv_range includes the needed barrier remove it from
the inline asm before the sev instruction.

Reviewed by:	jhibbits, kevans
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45083
2024-05-10 09:29:24 +00:00
Andrew Turner c78ebc69c2 arm64: Support a shared release for spin-table
When releasing multiple CPUs that share a release address we need them
to wait for their turn to boot. Add a mechanism to do this by booting
them until they enable the TLB before waiting their turn to enter
init_secondary.

Reviewed by:	jhibbits, kevans
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45082
2024-05-10 09:29:24 +00:00
Andrew Turner e353ac0cfd am64: Allow cpu.h to be included from assembly
Reviewed by:	jhibbits, kevans
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45081
2024-05-10 09:29:24 +00:00
Dag-Erling Smørgrav 44e72c6e2e Add man page for nfslockd.
PR:		130238
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D45139
2024-05-10 11:23:13 +02:00
Ricardo Branco b01988d5e5 mdconfig: Print options when listing devices
PR: 278624
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1210
2024-05-09 22:43:09 -06:00
Paweł Krawczyk 042267e0cd Explain cron.d
Add details on the format of system cron files, which are mentioned in
cron(8) which refers here but barely explained here.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1106
2024-05-09 22:34:36 -06:00
Paweł Krawczyk 783baf0012 at cron file is now in /etc/cron.d
PR: 243380
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1106
2024-05-09 22:34:06 -06:00
Alexander Ziaee 5ccaab1797 sysexits: Tidy deprecated header and manual
<sysexits.h> was deprecated in the base system in a1432b4 for FreeBSD
8.0 and is retained only for backwards compatibility.  Make that clear,
since sysexits(3) suggested using it since it was in style(9) prior
to this.

MFC after:	1 week
Co-authored-by:	imp
Fixes:		a1432b4
Reviewed by:	imp, pauamma (previous version)
Pull Request	https://github.com/freebsd/freebsd-src/pull/1195
2024-05-09 20:50:48 -06:00
Lukas R. Jackson 9f91b8aaf5 Update README.md to add pointer to release page.
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1151
2024-05-09 20:40:46 -06:00
HP van Braam c733dc7a6f ahc(4): Default to memory mapped IO
When this driver was written it made sense to make this default to off,
but these days almost all BIOSses will do the right thing. Furthermore
non-mmio communication only works on Intel architectures.

So lets default to allowing mmio, but not change the semantics of the
AHC_ALLOW_MEMIO flag to not break existing installs. Also document the
already existing hint.ahc.<unit>.allow_memio.

Signed-off-by: HP van Braam <hp@tmm.cx>
Reviewed by: imp (small style tweak)
Pull Request: https://github.com/freebsd/freebsd-src/pull/1219
2024-05-09 20:15:08 -06:00
Ben Wilber 09025a7147 ipfw: correctly report table manipulation errors
Let ipfw(8) report the actual error instead of the error that
may have come from calling printf().

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1221
2024-05-09 20:08:18 -06:00
Justine Tunney 12be6f12e8 Fix memory corruption in C++ demangler
The __cxa_demangle_gnu3() and cpp_demangle_gnu3() functions segfault on
various libcxxabi test cases due to a copy and paste error. This change
fixes that.

This is a subset of https://github.com/libcxxrt/libcxxrt/pull/34 which
fixes the immediate problem.

Reviewed by: imp, emaste (I think)
Pull Request: https://github.com/freebsd/freebsd-src/pull/1222
2024-05-09 19:55:52 -06:00
Rick Macklem fbe965591f nfscl: Do not do readahead for directories
For a very long time, the NFS client has done readahead for
directory blocks.  Unlike data blocks, the readahead cannot
begin until the Readdir RPC reply has been received, since
the directory offset cookie in that Readdir RPC reply is needed.
As such, the readahead is serialized and does not seem to
provide any real benefit.

Recent testing/benchmarking shows that removing this
readahead code for Readdir does not have a negative impact
on performance.

Therefore, this patch deletes the readahead code for Readdir,
which simplifies the code and may make future changes simpler.

MFC after:	1 month
2024-05-09 18:35:10 -07:00
Simon J. Gerraty f77b5b295d Allow -DNO_STRICT_REGEX to restore historic regex behavior
Allow restoring the behavior of '{' as described in regex(3).
Ie. only treat it as start of bounds if followed by a digit.

If NO_STRICT_REGEX is not defined, the behavior introduced by
commit a4a801688c is retained,
otherwise the previous behavior is restored.

Differential Revision:	https://reviews.freebsd.org/D45134
2024-05-09 18:29:43 -07:00
Isaac Cilia Attard 6437872c1d New sysctl to disable NOMATCH until devmatch runs
Introduce hw.bus.devctl_nomatch_enabled and use it to suppress NOMATCH
until devmatch runs

There's a lot of NOMATCH events generated at boot. We also run devmatch
once during early boot to load unmatched devices. To avoid redundant
work, don't start generating NOMATCH events until after devmatch runs.
Set hw.bus.devctl_nomatch_enabled=1 just before we run devmatch. The
kernel will suppress NOMATCH events until this is set to true.

This saves about 170ms from the boot on aarch64 running atop Apple
M-series processors and the VMWare Fusion hypervisor.

Reviewed by:    imp, cperciva
MFC after:      3 days
Sponsored by:   Google Summer of Code
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1213
2024-05-09 17:56:40 -07:00
Dan McGregor 8c2f6c3be0 Address module reproducibility issues
Use .PATH & bare filename. This prevents the real source path from
being included in the built object, which improves reproducibility.

Signed-off-by: Dan McGregor <dan.mcgregor@usask.ca>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1211
2024-05-09 17:37:56 -06:00
Lexi Winter cd917a17bc arp.8: don't document a syntax that doesn't exist
The arp.8 manpage documents 'arp -d <addr> pub', but the 'pub' flag is
not accepted by the arp command.  Remove this incorrect documentation.

Reviewed by: imp, gleb, mp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1215
2024-05-09 17:26:52 -06:00
Elliott Mitchell d981797662 intr/x86: replace use of vector in interface with intsrc
Several x86 interrupt core functions were already operating on intsrc
structures.  Now switch the remaining 3 to intsrc for consistency.

Swap the order of intr_add_handler()'s first two arguments.  This
matches INTRNG and is more consistent with other functions in this
interface.

Differential Revision: https://reviews.freebsd.org/D35386
Reviewed by: imp, markj (previous version)
Pull Request: https://github.com/freebsd/freebsd-src/pull/1126
2024-05-09 17:15:07 -06:00
Elliott Mitchell 98c276811a arm: add missing atomic-pointer functions
The pointer function types were missing for these functions, so add
them.  Valuable for places where type sizes vary by architecture.

Differential Revision: https://reviews.freebsd.org/D37778
Reviewed by: imp, andrew
Pull Request: https://github.com/freebsd/freebsd-src/pull/1126
2024-05-09 17:14:59 -06:00
Elliott Mitchell 99adf661ab sys: declare bit sets unsigned
Substantially reduce the number of signed/unsigned issues (warnings if
enabled).  While these are presently disabled for FreeBSD, being able to
enable another warning would be good.

Differential Revision: https://reviews.freebsd.org/D32793
Reviewed by: imp, jhibbits
Pull Request: https://github.com/freebsd/freebsd-src/pull/1126
2024-05-09 17:14:41 -06:00
Elliott Mitchell 9f3a552f9e intrng: switch flag arguments to unsigned
The flag variables behind these are all unsigned.  As such adjust the
declarations to match reality and reduce the number of mismatches.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1126
2024-05-09 17:14:38 -06:00
Elliott Mitchell a9e0f316b3 kern/intr: redeclare intr_setaffinity()'s third arg constant
This matches reality and allows removal of a __DECONST().

Fixes: 4c72d075a5 ("LinuxKPI: const argument to irq_set_affinity_hint()")
Fixes: 9b33b154b5 ("Add support to cpuset for binding hardware interrupts")
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1126
2024-05-09 17:14:35 -06:00
Elliott Mitchell cd04887b95 kern/intr: change ->ie_irq to unsigned
All architecture implementations actually want this to be unsigned.
INTRNG the equivalent is overtly unsigned.  x86 and PowerPC merely avoid
the need to explicitly convert at several points.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1126
2024-05-09 17:14:33 -06:00
Elliott Mitchell e64318e76e arm/pmu: remove passing trap frame as argument
While otherwise a handy potential approach, getting the trap frame via
the argument isn't documented and isn't supposed to be used.  Adjust
pmu_intr() to instead use curthread->td_intr_frame, which is the proper
way.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1126
2024-05-09 17:14:29 -06:00
Christos Margiolis 24d5cc14dd sound: Rename oss_audioinfo->real_device to oss_audioinfo->legacy_device
The OSS manual now documents this field as "legacy_device".

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D45138
2024-05-09 21:08:34 +02:00
Christos Margiolis e6df8c379b sound: Add missing oss_mixerinfo devnode and legacy_device fields
They are missing from soundcard.h and are in fact used by some
applications, such as OSS' ossinfo(1):
http://manuals.opensound.com/developer/ossinfo.c.html

The new size for filler is chosen according to the most recent official
version of soundcard.h, which includes those 2 fields.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D45137
2024-05-09 21:08:28 +02:00
Christos Margiolis 59d98edae3 sound: Fix oss_sysinfo->numcards
According to the OSS manual, oss_sysinfo->numcards holds the number of
detected audio devices in the system, while the current ncards variable,
whose value is assigned to oss_sysinfo->numcards, holds the number of
currently registered devices only.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	dev_submerge.ch, emaste
Differential Revision:	https://reviews.freebsd.org/D45136
2024-05-09 21:08:01 +02:00
Christos Margiolis 2f31a5eb75 sound: Remove nmix variable from mixer_oss_mixerinfo()
nmix is used to compare against oss_mixerinfo->dev, which is a
user-supplied value to select the mixer device (if not -1, in which case
we'll select the default one) we want to fetch the information of. It is
also used to set oss_mixerinfo->dev in case it is -1.

However, nmix is at best redundant, since we have the loop counter
already (i), and confusing at worst.

For example, suppose a system with 3 mixer devices. We call
SNDCTL_MIXERINFO with oss_mixerinfo->dev=1, meaning we want to get
information for /dev/mixer1. Suppose /dev/mixer0 detaches while inside
the loop, so we'll hit the loop's "continue" case, and nmix won't get
incremented (i.e will stay 0 for now). At this point nmix counts 1
device less, so when it reaches 1, we'll be fetching /dev/mixer2's
information instead of /dev/mixer1's.

This is also true in case the mixer device disappears prior to the call
to mixer_oss_mixerinfo().

Simply remove nmix and use the loop counter to both set
oss_mixerinfo->dev and check against it in case a non -1 value is
supplied.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D45135
2024-05-09 21:07:48 +02:00
Florian Walpen 5687c71d5f snd_hdsp(4): RME HDSP 9632 and HDSP 9652 sound card driver.
Add a sound(4) bridge device driver for the RME HDSP 9632 and HDSP 9652
sound cards. These cards require a nowadays rare PCI 32bit (not PCIe)
slot, but still see use due to their value and wealth of features.
The HDSP 9632 is mostly comparable to the newer HDSPe AIO, while the
HDSP 9652 is similar to the HDSPe RayDAT. These HDSPe PCIe cards are
supported by the snd_hdspe(4) driver which was taken as a starting point
for development of snd_hdsp(4).

Implementation is kept separately due to substantial differences in
hardware configuration and to allow easy removal in case PCI 32bit
support would be phased out in the future.

The snd_hdsp(4) kernel module is not enabled by default, and can be
loaded at runtime with kldload(8) or during boot via loader.conf(5).
Basic operation was tested with both cards, not including all optional
cable connectors and expansion boards. Features should be roughly on par
with the snd_hdspe(4) supported cards.

Reviewed by:	christos, br
Differential Revision:	https://reviews.freebsd.org/D45112
2024-05-09 19:36:40 +01:00
Ed Maste 82f43db382 ip17x: fix non-debug build
PR:		278847
Reviewed by:	jhibbits
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45133
2024-05-09 14:22:11 -04:00
Alan Somers b2792a300d fusefs: make the tests more robust to changes to maxphys
Remove assumptions in two test cases that maxphys won't be huge.

Reported by:	kib
MFC after:	2 weeks
Sponsored by:	Axcient
2024-05-09 11:09:23 -06:00
Michael Tuexen 0d15140d6d sctp: minor cleanup
No functional chnage intended.
MFC after:	3 days
2024-05-09 00:51:09 +02:00
Michael Tuexen 8c37094036 sctp: allow stcb == NULL in sctp_shutdown()
Consistently handle this case.
Reported by:	Coverity Scan
CID:		1533813
MFC after:	3 days
2024-05-09 00:43:28 +02:00
Michael Tuexen 83dcc7790b sctp: don't provide uninitialized memory to process_chunk_drop()
Right now, the code in process_chunk_drop() does not look the
the corresponding fields.
Therefore, no functional change intended.
Reported by:	Coverity Scan
CID:		1472476
MFC after:	3 days
2024-05-09 00:17:13 +02:00
Michael Tuexen e187fa5690 sctp: fix sctp_sendall() when an mbuf chain is provided
In this case uio is NULL, which needs to be checked and m must
be copied into the sctp_copy_all structure.
Reported by:	Coverity Scan
CID:		1400449
MFC after:	3 days
2024-05-08 23:45:55 +02:00
Warner Losh 52e41d1a5b Update example from gcc6 to gcc13
We only "support" gcc12 and gcc13 for cross building, for some value of
"support". Update the example from gcc6 to gcc13.

Sponsored by:		Netflix
2024-05-09 08:16:15 -06:00
Michael Tuexen 3d40cc7ab8 sctp: add missing check
If memory allocation fails, m is NULL. Since this is possible,
check for it.
Reported by:	Coverity Scan
CID:		1086866
MFC after:	3 days
2024-05-08 23:03:34 +02:00
Kristof Provost f1612e7087 libpfctl: fix file descriptor leak
pfctl_get_rules_info() opened a netlink socket, but failed to close it again.
Fix this by factoring out the netlink-based function into a _h variant that
takes struct pfctl_handle, and implement pfctl_get_rules_info() based on that,
remembering to close the fd.

While here migrate all in-tree consumers to the _h variant.

MFC after:	3 days
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-05-09 14:07:07 +02:00
Roger Pau Monné ee72bc1d1f xen/debug: remove usage of sbuf_{clear,finish}() on drained sbuf
Using sbuf_clear() on a drained sbuf is explicitly prohibited, and using
sbuf_finish() after printing a trace leads to a single trace being printed, as
after calling sbuf_finish() further attempts to use the same sbuf will lead to
a panic.

While there also switch to using xen_emergency_print() instead of attempting to
write directly to the hypervisor console.  xen_emergency_print() can be
implemented per-arch to use a different mechanism than the console hypercall
(note the default implementation still uses the console hypercall).

Fixes: df62b8a25f ('xen: add a handler for the debug interrupt')
Sponsored by: Cloud Software Group
Reviewed by: markj
Differential review: https://reviews.freebsd.org/D45060
2024-05-09 12:50:08 +02:00