Commit graph

291908 commits

Author SHA1 Message Date
Bojan Novković da76d349b6 uma: Deduplicate uma_small_alloc
This commit refactors the UMA small alloc code and
removes most UMA machine-dependent code.
The existing machine-dependent uma_small_alloc code is almost identical
across all architectures, except for powerpc where using the direct
map addresses involved extra steps in some cases.

The MI/MD split was replaced by a default uma_small_alloc
implementation that can be overridden by architecture-specific code by
defining the UMA_MD_SMALL_ALLOC symbol. Furthermore, UMA_USE_DMAP was
introduced to replace most UMA_MD_SMALL_ALLOC uses.

Reviewed by: markj, kib
Approved by: markj (mentor)
Differential Revision:	https://reviews.freebsd.org/D45084
2024-05-25 19:24:46 +02:00
Ed Maste 9b1de7e484 vt/sc: retire logic to select vt(4) by default for UEFI boot
We previously defaulted to using sc(4) with a special case to prefer
vt(4) when booted via UEFI.  As vt(4) is now always the default we can
simplify this.

Reviewed by:	imp, kevans
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45356
2024-05-25 11:00:35 -04:00
Michael Tuexen 02d15215ce tcp: improve blackhole support
There are two improvements to the TCP blackhole support:
(1) If net.inet.tcp.blackhole is set to 2, also sent no RST whenever
    a segment is received on an existing closed socket or if there is
    a port mismatch when using UDP encapsulation.
(2) If net.inet.tcp.blackhole is set to 3, no RST segment is sent in
    response to incoming segments on closed sockets or in response to
    unexpected segments on listening sockets.
Thanks to gallatin@ for suggesting such an improvement.

Reviewed by:		gallatin
MFC after:		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D45304
2024-05-24 06:59:13 +02:00
Konstantin Belousov 40d951bc59 x86/iommu: extract useful utilities into x86_iommu.c
related to the page tables page allocation and mapping.

Sponsored by:	The FreeBSD Foundation
Sponsored by:	Advanced Micro Devices (AMD)
MFC after:	1 week
2024-05-25 08:32:01 +03:00
cnbatch ff92493a4f netlink: Fix C++ compile errors
Allow these files to be included in C++ programs with careful casting to
the proper type, like C++ wants (and in a way that also works for C).

MFC After: 1 week
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1245
2024-05-24 22:31:42 -06:00
Lexi Winter bfd248f59d sys/amd64/conf/LINT-NOINET{6,}: don't set WITHOUT_INET{6,}_SUPPORT
Previously, it was necessary to set WITHOUT_INET_SUPPORT when building
the kernel without INET, and WITHOUT_INET6_SUPPORT when building the
kernel without INET6, or else the modules build would fail.  The
LINT-NOINET and LINT-NOINET6 configs did this using makeoptions.

After recent changes, this is no longer required, so remove these
makeoptions.  This avoids masking potential future build issues when
these aren't set.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1255
2024-05-24 22:21:25 -06:00
Lexi Winter 0e2ce86627 ipfw: don't build the module if INET not in kernel
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1255
2024-05-24 22:21:24 -06:00
Franco Fichtner 0cc8506c51 dhclient: remove unused primary_address
Its last use was removed in 396c7521364.

Reviewed by:		imp
Pull Request:		https://github.com/freebsd/freebsd-src/pull/1257
Differential Revsiion:	https://reviews.freebsd.org/D42717
2024-05-24 22:17:08 -06:00
Ed Maste f52481f3b8 vt(4): add note about sc/UEFI incompatibility
syscons is not compatible with UEFI boot.  This is noted in syscons(4),
but not mentioned in vt(4) where the kern.vty tunable (used to select vt
or sc) is documented.  Add a note so that if someone reads vt(4) but not
sc(4) they are not surprised by having no usable console.

PR:		276206
Reviewed by:	brooks
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45357
2024-05-24 19:55:10 -04:00
Ed Maste 61639bb3fc libc: move NIS xdr_* symbols from rpc's to yp's Symbol.map
To fix WITHOUT_NIS build.  Building yp_xdr.c is gated by MK_NIS.

PR:		279270
Reported by:	peterj
Reported by:	matteo
Reported by:	Michael Dexter's Build Option Survey run
Reviewed by:	brooks
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45347
2024-05-24 16:47:37 -04:00
Dimitry Andric 3a0793336e Merge llvm-project release/18.x llvmorg-18.1.6-0-g1118c2e05e67
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project release/18.x llvmorg-18.1.6-0-g1118c2e05e67.

PR:		276104
MFC after:	3 days
2024-05-24 17:58:04 +02:00
Ryan Libby a216e311a7 vm_pageout_scan_inactive: take a lock break
In vm_pageout_scan_inactive, release the object lock when we go to
refill the scan batch queue so that someone else has a chance to acquire
it.  This improves access latency to the object when the pagedaemon is
processing many consecutive pages from a single object, and also in any
case avoids a hiccup during refill for the last touched object.

Reviewed by:	alc, markj (previous version)
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D45288
2024-05-24 08:52:58 -07:00
Warner Losh d09ee08f10 nvme: Count number of alginment splits
When possible, we split up I/Os to NVMe drives that advertise a
preferred alignment. Add a counter for this.

Sponsored by:		Netflix
Reviewed by:		chuck, mav
Differential Revision:	https://reviews.freebsd.org/D45311
2024-05-24 08:32:47 -06:00
Warner Losh 99c14fb99f cam: Drop periph lock when completing I/O with ENOMEM status
When biofinish calls g_io_deliver with an error of ENOMEM, that kicks
off the slowdown protocol, forcing I/O to go through g_down rather than
be directly dispatch. One of the side effects is that the I/O is
resubmitted, so the start routines get called recursively, leading to a
recursive lock panic. Rather than make the periph lock recursive, drop
and reacquire the lock around such calls to biofinish.

For nda, this happens only when we can't allocate space to construct a
TRIM. For ada and da, this is only for certain ZONE operations.

Sponsored by:		Netflix
Reviewed by:		gallatin
Differential Revision:	https://reviews.freebsd.org/D45310
2024-05-24 08:32:04 -06:00
Warner Losh 6d83b38186 geom_io: Shift to pause_sbt to eliminate bogus min and update comment.
Update to eliminate bogus min to ensure 0 was never passed to
pause. Instead, requrest 1ms with an 'infinite' precision, which
defaults to whatever the underlying time counter can do. This should
ensure we run fairly quickly to start processing done events, while
still giving a small pause for the system to catch its breath. This rate
limiter still is less than ideal, and this commit doesn't change
that. It should really have no functional change: it just uses a better
interface to express the desired sleep.

Sponsored by:		Netflix
Reviewed by:		kib
Differential Revision:	https://reviews.freebsd.org/D45316
2024-05-24 08:31:55 -06:00
Warner Losh 32f40fc983 geom: Add counts for enomem and pausing
Add counts for the number of requests that complete with the ENOMEM as
kern.geom.nomem_count and the number of times we pause the g_down thread
to let the system recover as kern.geom.pause_count.

Sponsored by:		Netflix
Reviewed by:		kib
Differential Revision:	https://reviews.freebsd.org/D45309
2024-05-24 08:31:15 -06:00
Mitchell Horne 1d3c23676d arm64, riscv: remove unused declaration
It is inherited from arm, where the global exists and is used. No
functional change.

Reviewed by:	markj
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D45323
2024-05-24 10:55:24 -03:00
Mitchell Horne b5e17840de arm64, riscv: removed unused struct pv_addr
No functional change.

Reviewed by:	markj
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D45322
2024-05-24 10:55:24 -03:00
Val Packett 59aa64914a cross: Move Solaris API64 defines to common
off64_t is needed for both Linux (musl) and MacOS, so move them to the
common area. Somehow glibc provides the definition, but defining it
doesn't hurt and hels in the musl case.

Reviewed by: allanjude, jrtc27
Pull Request: https://github.com/freebsd/freebsd-src/pull/1066
2024-05-23 20:03:18 -06:00
Colin Percival f81c0904f7 Add rtw88 firmware to DVD package set
Add net/wifi-firmware-rtw88-kmod since it is no longer included in
the base system on 15.x.  (It is present in 14.x, so this change will
not be MFCed.)
2024-05-23 17:02:40 -07:00
Colin Percival d31ed58b9f Modernize DVD package set in preparation for 14.1
Remove archivers/unzip (now in base) and emulators/linux_base-c7 (old
and unlikely to be useful without other linux packages being installed),
ports-mgmt/portmaster (now largely obsolete and discouraged in favour
of using pkg and binary packages) and x11-drivers/xf86-video-vmware
(questionably useful).

Replace devel/git with devel/git@lite (sufficient for most purposes),
and adjust the "ensure the ports exist to sanitize the list" code to
ignore the @lite part when checking that /usr/ports/devel/git exists.

Add sysutils/seatd and x11-wm/sway for wayland support.

MFC after:	1 minute
Differential Revision:	https://reviews.freebsd.org/D45278
2024-05-23 17:01:59 -07:00
Bjoern A. Zeeb 45bce6fa30 LinuxKPI: 802.11: lock MO tx/wake_tx_queue() downcalls
Lock the two TX MO downcalls into driver/firmware in
lkpi_80211_txq_tx_one() to make sure they cannot happen in the
middle of other (net80211 triggered) updates calling down into
the driver/firmware.

Sponsored by:	The FreeBSD Foundation (commit)
MFC after:	3 days
Reviewed by:	cc
Differential Revision: https://reviews.freebsd.org/D43966
2024-05-23 23:43:29 +00:00
Bjoern A. Zeeb d33f5a0afa fwget: update wireless IDs for rtw88/89, ath1xk, mt76 and add iwlwifi
Update and add (new) PCI IDs for Realtek rtw88/89, Mediatek 7996/7925,
QCA ath1xk, and add Intel iwlwifi IDs.

Rather than using a package per driver add fine(r) grained flavors
even though it is a lot more likely to break in certain cases.

For Intel we need a great level of detail to match PCI IDs so also pass
the full pciconf -l line to into the pci_* files as "$2" to have access
to these.

This lines up with ports commit 80f50c9eb66d.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	manu (earlier version)
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D44918
2024-05-23 22:26:59 +00:00
Henrich Hartzer 674956e199 sys/netinet/cc: Switch from deprecated random() to prng32()
Related: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=277655

Signed-off-by: henrichhartzer@tuta.io
Reviewed by: imp, mav
Pull Request: https://github.com/freebsd/freebsd-src/pull/1162
2024-05-23 15:10:09 -06:00
Cy Schubert 380ee9b3c0 sys/netinet/icmp6.h: Fix build
Fix stdint.h file not found.

Fixes: 		4b75afe885
2024-05-23 14:03:55 -07:00
Lexi Winter 4b75afe885 sys/netinet/icmp6.h: use C99 uintX_t constants for new PREF64 struct
Reviewed by: imp, glebius (prior suggetions done)
Pull Request: https://github.com/freebsd/freebsd-src/pull/1206
2024-05-23 14:40:48 -06:00
Lexi Winter 77f06c476c rtadvd(8): support PREF64 (RFC 8781)
PREF64 allows a router to advertise the network's NAT64 prefix, allowing
clients to auto-configure CLAT.  This makes it possible to deploy
IPv6-only or IPv6-mostly client access networks without the need for
DNS64.

Reviewed by: imp, glebius (prior suggetions done)
Pull Request: https://github.com/freebsd/freebsd-src/pull/1206
2024-05-23 14:40:48 -06:00
Lexi Winter 1e8eb413f6 netinet/icmp6: add PREF64 definitions (RFC 8781)
Reviewed by: imp, glebius (prior suggetions done)
Pull Request: https://github.com/freebsd/freebsd-src/pull/1206
2024-05-23 14:40:11 -06:00
Henrich Hartzer 87bf0aaba8 Remove COMPAT_FREEBSD4/5/6/7/9 from MINIMAL and FIRECRACKER kernel configurations
FIRECRACKER is not a legacy config, so remove the really old FreeBSD
versions from it. MINIMAL has a similar history, and limited target
audience which has little to no overlap with really old binaries. Either
of these is really easy to get additional binary compat with the include
directive, so balance things better. Leave GENERIC alone.

PR: 231768
Signed-off-by: Henrich Hartzer <henrichhartzer@tuta.io>
Reviewed by: imp (MINIMAL), cperciva (FIRECRACKER)
Pull Request: https://github.com/freebsd/freebsd-src/pull/1228
2024-05-23 14:30:57 -06:00
Dimitry Andric c6bcacc7c9 Vendor import of llvm-project branch release/18.x llvmorg-18.1.6-0-g1118c2e05e67. 2024-05-23 22:21:31 +02:00
Michael Tuexen fe136aecc2 tcp: improve inp locking in setsockopt
Ensure that the inp is not dropped when starting a stack switch.
While there, clean-up the code by using INP_WLOCK_RECHECK, which
also re-assigns tp.

Reviewed by:		glebius
MFC after:		3 days
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D45241
2024-05-23 22:19:12 +02:00
Simon J. Gerraty 9d3df31ec0 Merge bmake-20240520
Merge commit '29efb3dcaedd9cbabc6f96f35545baf2c8b28501'
2024-05-23 13:12:43 -07:00
Simon J. Gerraty 29efb3dcae Import bmake-20240520
Intersting/relevant changes since bmake-20240508

ChangeLog since bmake-20240508

2024-05-20  Simon J Gerraty  <sjg@beast.crufty.net>

	* VERSION (_MAKE_VERSION):
	Merge with NetBSD make, pick up
	o dir.c: in FindFile restore last search of .CURDIR even for
	includes, as a number of existing makefiles are broken otherwise.

2024-05-19  Simon J Gerraty  <sjg@beast.crufty.net>

	* VERSION (_MAKE_VERSION): 20240519
	Merge with NetBSD make, pick up
	o dir.c: Add Dir_FindInclude, FindFile without looking in .CURDIR.
	Also fix Dir_SetSYSPATH to use defSysIncPath if sysIncPath is empty.
	o main.c: no need to set .DOTLAST in sysIncPath
2024-05-23 13:08:58 -07:00
Lexi Winter 2356b60be7 arp(8): allow -i with -s
arp(8) usually disallows adding a static ARP entry for an IP address
which is not configured on a local interface.

Change this to allow such ARP entries to be added if '-i' is provided to
specify the interface the ARP entry relates to.

Due to limitations in the kernel lltable, this still requires that a
host route exists for the target address, but allows static ARP entries
to be configured to proxy ARP for, e.g., local jails which use an IPv4
address with a /32 route.

Reviewed by: imp, zlei
Pull Request: https://github.com/freebsd/freebsd-src/pull/1220
2024-05-23 14:02:57 -06:00
Warner Losh bedbaee805 syscalls: Regen for Linux emulator additions 2024-05-23 13:40:47 -06:00
Ricardo Branco 9a9677ec1c linux: Update linux manpage to mention mqueuefs
Reviewed by: imp, kib
Pull Request: https://github.com/freebsd/freebsd-src/pull/1248
2024-05-23 13:40:47 -06:00
Ricardo Branco 97add684f5 linux: Support POSIX message queues
Reviewed by: imp, kib
Pull Request: https://github.com/freebsd/freebsd-src/pull/1248
2024-05-23 13:40:46 -06:00
Ricardo Branco e30621d58f mqueue: Introduce kern_kmq_timedreceive & kern_kmq_timedsend
Reviewed by: imp, kib
Pull Request: https://github.com/freebsd/freebsd-src/pull/1248
2024-05-23 13:40:46 -06:00
Ricardo Branco 289b2d6a79 mqueue: Export some functions to be used by Linuxulator
Reviewed by: imp, kib
Pull Request: https://github.com/freebsd/freebsd-src/pull/1248
2024-05-23 13:40:46 -06:00
Ricardo Branco 86e43b5def linux: Export linux_convert_l_sigevent
Reviewed by: imp, kib
Pull Request: https://github.com/freebsd/freebsd-src/pull/1248
2024-05-23 13:40:46 -06:00
Ricardo Branco 9c7b1bf271 linux: Export linux_common_openflags()
Reviewed by: imp, kib
Pull Request: https://github.com/freebsd/freebsd-src/pull/1248
2024-05-23 13:40:46 -06:00
Ricardo Branco 427db2c45e linux: Fix linux_mq_notify_args & linux_timer_create_args
Reviewed by: imp, kib
Pull Request: https://github.com/freebsd/freebsd-src/pull/1248
2024-05-23 13:40:46 -06:00
Ricardo Branco ddbfb544c6 mqueuefs: Relax restriction that path must begin with a slash
This is needed to support Linux implementation which discards the leading slash when calling mq_open(2)

Reviewed by: imp, kib
Pull Request: https://github.com/freebsd/freebsd-src/pull/1248
2024-05-23 13:40:46 -06:00
Ricardo Branco 04d3f8e539 linprocfs: Add support for proc/sys/fs/mqueue/*
Reviewed by: imp, kib
Pull Request: https://github.com/freebsd/freebsd-src/pull/1248
2024-05-23 13:40:45 -06:00
Ricardo Branco acb7a4deb2 mqueue: Add sysctl for default_maxmsg & default_msgsize and fix descriptions
Reviewed by: imp, kib
Pull Request: https://github.com/freebsd/freebsd-src/pull/1248
2024-05-23 13:40:45 -06:00
Gleb Smirnoff 0d37895849 ctl: use socket buffer mutexes in struct socket directly
A mechanical change performed with sed(1) script:

s/SOCKBUF_LOCK\(&so->so_rcv\)/SOCK_RECVBUF_LOCK(so)/
s/SOCKBUF_UNLOCK\(&so->so_rcv\)/SOCK_RECVBUF_UNLOCK(so)/
s/SOCKBUF_MTX\(&so->so_rcv\)/SOCK_RECVBUF_MTX(so)/
s/SOCKBUF_LOCK\(&so->so_snd\)/SOCK_SENDBUF_LOCK(so)/
s/SOCKBUF_UNLOCK\(&so->so_snd\)/SOCK_SENDBUF_UNLOCK(so)/
s/SOCKBUF_MTX\(&so->so_snd\)/SOCK_SENDBUF_MTX(so)/

Reviewed by:		mav
Differential Revision:	https://reviews.freebsd.org/D45190
2024-05-23 12:11:54 -07:00
Pierre Pronchery 3d7c8f0887 cp: avoid a resource leak
In copy_file(), make sure the from_fd file descriptor is closed even
when the operation failed early.

Reported by:	Coverity Scan
CID:		1545036
Sponsored by:	The FreeBSD Foundation

Reviewed by: imp, emaste
Pull Request: https://github.com/freebsd/freebsd-src/pull/1238
2024-05-23 12:04:43 -06:00
Warner Losh a5f03413aa ci: Redirect output for builds.
This target is far too noisy to be at all useful. Save the output ala
make universe in _. files. Also report where to find errors.

Sponsored by:		Netflix
2024-05-23 11:59:40 -06:00
Michael Dexter be3631bc8d option_survey.sh: Bump size to 5GB
Increase image size from 4G to 5G to accommodate growth in OS.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1251
2024-05-23 10:47:38 -06:00
Tom Hukins 083d149224 etherswitch.4: List manual pages alphabetically
Signed-off-by: Tom Hukins <tom@FreeBSD.org>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1253
2024-05-23 10:35:29 -06:00