Commit graph

291879 commits

Author SHA1 Message Date
Andre Albsmeier cca0ce62f3 pam_xdg: pam_get_item can return NULL
Fix pam_xdg as pam_get_item can return NULL, this happens when pressing
control + C in xdm for example.

MFC after:	1 week
PR:		279268
2024-05-27 08:33:14 +02:00
Cy Schubert f5f40dd63b ntp: Vendor import of ntp-4.2.8p18
MFC:	3 days

Merge commit '1f833b3fc9968c3dd7ed79ccf0525ebf16c891ad' into main
2024-05-26 18:41:22 -07:00
Joshua Kinard a8f86ecd61 newsyslog: Fix case of the 'P' flag in newsyslog.conf(5)
PR: 279303
Reviewed-by: emaste
Signed-off-by: Joshua Kinard <freebsd@kumba.dev>
2024-05-26 21:34:14 -04:00
Cy Schubert 1f833b3fc9 ntp: Vendor import of ntp-4.2.8p18 2024-05-26 15:55:52 -07:00
Kristof Provost 76bc4a776f pfctl: use pfctl_add_rule_h() rather than pfctl_add_rule()
This ensures we use the handle opened with pfctl_open(), and also brings
us closer to the ideal state where everything uses the handle rather
than a file descriptor.
2024-05-26 23:06:43 +02:00
Warner Losh 0e03402139 cross-build: This is not glibc specific, but Linux specific
Neither glibc nor musl define these interfaces, so provide them for all
Linux builds.

Sponsored by:		Netflix
Reviewed by:		val_packett.cool
Differential Revision:	https://reviews.freebsd.org/D45355
2024-05-26 11:39:27 -06:00
Warner Losh 3c5f0da510 cross-build: Define __*int*_t and include sys/cdefs.h
FreeBSD assumes that sys/types.h includes sys/cdefs.h, so add it here.
FreeBSD also needs __*int*_t defined for software we bootstrap (a lot of
it). GLIBC defines these, but musl does not, so we have to define them
here, even though it looks backwards. There's no good #define to key off
of, so use !defined GLIBC since on Linux defacto there's only two libc
implementations.

Co-authored-by:		Val Packett <val@packett.cool>
Sponsored by:		Netflix
Pull Request:		https://github.com/freebsd/freebsd-src/pull/1066
Reviewed by:		val_packett.cool
Differential Revision:	https://reviews.freebsd.org/D45354
2024-05-26 11:39:18 -06:00
Warner Losh 27326f895e cross-build: string.h uses mode_t, so we need sys/types.h
string.h defines strmode with a mode_t argument. POSIX states that one
must include sys/types.h to get mode_t, so do that here. This makes musl
happier. We know that sys/types.h will include sys/cdefs.h, so just
replace the latter with the former.

Co-authored-by:		Val Packett <val@packett.cool>
Sponsored by:		Netflix
Pull Request:		https://github.com/freebsd/freebsd-src/pull/1066
Reviewed by:		val_packett.cool
Differential Revision:	https://reviews.freebsd.org/D45353
2024-05-26 11:39:10 -06:00
Warner Losh 76efd90ab0 cross-build: Include sys/types.h from sys/param.h
FreeBSD has a style(9) enforced assumption that sys/param.h includes
sys/types.h. However, Linux under musl doesn't do this so go ahead and
explicitly include it here. It won't hurt on the glibc systems, and
helps musl.

Co-authored-by:		Val Packett <val@packett.cool>
Sponsored by:		Netflix
Pull Request:		https://github.com/freebsd/freebsd-src/pull/1066
Reviewed by:		val_packett.cool
Differential Revision:	https://reviews.freebsd.org/D45352
2024-05-26 11:39:02 -06:00
Warner Losh 4300e05361 build: Include sys/cdefs.h in our fcntl.h shim
On Linux with musl, sys/cdefs.h isn't included with fcntl.h, so when we
use __BEGIN_DECL and __END_DECL in this file, it fails. There's no harm
in unconditionally including sys/cdefs.h here, so do that to avoid
encoding exactly where it is or isn't needed so we don't have to know
too much about the internal state of other libc implementations.

Co-authored-by:		Val Packett <val@packett.cool>
Sponsored by:		Netflix
Pull Request:		https://github.com/freebsd/freebsd-src/pull/1066
Reviewed by:		val_packett.cool
Differential Revision:	https://reviews.freebsd.org/D45351
2024-05-26 11:38:55 -06:00
Warner Losh 917c0541e4 cross-tools: Document a rather bizarre looking construct
On Linux, stddef.h will define __size_t to something when size_t is
defined. On FreeBSD, __size_t is an actual typedef which we need for
other parts of the system. If __size_t isn't defined, that tells us we
need to define the fallback __size_t typedef (if it is defined, then we
can't easily redefine it without issues because glob.h will define it to
something different than stddef.h defines it). Add a comment to this
effect.

Sponsored by:		Netflix
Reviewed by:		val_packett.cool
Differential Revision:	https://reviews.freebsd.org/D45350
2024-05-26 11:38:46 -06:00
Warner Losh 364c014d9b cross-tools: fts has different types for cmp routine
fts has different types for its compare rotuine. Other systems, not
4.4BSD based, have a non-const version. Before we tested against
__GLIBC__, but now we test against __linux__ because that's Linux's API
and musl doesn't define __GLIBC__.

In addition, link against libftl on this platform since musl doesn't
include ftl routines in libc, but rather in libftl.

Co-authored-by:		Val Packett <val@packett.cool>
Sponsored by:		Netflix
Pull Request:		https://github.com/freebsd/freebsd-src/pull/1066
Reviewed by:		val_packett.cool
Differential Revision:	https://reviews.freebsd.org/D45349
2024-05-26 11:38:30 -06:00
Ryan Libby 9c975a0d90 pbuf_ctor(): Stop using LK_NOWAIT, use LK_NOWITNESS
The LK_NOWAIT was added to suppress a witness warning, but LK_NOWITNESS
is more what we mean.  This makes pbuf_ctor() more consistent with
buf_alloc(), although, unlike buf_alloc(), for pbuf there should not be
any danger of a wild locker relying on the type stability of the buf to
attempt a lock.  That is, this is essentially cosmetic.

Relevant history:
 - 531f8cfea0 Use dedicated lock name for pbufs
 - 5875b94c74 buf_alloc(): lock the buffer with LK_NOWAIT
 - c9e023541a pbuf_ctor(): lock the buffer with LK_NOWAIT
 - 1fb00c8f10 buf_alloc(): Stop using LK_NOWAIT, use LK_NOWITNESS

Reviewed by:	rew, kib
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D45360
2024-05-26 10:20:52 -07:00
Ryan Libby 6bd3f23a2a tmpfs_node_init: use MTX_NEW on lock from uninitialized memory
Reported by:	netchild
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D45364
2024-05-26 10:20:52 -07:00
Rick Macklem c68db4608e Revert "nfscl: Do not do readahead for directories"
The PR reported hangs that were avoided when this commit was
reverted.  Since it was only a cleanup, revert it.
The LORs in the PR need further investigation, since I think
readahead only hides the problem.

PR:	279138
This reverts commit fbe965591f.
2024-05-26 08:02:30 -07:00
Bojan Novković d25ed65043 uma: Fix improper uses of UMA_MD_SMALL_ALLOC
UMA_MD_SMALL_ALLOC was recently replaced by UMA_USE_DMAP, but
da76d349b6 missed some improper uses of the old symbol.
This change makes sure that UMA_USE_DMAP is used properly in
code that selects uma_small_alloc.

Fixes: da76d349b6
Reported by: eduardo, rlibby
Approved by: markj (mentor)
Differential Revision:	https://reviews.freebsd.org/D45368
2024-05-26 07:27:37 +02:00
Wolfram Schneider 73eb53813f man(1) needs to check for .so files not only in the first line
PR: 279182

Some manual pages have a copyright notice or commit id before including
other files with the .so macro. We need to skip comments and empty lines
at the beginning of the manpage while checking for the first .so macro.

MFC after:	1 week
2024-05-26 05:48:40 +00:00
Dimitry Andric cadd2ca217 Merge commit d0be944aa511 from llvm-project (by Simon Pilgrim):
[X86] Add slow div64 tuning flag to Nehalem target (#91129)

  This appears to have been missed because later cpus don't inherit from Nehalem tuning much.

  Noticed while cleaning up for #90985

Merge commit 8b400de79eff from llvm-project (by Simon Pilgrim):

  [X86] Enable TuningSlowDivide64 on Barcelona/Bobcat/Bulldozer/Ryzen Families (#91277)

  Despite most AMD cpus having a lower latency for i64 divisions that converge early, we are still better off testing for values representable as i32 and performing a i32 division if possible.

  All AMD cpus appear to have been missed when we added the "idivq-to-divl" attribute - this patch now matches Intel cpu behaviour (and the x86-64/v2/3/4 levels).

  Unfortunately the difference in code scheduling means I've had to stop using the update_llc_test_checks script and just use old-fashioned CHECK-DAG checks for divl/divq pairs.

  Fixes #90985

This fixes possibly worse runtime performance on AMD Zen hardware, when
using -march=znver4 (or any other znver), as opposed to -march=x86-64-v4
or the baseline -march=x86-64. A similar fix is applied for Nehalem.

PR:		278908
MFC after:	3 days
2024-05-25 21:12:29 +02:00
Ed Maste b128bedfb9 mptutil: correct man page date
PR:             279201
Fixes:          9a49a37929 ("mptutil: document that disabled/enab...")
Sponsored by:   The FreeBSD Foundation
2024-05-25 14:02:36 -04:00
Michael Tuexen df9de82f54 tcp: fix sending RST after second inp lookup
When we first find an inp, we set also the tp. If then a second
lookup is necessary, the inp is recomputed. If this fails, the
tp is not cleared, which resulted in failing KASSERT.
Therefore, clear the tp when staring the inp lookup procedure.
Reported by:	Jenkins
Fixes:		02d15215ce ("tcp: improve blackhole support")
MFC after:	1 week
Sponsored by:	Netflix, Inc.
2024-05-25 19:58:48 +02:00
Bojan Novković 0a44b8a56d vm: Simplify startup page dumping conditional
This commit introduces the MINIDUMP_STARTUP_PAGE_TRACKING symbol and
uses it to simplify several instances of a complex preprocessor conditional
for adding pages allocated when bootstraping the kernel to minidumps.

Reviewed by:	markj, mhorne
Approved by:	markj (mentor)
Differential Revision: https://reviews.freebsd.org/D45085
2024-05-25 19:24:55 +02:00
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