Commit graph

291537 commits

Author SHA1 Message Date
John Baldwin 9e0164087c vm: Change the return types of kernacc and useracc to bool
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D45156
2024-05-10 13:43:56 -07:00
John Baldwin 473c90ac04 uio: Use switch statements when handling UIO_READ vs UIO_WRITE
This is mostly to reduce the diff with CheriBSD which adds additional
constants to enum uio_rw, but also matches the normal style used for
uio_segflg.

Reviewed by:	kib, emaste
Obtained from:	CheriBSD
Differential Revision:	https://reviews.freebsd.org/D45142
2024-05-10 13:43:36 -07:00
John Baldwin f75764fea3 md: Merge two switch statements in mdstart_vnode
While here, use bp->bio_cmd instead of auio.uio_rw to drive read vs
write behavior.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D45155
2024-05-10 13:43:23 -07:00
Michael Tuexen 5120ea0d88 sctp: improve heartbeat timer computation
PR:		278666
Reviewed by:	Albin Hellqvist
MFC after:	3 days
Pull Request:	https://reviews.freebsd.org/D45107
2024-05-10 21:02:56 +02:00
Warner Losh 88cbbbb607 Revert "grdc: Add copyright"
It turns out this wasn't in 4.4BSD. I had a false positive for gdc.c
(which is in 4.4BSD, but part of gated, not this). gdc.c comes from the
ncurses tests, so it shouldn't have this copyright. This version is
mostly Amos Shapir and John Lupien's code. It comes from ncurses test
directory. ncurses has made dozens of improvements to this file since
we imported it in 1997 (which pre-dates their online history), so it's
not clear if their new copyright applies (which doesn't mention Amos
or John) or if some other copyright applies. In any case, it wasn't
4.4BSD, so revert this.

This reverts commit 6ed7d0e3ac.

Sponsored by:		Netflix
2024-05-10 14:12:19 -06:00
Michael Tuexen b67716dd58 sctp: store heartbeat creation time as time_t
Reported by:	Coverity Scan
CID:		1493087
MFC after:	3 days
2024-05-10 20:40:15 +02:00
Michael Tuexen 42aeb8d490 sctp: store vtag expire time as time_t
Reported by:	Coverity Scan
CID:		1492525
CID:		1493239
MFC after:	3 days
2024-05-10 20:28:38 +02:00
Ed Maste 4e32868183 Increase IOAPIC_MAX_ID to 255 (from 254)
A test system provided by AMD panicked with "madt_parse_apics:
I/O APIC ID 255 too high".  I/O APIC ID 255 is acceptable, so increase
the limit.

Reviewed by:	jhb, kib
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45157
2024-05-10 15:40:18 -04:00
Michael Tuexen 9d8a3718e2 sctp: store cookie secret change time as time_t
Reported by:	Coverity Scan
CID:		1492349
CID:		1493281
MFC after:	3 days
2024-05-10 20:14:16 +02:00
Ed Maste 0b272e0926 madt: print CPU APIC ID as signed int
Instead of printing something like "MADT: Found CPU APIC ID 4294967295
ACPI ID 512: disabled" print the APIC ID as a singed int for a more
user-friendly -1.

Reviewed by:	jhb
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45158
2024-05-10 15:20:40 -04:00
Simon J. Gerraty dd4d206cad kmod.mk use ${XARGS}
Also ${XARGS_J} this allows use of non-BSD xargs when building
kernel modules.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D45146
2024-05-10 12:05:05 -07:00
John Baldwin 50884a0b09 nvmf_transport: Remove invalid assertion
This is leftover from an earlier iteration of the code where 'nt' was
not dynamically allocated but was the passed in 'ops' pointer so was
always alive.

Reported by:	Coverity Scan
CID:	 	1545042
Sponsored by:	Chelsio Communications
2024-05-10 09:13:40 -07:00
John Baldwin 1f83483d73 ctl_backend_block: Correct value of NVME nsdata nuse field
Reported by:	Coverity Scan
CID:	 	1545043
Sponsored by:	Chelsio Communications
2024-05-10 09:13:40 -07:00
John Baldwin 1662e47d91 nvmecontrol: Free the addrinfo list when failing to open a TCP socket
Reported by:	Coverity Scan
CID:	 	1545048
Sponsored by:	Chelsio Communications
2024-05-10 09:13:40 -07:00
John Baldwin 0ac468c7b6 nvmecontrol: Free array of I/O queue pairs on failure to handoff
This is harmless but cleaner.

Reported by:	Coverity Scan
CID:	 	1545041,1545049
Sponsored by:	Chelsio Communications
2024-05-10 09:13:21 -07:00
John Baldwin 1f029b86bb nvmf: Use strlcpy instead of strncpy to ensure termination
Reported by:	Coverity Scan
CID:	 	1545054
Sponsored by:	Chelsio Communications
2024-05-10 08:56:51 -07:00
John Baldwin bf1820f187 nvmecontrol: Fix a sizeof mismatch
In this case it is harmless since it is an array of pointers so the
resulting length is identical.

Reported by:	Coverity Scan
CID:		1545055
Sponsored by:	Chelsio Communications
2024-05-10 08:54:02 -07:00
Warner Losh 6ed7d0e3ac grdc: Add copyright
Add the stock BSD copyright and license from the 4.4-Lite distribution
(indirected by SPDX).

Sponsored by:		Netflix
2024-05-10 09:22:44 -06:00
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