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
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
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
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
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
"[ 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
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
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
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
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
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
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
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
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.
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
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
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
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
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
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
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
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
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
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
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")
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")
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")
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
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
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
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
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