Commit Graph

303074 Commits

Author SHA1 Message Date
Mitchell Horne e13b5298ec if_re: Add PNP info for module
Add PNP info so it the module can be by devmatch(8) and automatically
loaded. On non-x86 platforms it is not included in GENERIC.

Reviewed by:	imp
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D52557
2025-09-16 10:22:05 -03:00
Konrad Witaszczyk 99213b3c35 aarch64: Save correct value of x18 on trapframe for nested faults
x18 is overwritten with a temporary copy of the kernel stack pointer
when it is saved in the trapframe.  This does not matter in terms of
function since nested exception return does not restore x18 from the
trapframe, but it does mean that examining x18 in a debugger in stack
frames above a nested fault outputs the wrong register value.

To fix, compute the value of the original stack pointer to save in x18
later after the trapframe has been constructed.

Reviewed by:	jhb, andrew
Sponsored by:	AFRL, DARPA
Differential Revision:	https://reviews.freebsd.org/D52472
2025-09-16 07:23:58 -04:00
John Baldwin 7314f78b24 aarch64: Clarify the initial adjustments to sp for kernel exception entry
The first store-pair instruction in save_registers_head decrements the
stack pointer to create room for most of the trapframe (and the
redzone area for nested exceptions).  However, the expression was a
bit non-intuitive as it was using an expression without a leading
negative sign to adjust the stack pointer.  Rewrite the expression so
that it is more clearly a negative adjustment to the stack pointer.

Suggested by:	andrew
Reviewed by:	andrew
Sponsored by:	AFRL, DARPA
Differential Revision:	https://reviews.freebsd.org/D52514
2025-09-16 07:21:39 -04:00
Peter Holm da20d88599 stress2: Added two new fdescfs test scenarios 2025-09-16 11:21:04 +02:00
Peter Holm 8af56f7e08 stress2: Fix how the reproducer is run. Lingering threads seen before 2025-09-16 11:18:20 +02:00
Andrey V. Elsukov 588a5fad3e IPv6: fix off-by-one in pltime and vltime expiration checks
Previously, the macros used '>' instead of '>=' when comparing elapsed
time against the preferred and valid lifetimes. This caused any deprecated
address to become usable again for one extra second after receiving each
Router Advertisement. In that short window, the address could be
selected as a source for outgoing connections.

Update the checks to use '>=' so that addresses are deprecated or
invalid when their lifetime expires.

PR: 		289177
Reported by:	Dmitry Nexus <fbsd.4f6a at nexus tel>
Reviewed by:	zlei
Submitted by:	Marek Zarychta
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D52323
2025-09-16 10:34:55 +03:00
Corvin Köhne effcd0ded0 bhyve: assign a valid INTPIN to NVIDIA GPUs
When passing an NVIDIA GPU to a Linux VM, the GPU driver refuses to work and
complains about a missing IRQ:

[ 77.208984] NVRM: Can't find an IRQ for your NVIDIA card!
[ 77.212697] NVRM: Please check your BIOS settings.
[ 77.212699] NVRM: [Plug & Play OS] should be set to NO
[ 77.212700] NVRM: [Assign IRQ to VGA] should be set to YES
[ 77.212702] nvidia: probe of 0000:00:07.0 failed with error -1

By setting a valid INTPIN in the PCI config space those error messages
disappear. Additionally, tools like nvidia-smi are able to detect the GPU and
the GPU driver seems to work properly.

Note that bhyve still doesn't support legacy interrupts. So, the guest
shouldn't try to use it even though we're assigning an INTPIN.

Reviewed by:		jhb
Tested by:		chuck
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D51892
2025-09-16 08:55:09 +02:00
Colin Percival 8c9a919aba release: Fix typo in powerpc mkisoimages.sh
"[ n foo ]" is an error and should have been "[ -n foo ]".

Fortunately the only ill effect was to result in garbage in /tmp/ when
creating powerpc ISO images.

Fixes:	6c3e01bf85 ("release: Randomize powerpc boot block file name")
MFC after:	3 days
Sponsored by:	https://www.patreon.com/cperciva
2025-09-15 18:11:21 -07:00
Colin Percival b050bfa88d release: Pass ABI to running pkgbase-stage on dvd
I did this for disc1 but forgot to amend the dvd invocation.

Fixes:	340e68fd7c ("release: Pass ABI to pkgbase-stage.lua")
MFC after:	3 days
Sponsored by:	https://www.patreon.com/cperciva
2025-09-15 18:11:21 -07:00
Alex Richardson 34a006eaa3 libc++: silence -Wnontrivial-memaccess warning with newer clang
Apply part of LLVM commit 71315698c91d0cda054b903da0594ca6f072c350 to
silence the -Wnontrivial-memaccess warning that is triggered any time
this function is instantiated by user code. This fixes another
buildworld failure with Clang HEAD.

Original commit message:
[clang] Warn about memset/memcpy to NonTriviallyCopyable types (#111434)
This implements a warning that's similar to what GCC does in that
context: both memcpy and memset require their first and second operand
to be trivially copyable, let's warn if that's not the case.

Reviewed by:	emaste, dim
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D52534
2025-09-15 15:14:18 -07:00
Alex Richardson 086ce467ad libc++: Fix deprecation warnings with latest clang
Latest clang has become more strict in diagnosing deprecated decls, so
pull in LLVM commit 9feac2cbd0d80927ce9a8b4c3e810d2b81802d55.

Original commit message:
[libc++] Improve deprecated diagnostic guards.

Recent Clang-21 builds improved the deprecated diagnotics. This
uncovered missing guards in libc++ internally.

Reviewed by:	dim
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D52531
2025-09-15 15:13:46 -07:00
Alex Richardson dee76cf2f3 libc++: avoid use of deprecated __reference_binds_to_temporary
This was removed in upstream libc++ in commit
437ad06f762ab07d89badecdd20627db200b98d3, but as this does not apply
cleanly to the current repository, I am applying the equivalent change
in a minimally invasive way. This is needed to build with latest clang
HEAD as of today.

Reviewed by:	dim
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D52530
2025-09-15 15:12:45 -07:00
Alex Richardson d61c75f634 libc++: avoid use of deprecated builtin
This pulls in LLVM commit accfbd4cb327411ad66c0109ba1841482b871967 to
avoid the use of __libcpp_is_trivially_relocatable.
This fixes building FreeBSD libc++ with clang HEAD as of today.

Original commit message:
[libc++] Replace __is_trivially_relocatable by is_trivially_copyable (#124970)

The __is_trivially_relocatable builtin has semantics that do not
correspond to any current or future notion of trivial relocation.
Furthermore, it currently leads to incorrect optimizations for some
types on supported compilers:
- Clang on Windows where types with non-trivial destructors get
  incorrectly optimized
- AppleClang where types with non-trivial move constructors get
  incorrectly optimized

Until there is an agreed upon and bugfree implementation of what it
means to be trivially relocatable, it is safer to simply use trivially
copyable instead. This doesn't leave a lot of types behind and is
definitely correct.

Reviewed by:	dim
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D52529
2025-09-15 15:11:08 -07:00
Alex Richardson 969be39fb3 if_ovpn.c: fix use of uninitialized variable
In case we use OVPN_CIPHER_ALG_NONE, the memcpy will attempt to copy 0
bytes from an uninitialized pointer. While the memcpy() implementation
will treat this as a no-op and not actually dereferece the undefined
variable it is still undefined behaviour to the compiler and should be
fixed. Found by building with clang HEAD

Reviewed by:	kp
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D52543
2025-09-15 15:08:44 -07:00
Alex Richardson 90234b9dd8 riscv: Provide prototypes for fpgetmask/fpsetmask
These functions are stubs that do nothing but are called by some software
and not providing them results in implicit function declaration errors.
This was missed in D25740.

Reviewed by:	#riscv, mhorne
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D52035
2025-09-15 15:08:14 -07:00
John-Mark Gurney e1bc42cb15 e1000: fix/complete merge of previous two commits
When fixing the conflicts caused by gallatin's commit and the reviewed
patch, I missed this location because it didn't exist when gallatin did
their change.

Obtained from: Juniper Networks, Inc.
2025-09-15 14:43:54 -07:00
Ahmad Khalifa 27699e31fa boot/universe.sh: toggle LOADER_BIOS_TEXTONLY
Build without LOADER_BIOS_TEXTONLY since it is now the default.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D52559
2025-09-16 00:38:56 +03:00
Lexi Winter 6d83ae143b share/man/man[49]: Set PACKAGE=kernel-man
When MANSPLITPKG is disabled (which is now the default), the kernel
manpages in sections 4 and 9 are installed in the -kernel package
instead of the -kernel-man package, because bsd.man.mk doesn't add
the -man suffix.

Since we already have handling for kernel-man in generate-ucl.lua,
set PACKAGE=kernel-man to make sure they're always in the right
package.

To avoid creating -kernel-man-man when WITH_MANSPLITPKG is enabled,
add some logic to bsd.man.mk (suggested by kevans) to avoid adding
the -man suffix if the package already has a -man suffix, and while
here, ensure ${__group}PACKAGE is always defined.

MFC after:	3 seconds
Reviewed by:	des, bapt
Differential Revision:	https://reviews.freebsd.org/D52525
2025-09-15 19:35:18 +01:00
Li-Wen Hsu a75c3c2c63 udbc(4): connect to build
Reviewed by:	thj
MFC with:	d566b6a70b
Sponsored by:	The FreeBSD Foundation
2025-09-16 02:34:43 +08:00
Dag-Erling Smørgrav 18fd1443d2 ifconfig: Enter jail as soon as possible
Some options (in particular, -g) are processed immediately upon being
parsed.  This will produce the wrong result in combination with -j since
we only attach to the jail after we're done parsing arguments.  Solve
this by attaching to the jail immediately when -j is encountered.  The
downside is that e.g. `ifconfig -j foo -j bar` would previously attach
to jail “bar”, whereas now it will attempt to attach to jail “foo”, and
if successful, attempt to attach to jail “bar” within jail “foo”.  This
may be considered a feature.

PR:		289134
MFC after:	1 week
Reviewed by:	zlei
Differential Revision:	https://reviews.freebsd.org/D52501
2025-09-15 19:56:33 +02:00
Damjan Jovanovic e8b5025c38 sound: Honor CHN_F_NBIO
If the device is opened with O_NONBLOCK, even though we check for it in
order to set CHN_F_NBIO, the subsequent chn_reset() calls will clear all
flags, except those set in CHN_F_RESET, which does not include
CHN_F_NBIO.

Add CHN_F_NBIO to CHN_F_RESET. Additionally, because primary channels
can be reused, make sure we do not unintentionally keep CHN_F_NBIO set
if the channel is re-opened, but without O_NONBLOCK.

PR:		289441
MFC after:	2 days
Reviewed by:	christos, markj
Differential Revision:	https://reviews.freebsd.org/D52493
2025-09-15 20:42:41 +03:00
Mark Johnston 246d7e9fc2 jail: Optionally allow audit session state to be configured in a jail
Currently it is impossible for a privileged, jailed process to set audit
session state.  This can result in suprising audit event misattribution.
For example, suppose a user ssh'es into a jail and restarts a service;
normally, sshd sets audit state such that events generated by the SSH
session are attributed to the newly authenticated user, but in a jail,
the corresponding setaudit(2) call fails, so events are attributed to
the user who had started sshd in the jail (typically the user who had
started the jail itself by some means).

While this behaviour is reasonable, administrators might want to trust
the jailed sshd to reset audit state, such that the authenticated user
appears in audit logs.  Add a jail knob to enable this.  Add a simple
regression test.

Reviewed by:	kevans, jamie
MFC after:	1 week
Sponsored by:	Modirum MDPay
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D51719
2025-09-15 17:23:50 +00:00
Jonathan T. Looney cd02a8a9f8 ip6: add SO_BINTIME support
This adds support for obtaining timestamps from IPv6 packets using the
SO_BINTIME socket option, bringing it in parity with IPv4 behavior.

Enable testing the SO_BINTIME option in the relevant (manual) regression
test.

PR:		289423
Reviewed by:	markj
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D52504
2025-09-15 16:46:03 +00:00
Tom Jones d566b6a70b udbc: Add usb debug host mode driver
xhci offers a debugging interface which uses a special usb 3 cable with the D+,
D- and VBUS pairs disconnected. This interface allows a target device to
configure its xhci controller as a debugging channel which can then be used to
provide a serial link between the target and a debug host.

This change extracts the udbc host mode driver from hrs@'s xhci debug
implementation.

Reviewed by:	bcr (man page)
MFC after:	Before 15-ALPHA3 builds
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D51299
2025-09-15 15:44:05 +01:00
Konstantin Belousov f1b656f144 vm_fault_busy_sleep(): update comment after addition of allocflags arg
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D52538
2025-09-15 17:11:57 +03:00
Mark Johnston 081f0e38e3 zfs: Use the correct type for raidz_outlier_check_interval_ms
raidz_outlier_check_interval_ms has type hrtime_t, which is a long long,
which is 64 bits wide on all supported platforms.
2025-09-15 14:07:35 +00:00
Mark Johnston 18fd3f8ec5 ng_btsocket_rfcomm: Mark a couple buffers as const in a helper function
Fixes:	680f9acc36 ("ng_hci: Cast NG_HCI_BDADDR_ANY to const bdaddr_t *")
2025-09-15 13:57:19 +00:00
Hareshx Sankar Raj 7fbd362c09 qat: enable qat driver for 402xx device
Enabled qat driver support for 402xx device with
ID 0x4944/0x4945. This is an additional device supported
under the existing qat_4xxx driver. Firmwares specific to
the 402xx device are added.

Signed-off-by: Hareshx Sankar Raj <hareshx.sankar.raj@intel.com>

Relnotes:	yes
Sponsored by:	Intel Corporation
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D52488
2025-09-15 13:48:45 +00:00
Andrew Turner 226375a1f6 arm64: Fix the FEAT_WFxT check
The check was always true so would incorrectly enable the feature when
it wasn't supported.

Due to another bug this was harmless.

Sponsored by:	Arm Ltd
2025-09-15 14:32:18 +01:00
Andrew Turner 8fee6b9ecc arm64: Add the new C1 CPU IDs
Add the Arm C1-Nano, C1-Pro, C1-Premium, and C1-Ultra CPUs from their
Technical Reference Manuals.

Sponsored by:	Arm Ltd
2025-09-15 14:32:18 +01:00
Christos Margiolis 680f9acc36 ng_hci: Cast NG_HCI_BDADDR_ANY to const bdaddr_t *
This is needed to address some compiler errors cleanly, where consumer
functions want this address to be a const pointer.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	markj
Differential Revision: https://reviews.freebsd.org/D52310
2025-09-15 16:09:42 +03:00
Christos Margiolis dafd960a3d libsamplerate: Define as PRIVATELIB
Fixes the following warnings:

ld: error: relocation R_X86_64_32S cannot be used against local symbol; recompile with -fPIC

>>> defined in /usr/obj/usr/src/amd64.amd64/lib/libsamplerate/libsamplerate.a(samplerate.o)
>>> referenced by samplerate.c:498 (/usr/src/contrib/libsamplerate/samplerate.c:498)
>>>
>>>   samplerate.o:(src_new) in archive /usr/obj/usr/src/amd64.amd64/lib/libsamplerate/libsamplerate.a

Related discussion: https://reviews.freebsd.org/D52306

Sponsored by:	The FreeBSD Foundation
Reviewed by:	fuz
Differential Revision:	https://reviews.freebsd.org/D52307
2025-09-15 16:09:38 +03:00
Kristof Provost d0ea3de0fe pf tests: verify rule numbers in pflog output
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2025-09-15 11:32:36 +02:00
Kristof Provost 8e84e9443b pfctl: remove prototypes with no matching function
Obtained from:	OpenBSD, jsg <jsg@openbsd.org>, 6768654732
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2025-09-15 11:32:36 +02:00
Kristof Provost a66df2b575 pf: sync_ifp doesn't exist, remove externs
Obtained from:	OpenBSD, jsg <jsg@openbsd.org>, 7ac7a88014
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2025-09-15 11:32:35 +02:00
Kristof Provost 2c42aecee6 pfctl: ctime(3) and ctime_r(3) can fail when timestamps are way off.
Add missing error checks

Input kettenis, millert
OK millert

Obtained from:	OpenBSD, florian <florian@openbsd.org>, a7b9eedcb4
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2025-09-15 11:32:35 +02:00
Kristof Provost 5e89648ee6 pf tests: test fragment counters
Ensure that the fragmentation counters work as expected.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2025-09-15 11:32:35 +02:00
Kristof Provost c00aca9a71 pf: Show pf fragment reassembly counters.
Framgent count and statistics are stored in struct pf_status.  From
there pfctl(8) and systat(1) collect and show them.  Note that pfctl
-s info needs the -v switch to show fragments.

input claudio@; OK henning@

Obtained from:	OpenBSD, bluhm <bluhm@openbsd.org>, 19e99d0613
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2025-09-15 11:32:34 +02:00
Kristof Provost 0a67f601fe pf.conf.5: hint how to set tcp timeout collectively
Hint that the tcp timeout values can be adjusted collectively via "set
optimization".

from jesper wallin
ok bluhm

Obtained from:	OpenBSD, jmc <jmc@openbsd.org>, df80715c2d
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2025-09-15 11:32:34 +02:00
Kristof Provost 864458ce50 pf.conf.5: document tcp.tsdiff
from jesper wallin
ok bluhm

Obtained from:	OpenBSD, jmc <jmc@openbsd.org>, 8c83d32726
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2025-09-15 11:32:34 +02:00
Kristof Provost 79a0959aff pfctl: add af-to and other missing action types in print_rule()
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2025-09-15 11:32:34 +02:00
Kristof Provost c2d03a920e pfctl: fix anchortypes bounds test
found by "buffer overflow 'anchortypes' 10 <= 12" smatch error
feedback and ok sashan@, ok miod@ on an earlier version

Obtained from:	OpenBSD, jsg <jsg@openbsd.org>, 730c5d0121
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2025-09-15 11:32:33 +02:00
Aymeric Wibo 4894f5ba39 acpi: Fix build when ACPI_DEBUG_OUTPUT defined
Reviewed by:    olce
Fixes:          ce5e22b28e ("acpi: Use sleep types defined in sys/power.h")
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52545
2025-09-15 11:29:49 +02:00
Olivier Certner ef2f36be8f jail.2: Mention EPERM is returned on open directories
The manual page does not directly mention this reason for getting EPERM,
instead referring the reader to chroot(2).  We have had some questions
about it recently, in part due to a bug (fixed), and this case is not an
obvious permission/problem, so let's be more explicit.

PR:             280809
Reviewed by:    jamie
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52319
2025-09-15 11:29:44 +02:00
Peter Holm 7780766b40 stress2: Do not exit the test program without clearing the trace flags
Discussed with:	 kib
2025-09-15 10:48:01 +02:00
Harry Fellowes e239f49146 UPDATING: fix typos
Fixed typos in UPDATING

Signed-off-by: Harry Fellowes <harryfellowes1@gmail.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1846
2025-09-14 21:07:13 -06:00
Warner Losh 5e0a4859f2 iwlwifi: Don't compile for gcc before 14
gcc 13 and earlier don't have __builtin_bitcountg. The linux wifi kpi
uses this unconditionally. While in this one use, it might not be
needed, I opted to not compile iwlwifi when building gcc12 or 13 rather
than risk breaking it for everbody else.

With this change gcc12 builds the kernel. Maybe this will stop jenkins
email for every commit I make.

Sponsored by:		Netflix
2025-09-14 21:03:45 -06:00
Alan Somers 2918cf3582 fusefs: spaces to tabs. No functional change.
[skip ci]
2025-09-14 18:31:56 -06:00
Alan Somers d1eaa52d10 fusefs: fix the last_local_modify LLM/LastLocalModify.lookup/3 test
The LastLocalModify tests were originally written to simulate a race
condition between VOP_SETATTR and VOP_LOOKUP.  They were later extended
to cover some other VOPs that can affect file size, including VOP_WRITE.
However, the test never correctly simulated the race with VOP_WRITE.  So
that test only ever passed by accident.  Fix it by always opening the
file with O_DIRECT.

PR:		289237
Reported by:	Siva Mahadevan <me@svmhdvn.name>
MFC after:	1 week
2025-09-14 18:30:30 -06:00
Aymeric Wibo e779891327 sys/power: Sleep type reporting by PM backends
Allow PM backends to report supported sleep types when registering
through `power_pm_register`. Expose this information through
`kern.power.supported_stype` sysctl, and set defaults for
`power_standby/suspend/hibernate_stype` based on this.

Implement this in ACPI PM backend.

Reviewed by:	mckusick (mentor), markj
Approved by:	mckusick (mentor), markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D52044
2025-09-14 23:58:15 +02:00