Commit Graph

285712 Commits

Author SHA1 Message Date
Emmanuel Vadot
cb7aa33ac6 Import device-tree files from Linux 6.3
Sponsored by:   Beckhoff Automation GmbH & Co. KG
2023-08-09 15:30:56 +02:00
Emmanuel Vadot
4a8223f297 Import device-tree files from Linux 6.3 2023-08-09 15:30:20 +02:00
Emmanuel Vadot
8bab661a33 Import device-tree files from Linux 6.2
Sponsored by:   Beckhoff Automation GmbH & Co. KG
2023-08-09 15:29:14 +02:00
Emmanuel Vadot
c227958a72 Import device-tree files from Linux 6.2 2023-08-09 15:28:30 +02:00
Emmanuel Vadot
7ef62cebc2 Import device-tree files from Linux 6.1
Sponsored by:   Beckhoff Automation GmbH & Co. KG
2023-08-09 15:27:37 +02:00
Emmanuel Vadot
582be9a443 Import device-tree files from Linux 6.1 2023-08-09 15:06:51 +02:00
Marius Strobl
9cb4ee9a64 man4: Remove stale MLINK to ath_pci.4
Reported by:	Jose Luis Duran
Fixes:	37c8ee8847 ath(4): Remove MIPS AHB frontend and join PCI one w/ main support again
2023-08-09 14:35:25 +02:00
Mateusz Guzik
b8b33f3b3b vfs: retire NAMEI_DIAGNOSTIC
It is too spammy and information-deficient for practical use.

Also see https://reviews.freebsd.org/D41207
2023-08-09 10:37:13 +00:00
Emmanuel Vadot
393387820b arm64: rockchip: rk_i2c: Probe again at ORDER_LATE
The gic driver is also probed at this pass and depending on the order of
the nodes in the dts rk_i2c can be probed first and will fail, this is the
case for the rk3328 SoC.
The PMIC drivers are also probed at this pass but on the iicbus which is created
in rk_i2c so there is no order conflict here.

Fixes:		ddefad7c4f ("arm64: rockchip: Tweak i2c, pmic and iodomain order")
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2023-08-09 10:50:04 +02:00
Michael Tuexen
85e5480df9 sctp: another cleanup
No functional change intended.

MFC after:	1 week
2023-08-09 04:17:52 +02:00
Doug Moore
15047a6509 rangesets: use PCTRIE_DEFINE
subr_rangeset.c is the only source file that calls functions like
pctrie_insert and pctrie_remove directly; other users of pctries use
the PCTRIE_DEFINE macro to define interfaces to pctrie that let them
ignore issues of offsets within structs and uint64_t return values.

Change subr_rangeset.c to use PCTRIE_DEFINE too. And change pctrie.h
to mark the lookup function as unused, to avoid warnings when
compiling files, like subr_rangeset.c, that don't invoke lookup().

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D41391
2023-08-09 02:26:25 -05:00
Konstantin Belousov
28b36ecf99 Revert "exit1(): Revert sparc64 workaround"
This reverts commit 96c76d9306.

There are other relatively common reasons why init might get killed
during reboot, the workaround was really not sparc64-specific.

Discussed with:	marius
Sponsored by:	The FreeBSD Foundation
2023-08-09 09:00:20 +03:00
Konstantin Belousov
21a52f9944 libc dlfcn.c: make dl_iterate_phdr() from libc more useful
Apparently there are applications that resolve dl_iterate_phdr from libc
and try to call the symbol. Our libc only provides stubs for dl* to
satisfy static linker or statically linked binaries, and is not prepared
to this situation.

Add a code to dso libc to find real dl_iterate_phdr and redirect the
call to it.

Reported by:	yuri
PR:	272992
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2023-08-09 08:07:05 +03:00
Konstantin Belousov
0f613ab85e tmpfs: add a knob to enable pgcache read for mount
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D41334
2023-08-09 06:54:15 +03:00
Konstantin Belousov
821dec4d56 vnode io: request range-locking when pgcache reads are enabled
PR:	272678
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D41334
2023-08-09 06:54:15 +03:00
Konstantin Belousov
651fdc3d19 Revert "vnode read(2)/write(2): acquire rangelock regardless of do_vn_io_fault()"
This reverts commit 5b353925ff.

The reason is the lesser scalability of the vnode' rangelock comparing
with the vnode lock.

Requested by:	mjg
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D41334
2023-08-09 06:54:15 +03:00
Ed Maste
07d3738b82 soxstack: silence GCC warning
Add parens around _STACK_FLAG_GROWS expression to fix GCC warning about
arithmetic in operand of '|'.

Sponsored by:	The FreeBSD Foundation
2023-08-08 21:15:19 -04:00
Kirk McKusick
6dff61a1d1 Rate limit kernel UFS/FFS cylinder group check-hash error messages.
When a large file is deleted or a large number of files are deleted,
even a single cylinder group with a bad check hash can generate
thousands of check-hash warnings. As with other filesystem messages
such as out-of-space, print a maximum of one check-hash error per
second. Note the limit is per filesystem. If two filesystems have
cylinder group(s) with a bad check hash, each will print a maximum
of one check-hash error message per second.

MFC-after:    1 week
Sponsored-by: The FreeBSD Foundation
2023-08-08 17:11:04 -07:00
Dmitry Chagin
76f28f656e tests: Fix build after 8920c5f2
MFC after:		2 weeks
2023-08-09 00:39:35 +03:00
R. Christian McDonald
9f2cddd261 ping: use the in6_addr buffer when parsing src address as AF_INET6
Reviewed by:	kp
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-08-08 23:21:49 +02:00
Marius Strobl
76fc279f1b ObsoleteFiles.inc: Correct typo
Fixes:	37c8ee8847 ath(4): Remove MIPS AHB frontend and join PCI one w/ main support again
2023-08-08 22:52:16 +02:00
Marius Strobl
37c8ee8847 ath(4): Remove MIPS AHB frontend and join PCI one w/ main support again
Following the removal of general MIPS support, there's no longer a need
to have the AHB bus-frontend in place, which according to Linux sources
also isn't used with any non-MIPS SoCs. For simplicity, PCI bus support
is only made conditional on the main one again, i. e. device ath_pci is
removed, and built into the main module, i. e. if_ath_pci.ko obsoleted,
respectively.
Effectively, this reverts the following commits and associated changes:
dba9c85977
e849bb3ecb

Approved by:	adrian
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D41354
2023-08-08 22:30:13 +02:00
Stephen J. Kiernan
458e0c1b66 local.sys.dirdeps.mk: Allow CROSS_TARGET_FLAGS to be overridden
Use ?= when setting CROSS_TARGET_FLAGS so we do not override it
if another file already has set it.

Reviewed by:	sjg
Obtained from:	Juniper Networks, Inc.
2023-08-08 16:11:27 -04:00
Warner Losh
09c20a2932 nvme: Move bools to fill hole
The two bools in nvme_request create a 6 byte hole today. Move them to
after retires to fill the 4 byte hole there and add a spare[2] to make
nvme_request 8 bytes smaller. spare[2] isn't strictly necessary, but
documents how many bytes we have left in that hole, as the number of
booleans will increase shortly.

Suggested by:		chuck
Sponsored by:		Netflix
2023-08-08 11:44:51 -06:00
Warner Losh
3e1f69523b modules: Use MACHINE_CPUARCH more
Replace two cases of MACHINE_ARCH with MACHINE_CPUARCH and also use
`aarch64` instead of the improper `arm64` for that test.

Noticed by:		Mark Millard
Sponsored by:		Netflix
2023-08-08 11:44:51 -06:00
Kyle Evans
2f489a509e libc: fix some overflow scenarios in vis(3)
The previous incarnation of this would call wcrtomb() on the destination
buffer, and only check for overflow *after* it's happened.
Additionally, the conversion error / VIS_NOLOCALE path also didn't check
for overflow, and the overflow check at the end didn't account for the
fact that we still need to write a NUL terminator afterward.

Start by only doing the multibyte conversion into mbdst directly if we
have enough buffer space to guarantee it'll fit.  An additional
MB_CUR_MAX buffer has been stashed on the stack to write into if we're
cutting it close at the end of the buffer, since we don't really have a
good way to determine the length of the wchar_t without just doing the
conversion.  We'll do the conversion into the buffer that's guaranteed
to fit, then copy it over if the copy won't overflow.

The byte-for-byte overflow is a little bit easier, as we simply check
for overflow with each byte written and make sure we can still NUL
terminate after.

Tests added to exercise these edge cases.

Reviewed by:	des
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D41328
2023-08-08 12:01:52 -05:00
Dmitry Chagin
8920c5f2a1 tests: Add stack grows tests
Reviewed by:		kib
Differential Revision:	https://reviews.freebsd.org/D41320
MFC after:		2 weeks
2023-08-08 18:12:09 +03:00
Mike Karels
58a46cfd75 md driver compat32: fix structure padding for arm, powerpc
Because the 32-bit md_ioctl structure contains 64-bit members, arm
and powerpc add padding to a multiple of 8.  i386 doesn't do this.
The md_ioctl32 definition was correct for amd64/i386 without padding,
but wrong for arm64 and powerpc64.  Make __packed__ conditional on
__amd64__, and test for the expected size on non-amd64.  Note that
mdconfig is used in the ATF test suite.  Note, I verified the
structure size for powerpc, but was unable to test.

MFC after:	1 week
Reviewed by:	jrtc27
Differential Revision:	https://reviews.freebsd.org/D41339
Discussed with:	jhibbits
2023-08-08 09:09:03 -05:00
Emmanuel Vadot
ddefad7c4f arm64: rockchip: Tweak i2c, pmic and iodomain order
We need i2c first to set it to MIDDLE, then we need one of the pmics
so set them to LATE, only then we can attach iodomain which needs some
regulators exposed by the pmic so set it to LAST.

Sponsored by:	Beckhoff Automation GmbH & Co. KG
2023-08-08 15:58:26 +02:00
Emmanuel Vadot
4b5f5fe78f arm64: intel: Remove firmware driver
This is now covered by ofw_firmware.

Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D37613
2023-08-08 15:13:33 +02:00
Emmanuel Vadot
fdfd3a90b6 ofw: Add a ofw_firmware driver
Some SoCs have an external firmware doing power management, clock
and other stuffs. (Xilinx, ARM Juno etc ...)
The way it is represent in the DTB is usually having a 'firmware' node
under the root node and have some nodes under it with the correct
compatible strings.
The firmware node itself doesn't have any compatible strings.
This driver is simple subclassed from simplebus and attaches at
BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE so early drivers (like clock drivers)
can still have a change to attach early.

Reviewed by:	andrew
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D37612
2023-08-08 15:13:31 +02:00
Michael Tuexen
9ade2745db sctp: remove duplicate code
No functional change intended.

MFC after:	1 week
2023-08-08 13:05:39 +02:00
Michael Tuexen
c7587f7a3f sctp: cleanup
No functional change intended.

MFC after:	1 week
2023-08-08 12:40:51 +02:00
Andrey V. Elsukov
600bf006d3 carp: delete interface routes on link loss.
Obtained from:	Yandex LLC
MFC after:	10 days
Sponsored by:	Yandex LLC
Differential Revision: https://reviews.freebsd.org/D41290
2023-08-08 13:22:10 +03:00
Michael Zhilin
e0bc8f8da2 etherswitch/arswitch: correct version detection
During porting of etherswitch to NetBSD mistypo was discovered in
Atheros switch version detection.

Reported by:    Hiroki Mori yamori813@yahoo.co.jp
MFC after:	1 week
2023-08-08 11:02:09 +03:00
Kirk McKusick
d4a8f5bf13 Handle UFS/FFS file deletion from cylinder groups with check-hash failure.
When a file is deleted, its blocks need to be put back in the free
block list and its inode needs to be put back in the inode free list.
These lists reside in cylinder-group maps. If either some of its blocks
or its inode reside in a cylinder-group map with a bad check hash
it is not possible to free the associated resource. Since the cylinder
group cannot be repaired until the filesystem is unmounted these
resources cannot be freed. They simply accumulate in memory. And
any attempt to unmount the filesystem loops forever trying to flush them.

With this change, the resource update claims to succeed so that the
file deletion can successfully complete. The filesystem is marked as
requiring an fsck so that before the next time that the filesystem is
mounted, the offending cylinder groups are reconstructed causing the
lost resources to be reclaimed.

A better solution would be to downgrade the filesystem to read-only,
but that capability is not currently implemented.

Reported-by:  Peter Holm
Tested-by:    Peter Holm
MFC-after:    1 week
Sponsored-by: The FreeBSD Foundation
2023-08-07 16:28:11 -07:00
Eric Joyner
d2dd3d5a98
iflib: Remove redundant variable
In iflib_init_locked(), sctx and scctx both point to the same value,
which is the ifc_softc_ctx field in the iflib softc. Remove the
declaration and assignment to sctx since scctx can be used instead, and
the name of scctx follows the naming convention used for local variables
that point to ifc_softc_ctx.

In theory there should be no functional impact with this change.

Signed-off-by: Eric Joyner <erj@FreeBSD.org>

Reviewed by:	kbowling@
MFC after:	3 days
Sponsored by:	Intel Corporation
Differential Revision:	https://reviews.freebsd.org/D41325
2023-08-07 15:46:48 -07:00
Eric Joyner
7f527d4812
iflib: Fix white space and reduce some line lengths
This helps align some of the code with the rest of the style used in
iflib, but as marius@ points out, this is not style(9).

Signed-off-by: Eric Joyner <erj@FreeBSD.org>

Reviewed by:	kbowling@
MFC after:	3 days
Sponsored by:	Intel Corporation
Differential Revision:	https://reviews.freebsd.org/D41324
2023-08-07 15:46:48 -07:00
Warner Losh
2ad9a815fd nvme: Directly lookup op code
Rather than have a table to walk through, use a sparse array.

Suggested by:		jhb
Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D41353
2023-08-07 16:44:32 -06:00
Warner Losh
63b0c00eb0 nvme: Update comment
Fix comment to note we should grab additional data from the error log
page, but don't currently (it's inclear if we should do that here
and other places in nvd that want it, or if we should let nvd / the
nda periph make the request).

Sponsored by:		Netflix
Reviewed by:		chuck, mav, jhb
Differential Revision:	https://reviews.freebsd.org/D41315
2023-08-07 16:44:31 -06:00
Warner Losh
95cd10f139 nvme: Add comments about other fields in status
When manually completing an I/O, we do so because we have no status back
from the card. Note M, CRD and P are all 0 because this is an artificial
event (and phase isn't checked when it's completed this way). There's no
MORE information in the error log page and there's no delayed retry
(CRD=0) and we don't currently request CRD to be set to anything other
than 0 and thus don't implement delayed retry.

Sponsored by:		Netflix
Reviewed by:		chuck, mav, jhb
Differential Revision:	https://reviews.freebsd.org/D41314
2023-08-07 16:44:31 -06:00
Warner Losh
a510dbc848 nvme: Be less verbose when cancelling I/O or admin commands
When we're resetting, and there's outstanding I/O that we're cancelling,
only report we're cancelling the I/O once rather than once per
I/O. Likewise when we reschedule the I/O. We don't need to say for each
one that we're cancelling/rescheduling something, and then report the
I/O that we're doing. Likewise with cancelling admin commands (we never
retry them here, so a similar change isn't needed).

Sponsored by:		Netflix
Reviewed by:		chuck, mav
Differential Revision:	https://reviews.freebsd.org/D41313
2023-08-07 16:44:31 -06:00
Warner Losh
ac8c866fda nvme: Add more NVME Base Spec 2.0 and NVME Command Set Spec 1.0a
Add admin commands capacity management, lockdown and fabrics commands.
Add I/O copy command.

Sponsored by:		Netflix
Reviewed by:		chuck, mav, jhb
Differential Revision:	https://reviews.freebsd.org/D41311
2023-08-07 16:44:31 -06:00
Warner Losh
edd23e4dc0 nvme: Eliminate redundant code
get_admin_opcode_string and get_io_opcode_string are identical, but
start with different tables. Use a helper routine that takes an argument
to implement these instead. A future commit will refine this further.

Sponsored by:		Netflix
Reviewed by:		chuck, mav, jhb
Differential Revision:	https://reviews.freebsd.org/D41310
2023-08-07 16:44:31 -06:00
Warner Losh
7be0b06885 nvme: Remove duplicate command printing routine
Both nvme_dump_command and nvme_qpair_print_command print nvme
commands. The former latter better. Recode the one call to
nvme_dump_command to use nvme_qpair_print_command and delete the
former. No sense having two nearly identical routines. A future commit
will convert to sbuf.

Sponsored by:		Netflix
Reviewed by:		chuck, mav, jhb
Differential Revision:	https://reviews.freebsd.org/D41309
2023-08-07 16:44:30 -06:00
Warner Losh
6f76d49386 nvme: Remove duplicate completion printing routine
Both nvme_dump_completion and nvme_qpair_print_completion print
completions. The latter is better. Recode the two instances of
nvme_dump_completion to use nvme_qpair_print_completion and delete the
former. No sense having two nearly identical routines. A future commit
will convert this to sbuf.

Sponsored by:		Netflix
Reviewed by:		chuck
Differential Revision:	https://reviews.freebsd.org/D41308
2023-08-07 16:44:30 -06:00
Kristof Provost
f8b4f9aab5 pfctl: optionally clarify which anchors are layer 3 and which are Ethernet
When listing anchors pfctl lists both 'regular' layer 3 anchors and
Ethernet anchors. It's possible to have the same anchor name in both,
which can be confusing.

Mitigate this a little by explicitly marking where the Ethernet anchors
start. Avoid breaking scripts by only doing this at the second level
of verbosity.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-08-07 19:59:50 +02:00
Colin Percival
ac4f03e03e Firecracker: Make root disk configurable
Add a FCROOTFSSZ variable which defaults to "1g" which controls the
size of the Firecracker root filesystem; it can be set as low as "300m"
at present.

Allow WITHOUTS to be overridden if users want to build a root disk with
more -- or fewer -- parts of the FreeBSD base system.

Reviewed by:	gjb
Sponsored by:	https://www.patreon.com/cperciva
Differential Revision:	https://reviews.freebsd.org/D41041
2023-08-07 09:21:08 -07:00
Mark Johnston
454c425dbe ossl: Add missing labels to bsaes-armv7.S
There is a bug in the OpenSSL script which generates this file; the bug
is in the process of being fixed upstream.

Specifically, when generating the output, bsaes-armv7.pl strips some
labels that are used when the output asm is compiled with __KERNEL__
defined, resulting in a build error.  As a step towards adding armv7
support to ossl(4), manually patch the generated asm.  The upstream fix
will be imported later.

Reviewed by:	andrew, jhb, emaste
MFC after:	1 week
Sponsored by:	Klara, Inc.
Sponsored by:	Stormshield
Differential Revision:	https://reviews.freebsd.org/D41303
2023-08-07 10:17:16 -04:00
Mariusz Zaborski
2ea65afbd1 md5: extend capabilites
In 4849767cb1, we did a large refactor of the md5(1) source code.
One of them is that instead of reading data using read(2) syscall, we
are using binary stream input (fread(3)).

fread(3) requires additional Capsicum capabilities:
sha256 CAP operation requires CAP_FSTAT, descriptor holds CAP_READ
sha256 RET fstat -1 errno 93 Capabilities insufficient

Reviewed by:	des
Differential Revision:	https://reviews.freebsd.org/D41348
2023-08-07 14:19:26 +02:00