Commit graph

290294 commits

Author SHA1 Message Date
Eliot Solomon
9fabf97682 arm64: fix free queue and reservation configuration for 16KB pages
Correctly configure the free page queues and the reservation size when
the base page size is 16KB.  In particular, the reservation size was
less than the L2 Block size, making L2 promotions and mappings all but
impossible.

Reviewed by:	markj
Tested by:	gallatin
Differential Revision:	https://reviews.freebsd.org/D42737
2024-03-24 12:22:20 -05:00
Gleb Smirnoff
a03aff88a1 icmp6: bring rate limiting on a par with IPv4
Use counter_ratecheck() instead of racy and slow ppsratecheck. Use a
separate counter for every currently known type of ICMPv6. Provide logging
of ratelimit events. Provide jitter to counter open UDP port detection.

Reviewed by:		tuexen, zlei
Differential Revision:	https://reviews.freebsd.org/D44482
2024-03-24 09:13:23 -07:00
Gleb Smirnoff
4f96be33fe icmp6: move ICMPv6 related tunables to the files where they are used
Most of them can be declared as static after the move out of in6_proto.c.
Keeping sysctl(9) declarations with their text descriptions next to the
variable declaration create self-documenting code.  There should be no
functional changes.

Differential Revision:	https://reviews.freebsd.org/D44481
2024-03-24 09:13:23 -07:00
Gleb Smirnoff
32aeee8ce7 icmp6: rate limit our echo replies
The generation of ICMP6_ECHO_REPLY bypasses icmp6_error(), thus rate
limit was not applied.

Reviewed by:		tuexen, zlei
Differential Revision:	https://reviews.freebsd.org/D44480
2024-03-24 09:13:23 -07:00
Gleb Smirnoff
c6c96aaba8 icmp6: make icmp6_ratelimit() responsible to update the stats counter
Reviewed by:		tuexen
Differential Revision:	https://reviews.freebsd.org/D44479
2024-03-24 09:13:23 -07:00
Gleb Smirnoff
ac44739fd8 icmp: improve ICMP limit jitter
Instead of fixing up invalid values set by a user in badport_bandlim()
which is a fast path function, provide a sysctl handler
sysctl_icmplim_and_jitter(), that will check that jitter is less than the
limit.

Provide jitter initilization function icmplim_new_jitter() used at boot,
in the sysctl handler and when we actually hit the limit.  This also fixes
no jitter on a fresh booted system until first limit hit.

Instead of CVE number provide link the the actual paper that explains what
and why we are doing here.  The CVE number isn't very informative, it will
just tell you what RedHat version you need to upgrade to.

Reviewed by:		kp, tuexen, zlei
Differential Revision:	https://reviews.freebsd.org/D44478
2024-03-24 09:13:23 -07:00
Gleb Smirnoff
b508545ce0 icmp: when logging ICMP ratelimiting message use correct jitter value
The limiting of the very last second has been done using certain jitter
value.  We update the jitter for the next second.  But the logging should
report the jitter before the change.

Reviewed by:		kp, tuexen, zlei
Differential Revision:	https://reviews.freebsd.org/D44477
2024-03-24 09:13:23 -07:00
Gleb Smirnoff
9d7f17d746 icmp: hide icmp_bandlimit_uninit() under VIMAGE
The uninitialization may be executed only on a kernel with VIMAGE.

Reviewed by:		kp, tuexen, zlei
Differential Revision:	https://reviews.freebsd.org/D44476
2024-03-24 09:13:23 -07:00
Gleb Smirnoff
7142ab4790 icmp: do not store per-VNET identical array of strings
We need per-VNET struct counter_rate, but we don't need per-VNET set of
const char *.  Also, identical word "response" can go into the format
string instead of being stored 7 times.

Reviewed by:		kp, zlei, tuexen
Differential Revision:	https://reviews.freebsd.org/D44475
2024-03-24 09:13:23 -07:00
Zhenlei Huang
579cb41b13 acpi_hpet: Make use of enum for vm_guest to improve readability
No functional change intended.

MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D44402
2024-03-24 23:31:22 +08:00
Gordon Bergling
8a56ef8d75 mem.4: Correct the HISTORY section
The history section (added in CSRG) claimed both first appeared in v6.
Looking at the manuals in the TUHS archive, /dev/mem was in v1
and /dev/kmem was introduced in v5.

Reviewed by:	imp
Obtained from:	OpenBSD
MFC after:	5 days
Differential Revision:	https://reviews.freebsd.org/D44486
2024-03-24 06:10:39 +01:00
Jason A. Harmening
eee6217b40 unionfs: implement VOP_UNP_* and remove special VSOCK vnode handling
unionfs has a bunch of clunky special-case code to avoid creating
unionfs wrapper vnodes for AF_UNIX sockets.  This was added in 2008
to address PR 118346, but in the intervening years the VOP_UNP_*
operations have been added to provide a clean interface to allow
sockets to work in the presence of stacked filesystems.

PR:			275871
Reviewed by:		kib (prior version), olce
Tested by:		Karlo Miličević <karlo98.m@gmail.com>
MFC after:		2 weeks
Differential Revision:	https://reviews.freebsd.org/D44288
2024-03-23 21:10:53 -05:00
Gordon Bergling
619e6f1f92 cxgbe.4: Remove double word
- s/of of/of/

MFC after:	3 days
2024-03-23 18:01:47 +01:00
Gordon Bergling
2c3466172a intr_event.9: Remove double word
- s/of of/of/

MFC after:	3 days
2024-03-23 17:57:37 +01:00
Gleb Smirnoff
3f3d19d802 tests/netinet: fix UDP I/O test build
Fixes:	8d3d9ca8bd
2024-03-23 09:21:13 -07:00
Gordon Bergling
577a721d05 xdr(3): Fix a few typos in source code comments
- s/reoutines/routines/
- s/paraemters/parameters/

Obtained from:	NetBSD
MFC after:	3 days
2024-03-23 08:43:41 +01:00
Antoine Brodin
a200093c21 share/man/man9/Makefile: fix buildworld 2024-03-23 07:17:59 +00:00
Konstantin Belousov
88f2c58d1a cdevpriv(9): document devfs_foreach_cdevpriv()
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2024-03-23 08:59:00 +02:00
Konstantin Belousov
d3efbe0132 cdevpriv(9): add iterator
Reviewed by:	christos
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D44469
2024-03-23 08:59:00 +02:00
Gleb Smirnoff
15bfd7cf27 soreceive_dgram: use M_WAITOK when we don't hold any locks 2024-03-22 22:44:16 -07:00
Gleb Smirnoff
26389b308d soreceive_dgram: assert that a datagram has control or data 2024-03-22 22:44:16 -07:00
Gleb Smirnoff
1a3d1be496 ng_ksocket: use new macros to lock socket buffers 2024-03-22 22:44:16 -07:00
Gleb Smirnoff
a8edc9f1e3 tests/netgraph: start ng_ksocket(4) tests
The ng_ksocket(4) functionality is very fragile as it interfaces with
kernel socket code in unusual way.  It definitely needs a test suite.
Start one with a test that tests UDP over IPv4.
2024-03-22 22:44:16 -07:00
Gleb Smirnoff
8d3d9ca8bd tests/netinet: add UDP socket I/O tests
Start a file that would collect tests for I/O functionality of a UDP
socket, targeted on how a socket interacts with userland rather than with
wire side of the protocol.

First version tests that MSG_TRUNC and MSG_PEEK are working correctly.
2024-03-22 22:44:16 -07:00
Gleb Smirnoff
fbbb50f570 tests/netgraph: mark all tests as required_user="root"
Any netgraph operation requires root priveleges.  Some tests in the
directory already mark themselves with 'atf_tc_set_md_var(conf,
"require.user", "root");' which creates a lot of pasted code.  Some tests
don't mark self.  For this particular directory a blanket metadata setting
in the Makefile is acceptable, imho.
2024-03-22 19:50:33 -07:00
John Baldwin
acbc176c3d nvmecontrol: Display additional Fabrics-related fields for cdata
Some of these fields are specific to Fabrics controllers (such as the
size of capsules) while other fields are shared with PCI-e
controllers, but are more relevant for Fabrics controllers (such as
KeepAlive timer properties).

Reviewed by:	imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D44449
2024-03-22 17:25:07 -07:00
John Baldwin
21d3a84db4 nvme: Add NVMe over Fabrics fields to nvme_controller_data
Reviewed by:	imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D44448
2024-03-22 17:24:52 -07:00
John Baldwin
7fa8adb8c5 nvme: Add constants for the Controller Attributes field in cdata
Reviewed by:	imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D44447
2024-03-22 17:24:31 -07:00
John Baldwin
88ecf154c7 nvme: Add constants and types for the discovery log page
This is used in NVMe over Fabrics to enumerate a list of available
controllers.

Reviewed by:	imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D44446
2024-03-22 17:24:18 -07:00
John Baldwin
b354bb04cb nvme: Add constants for fields in AER completion dword 0
Reviewed by:	imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D44445
2024-03-22 17:24:06 -07:00
John Baldwin
cbda1886ab nvme: Add constants for the extended data for Get Log Page command flag
nvme(4) doesn't check this flag, but Fabrics implementations may need
to set this flag in the log page attributes cdata field.

Reviewed by:	imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D44444
2024-03-22 17:23:46 -07:00
John Baldwin
b8cb8dd362 nvme: Add constants for the PSDT field in cdw0
This is not used in nvme(4) but is used in NVMe over Fabrics
transports which use SGLs to describe buffers instead of PRPs.

While here, adjust the shift value for the FUSE field to be relative
to the 'fuse' member of 'struct nvme_command'.

Reviewed by:	imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D44443
2024-03-22 17:23:24 -07:00
John Baldwin
f21a54d190 nvme: Add SGL structure and constants for use in NVMe commands
Fabrics capsules use an SGL structure instead of prp1/2 addresses to
describe the data buffer used for a command.  The SGL structure is
added to a union with the existing prp1/2 fields.

Reviewed by:	imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D44442
2024-03-22 17:23:09 -07:00
John Baldwin
1931b75e00 nvme: Export constants for min and max queue sizes
These are useful for NVMe over Fabrics.

Reviewed by:	imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D44441
2024-03-22 17:23:02 -07:00
Gleb Smirnoff
a77605a8d9 man9: mlink for counter_ratecheck(9) 2024-03-22 14:36:54 -07:00
Stefan Eßer
c44bf7d2e9 rtld: reduce debug messages after fix on big-endian hosts
Remove a debug message that had been added to support the debugging
of a mis-detection of the hint files endianness on powerpc64.

MFC after:	3 days
2024-03-22 21:54:11 +01:00
Ed Maste
8669e516f0 ccdconfig: reference gpart rather than fdisk and disklabel
fdisk and disklabel are legacy tools for legacy disk partitioning
schemes.

Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D43564
2024-03-22 14:51:15 -04:00
Baptiste Daroussin
a977444652 cloudinit: fix creation of cloudinit ready VMs
The framework do not support multiple format images, so this last minute
addition of qcow2 format was clearly not a good idea.

while here fix a typo

Reported by:	cperciva
2024-03-22 18:03:27 +01:00
Mitchell Horne
dc7ae2bc6f kern_ctf.c: fix linking with nooptions DDB
!DDB builds don't include the db_ctf_lookup_typename() symbol, so this
is a stop-gap to fix linking of the MINIMAL kernel config.

Reported by:	bapt
Fixes:		c21bc6f3c2 ("ddb: Add CTF-based pretty printing")
2024-03-22 13:26:00 -03:00
Ed Maste
537bdafbc2 rights.4: add note about rights not being simple bitmasks
PR:		277057
Reviewed by:	oshogbo, asomers
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D44473
2024-03-22 10:02:31 -04:00
Michael Tuexen
da2d6e2815 rtld: fix check for endianess of elf hints file
Don't check if the elf hints file is in host byte order, but check
if it is in little endian by looking at the magic number.
This fixes rtld on big endian platforms.
Reviewed by:	se, kib (prior version of the patch)
Fixes:		7b77d37a56 ("rtld-elf: support either byte-order of hints")
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D44472
2024-03-22 14:50:25 +01:00
Richard Scheffenegger
56b40c285b build: add -Wswitch to clang for more consistency with gcc
gcc12 and gcc13 appear to include Wswitch with Wall, while
clang doesn't. For switch() statements on enum, this forces
the use of at least a default: clause, in adherance with style(9).

Reviewed By:	emaste
Sponsored by:	NetApp, Inc.
Differential Revision:	https://reviews.freebsd.org/D44092
2024-03-22 01:39:01 +01:00
Michael Tuexen
af700f430f tcp: no data on SYN segments unless doing TFO
Ensure that there is no data on SYN segments unless doing TFO.
This check is already in RACK and BBR.

Reported by:		glebius
Reviewed by:		rscheff
MFC after:		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D44384
2024-03-22 11:12:56 +01:00
Kristof Provost
88f557a2a9 libpfctl: fix incorrect labels copy
We copied the entire parsed_labels struct, including the counter to a
field that was only big enough for the labels (so not the counter).

PR:		277875
MFC after:	1 week
2024-03-22 09:00:05 +01:00
Kristof Provost
e08b44339b if_ovpn tests: test large packets in IPv6 tunnel
There's a report of MTU issues over IPv6 DCO tunnels.
Extend the 4in6 test to send a series of pings with different sizes, as
well as transfer a large file.

No issues were found, but we may as well extend the test case.

PR:		276838
2024-03-22 09:00:05 +01:00
Emmanuel Vadot
594c5fa109 arm/nvidia: Fix DTS build
We need to include the DTS with the full path now that it changed.

Fixes:	f126890ac5 ("Import device-tree files from Linux 6.5")
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2024-03-22 07:49:54 +01:00
Mark Johnston
d722901fa3 ddb: Fix format string errors in db_pprint.c
For some reason, db_expr_t is defined as "long" on 64-bit platforms and
"int" on others.  When printing values of this type, simply cast them to
long to suppress compilation errors on 32-bit systems.

Reviewed by:	bnovkov
Fixes:	c21bc6f3c2 ("ddb: Add CTF-based pretty printing")
2024-03-22 02:11:03 -04:00
Mark Johnston
26173a919c arm64/vmm: Exclude more sanitizer compiler flags from certain files
Reported by:	rscheff
Fixes:		47e073941f ("Import the kernel parts of bhyve/arm64")
2024-03-22 00:20:34 -04:00
Bojan Novković
c21bc6f3c2 ddb: Add CTF-based pretty printing
Add basic CTF support and a CTF-powered pretty-printer to ddb.

The db_ctf.* files expose a basic interface for fetching type
data for ELF symbols, interacting with the CTF string table,
and translating type identifiers to type data.

The db_pprint.c file uses those interfaces to implement
a pretty-printer for all kernel ELF symbols.
The pretty-printer works with symbol names and arbitrary addresses:
pprint struct thread 0xffffffff8194ad90

Pretty-printing currently only works after the root filesystem
gets mounted because the CTF info is not available during
early boot.

Differential Revision:	https://reviews.freebsd.org/D37899
Approved by: markj (mentor)
2024-03-22 04:03:33 +01:00
Brooks Davis
312a05c39e riscv: remove more riscv64sf support
Remove a few more bits of riscv64sf support in libc and libm.

Reduce floating point ABI checks to requiring double hard float.

Reviewed by:	imp, jhb
Fixes:		1ca12bd927 Remove the riscv64sf architecture.
Differential Revision:	https://reviews.freebsd.org/D44334
2024-03-21 23:48:37 +00:00