Commit graph

4894 commits

Author SHA1 Message Date
Franco Fichtner
f3a6d39cc4 apuled: import APU 1-3 LED kernel module
Taken from: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=189772
PR: https://github.com/opnsense/core/issues/2114
2025-07-09 10:05:47 +02:00
Hareshx Sankar Raj
6f3c8060d5 qat: add disable safe dc mode for QAT SPR devices
Build and sysctl configuration modes are introduced for QAT SPR
devices to disable safe dc mode. A new QAT driver build option
‘QAT_DISABLE_SAFE_DC_MODE’ is required to build the QAT driver
with code that allows a request to be sent to FW to override the
‘History Buffer’ mitigation. Default QAT driver builds do not
include this ‘QAT_DISABLE_SAFE_DC_MODE’ build option. Even if the
QAT driver was built with code that allows a request to be sent to
FW to override the ‘History Buffer’ mitigation, the QAT driver must
still be configured using sysctl to request an override of the
‘History Buffer’ mitigation if desired. The default QAT driver
configuration option sysctl dev.qat.X.disable_safe_dc_mode does not
allow override of the mitigation. The new sysctl attribute
disable_safe_dc_mode is to be set to 1 for overriding the history
buffer mitigation. Firmware for qat_4xxx is updated for this change.
If this mode is enabled, decompression throughput increases but may
result in a data leak if num_user_processes is more than 1.
This option is to be enabled only if your system is not prone to
user data leaks.

Reviewed by:	markj, ziaee
MFC after:	2 weeks
Sponsored by:   Intel Corporation
Differential Revision:  https://reviews.freebsd.org/D50379

(cherry picked from commit 5a8e5215cef0dac1115853889e925099f61bb5fa)
2025-07-09 10:05:45 +02:00
Doug Rabson
1ca2f5d1f7 Add an implementation of the 9P filesystem
This is derived from swills@ fork of the Juniper virtfs with many
changes by me including bug fixes, style improvements, clearer layering
and more consistent logging. The filesystem is renamed to p9fs to better
reflect its function and to prevent possible future confusion with
virtio-fs.

Several updates and fixes from Juniper have been integrated into this
version by Val Packett and these contributions along with the original
Juniper authors are credited below.

To use this with bhyve, add 'virtio_p9fs_load=YES' to loader.conf. The
bhyve virtio-9p device allows access from the guest to files on the host
by mapping a 'sharename' to a host path. It is possible to use p9fs as a
root filesystem by adding this to /boot/loader.conf:

	vfs.root.mountfrom="p9fs:sharename"

for non-root filesystems add something like this to /etc/fstab:

	sharename /mnt p9fs rw 0 0

In both examples, substitute the share name used on the bhyve command
line.

The 9P filesystem protocol relies on stateful file opens which map
protocol-level FIDs to host file descriptors. The FreeBSD vnode
interface doesn't really support this and we use heuristics to guess the
right FID to use for file operations.  This can be confused by privilege
lowering and does not guarantee that the FID created for a given file
open is always used for file operations, even if the calling process is
using the file descriptor from the original open call. Improving this
would involve changes to the vnode interface which is out-of-scope for
this import.

Differential Revision: https://reviews.freebsd.org/D41844
Reviewed by: kib, emaste, dch
MFC after: 3 months
Co-authored-by: Val Packett <val@packett.cool>
Co-authored-by: Ka Ho Ng <kahon@juniper.net>
Co-authored-by: joyu <joyul@juniper.net>
Co-authored-by: Kumara Babu Narayanaswamy <bkumara@juniper.net>
2025-06-20 09:54:02 +02:00
Warner Losh
e79a3515c2 mpi3mr: Remove -g
This -g was introduce when I didn't review all the cahnges to mpi3mr I
was MFCing. Remove it. This is a direct commit.

PR: 249068
Fixes: 80b069913d
Sponsored by:		Netflix
Approved by:  re (cperciva)
(cherry picked from commit 22ebbdea3f33fdeae5ee83077ea9c25979705f2f)
2025-05-12 16:45:35 -06:00
Chandrakanth patil
80b069913d mpi3mr: Divert large WriteSame IOs to firmware if unmap and ndob bits are set
Firmware advertises the transfer lenght for writesame commands to driver during init.
So for any writesame IOs with ndob and unmap bit set and transfer lengh is greater
than the max write same length specified by the firmware, then direct those commands
to firmware instead of hardware otherwise hardware will break.

Reviewed by:            imp
Approved by:            imp
Differential revision:  https://reviews.freebsd.org/D44452

(cherry picked from commit 3f3a15543a6721100dda0e4219eb48ecbe35731a)
2025-04-30 11:05:52 -06:00
Vladimir Kondratyev
9b5f1a6cd6 acpi_asus_wmi(4): Improve keyboard backlight support.
- Fix maximal keyboard backlight level, Although Linux source code
  comment says that backlight level is encoded in 3 bits of data,
  actual code limits maximum level to 3.
- Add backlight(9) support for keyboard
- Turn off/on keyboard backlight on suspend/resume

Sponsored by:	Future Crew LLC
MFC after:	1 month
Reviewed by:	mav
Differential Revision:	https://reviews.freebsd.org/D48983

(cherry picked from commit f134662a1a5726d78880385002a03b8fe68805f6)
2025-04-30 10:32:22 +03:00
Vladimir Kondratyev
6616f35456 acpi_asus_wmi(4): Add EVDEV support
Use input event device to export hotkey events.

Sponsored by:	Future Crew LLC
MFC after:	1 month
Reviewed by:	mav
Differential Revision:	https://reviews.freebsd.org/D48982

(cherry picked from commit 5e41194bfcc54fb506070f7a01d5bc00326cde66)
2025-04-30 10:32:22 +03:00
Bjoern A. Zeeb
8ef4424517 rtw88: merge Realtek's rtw88 driver based on Linux v6.14
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
38fec10eb60d687e30c8c6b5420d86e8149f7557 ( tag: v6.14 ).

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit a0ccc12f6882a886d89ae279c541b2c2b62c6aca)
2025-04-29 22:29:51 +00:00
Bjoern A. Zeeb
b6e8b845ae rtw89: merge Realtek's rtw89 driver based on Linux v6.14
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
38fec10eb60d687e30c8c6b5420d86e8149f7557 ( tag: v6.14 ).

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit df279a26d3315e7abc9e6f0744137959a4c2fb86)
2025-04-29 22:29:51 +00:00
Bjoern A. Zeeb
42be6050ce iwlwififw: remove Intel iwlwifi firmware from src.git
Following the example of rtw88 and rtw89 only ship iwlwifi firmware
from ports/packages.  Users are asked to run fwget(8) to install the
firmware needed for their system or build it from ports
(see also UPDATING).

This is the end of a long story adding wireless support to fwget(8),
migrating the firmware for multiple branches into ports, splitting them
up into flavors, and updating some install media and the installer to
provide firmware.

The overall amount for new firmware amongst all drivers would have
added more than 100M of binary blobs to src.git for the first import,
ignoring future updates which (along with some duplication between
multiple drivers) was considered too much.

While maintenance within the src tree certainly would have been
easier in the longer term this seems to be the better solution and
I would like to thank everyone who helped along the path to get there.

The iwlwififw.4 man page is to stay (for now) and will likely point
at the appropriate firmware package flavor in the future as well
so people may find it easier to transition.  In the long term this
information is likely not needed anymore.

Sponsored by:	The FreeBSD Foundation
Requested by:	core (Oct 2022)
Reviewed by:	thj, jrm (earlier)
Differential Revision: https://reviews.freebsd.org/D49713

(cherry picked from commit 558d638896239f9cd25b9d825ecfce62ec54681e)
(cherry picked from commit 918783b75aacb051f2f83dd0198ef68bc9fa5326)
2025-04-18 14:36:03 +00:00
Gleb Smirnoff
886fcbde46 acpi_ibm: pass brightness events to evdev(4)
unless the dev.acpi_ibm.0.handlerevents sysctl is set to process
them internally.  The default for the latter is to ignore them,
so passing to evdev(4) is enabled by default.

Reviewed by:		wulf, imp
Tested on:		Lenovo Thinpad X11 Carbon 7Th Gen
Differential Revision:	https://reviews.freebsd.org/D48174

(cherry picked from commit c21f5751ef0932796676e55953461e0679020e28)
2025-03-31 10:31:21 -07:00
Bjoern A. Zeeb
be330cd9f9 rtw89: turn on debugfs support
Following 07f6575585bf also turn on debugfs support for rtw89.

Sponnsored by:	The FreeBSD Foundation

(cherry picked from commit 446eab491e523e3d7586e11cb16448e524297da4)
2025-02-10 14:52:11 +00:00
Bjoern A. Zeeb
787787fa89 iwlwifi: module correct -DCONFIG_*
Remove the =1 from -DCONFIG_* in the conditional cases.
They are not needed.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 411c857b4ccedd6491dff9a35e952bc49d053053)
2025-02-10 14:52:11 +00:00
Bjoern A. Zeeb
bd42a25673 LinuxKPI: 802.11: turn on debugfs for iwlwifi and rtw88
Make iwlwifi compile with debugfs after the last updates and turn it on
for both iwlwifi and rtw88 in order to be able to get at least some
useful information on driver/firwmare state.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 07f6575585bf69ae48dffe87c4578057ae4782d8)
2025-02-10 14:52:11 +00:00
Bjoern A. Zeeb
e6698f0614 rtw89: update Realtek's rtw89 driver.
This adds support for the Realtek 8922AE PCI
wireless network (Wi-Fi 7) adapter.

This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
98f7e32f20d28ec452afb208f9cffc08448a2652 ( tag: v6.11 ).

Sponsored by:   The FreeBSD Foundation

(cherry picked from commit 6d67aabd63555ab62a2f2b7f52a75ef100a2fe75)
2025-02-10 14:52:07 +00:00
Bjoern A. Zeeb
3de0d1929d rtw88: update Realtek's rtw88 driver.
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
98f7e32f20d28ec452afb208f9cffc08448a2652 ( tag: v6.11 ).

Sponsored by:   The FreeBSD Foundation

(cherry picked from commit 11c53278a8a3e86e14377f09bbaa7bad193d3713)
2025-02-10 14:52:07 +00:00
Bjoern A. Zeeb
f4e352ef16 iwlwifi: update Intel's iwlwifi/mvm driver.
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
98f7e32f20d28ec452afb208f9cffc08448a2652 ( tag: v6.11 ).

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit a4128aad8503277614f2d214011ef60a19447b83)
2025-02-10 14:52:07 +00:00
Mark Johnston
18a39dedbd dtrace: Build systrace_freebsd32 only if COMPAT_FREEBSD32 is configured
MFC after:	1 week
Sponsored by:	Innovate UK

(cherry picked from commit 1e734f15c7099408f45d3b1ea433868d0468916f)
2025-01-30 15:23:04 +00:00
Ed Maste
96ef85cc51 lindebugfs: Export symbols
We currently rely on the kernel linker resolving undefined references
against local symbols from other kernel modules.  Be explicit about the
symbols to export, in advance of changing that behaviour.

PR:		207898
Reviewed by:	kib, bz
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D47980

(cherry picked from commit c3d2c959b5c0ea05d6e5162def35d51ec267590c)
2025-01-07 13:48:33 -05:00
Vladimir Kondratyev
f5b685add0 ng_ubt(4): do not attach Realtek 87XX/88XX adaptors in bootloader mode.
Attempt to initialize FreeBSD bluetooth stack while such a device is in
bootloader mode locks the adapter hardly so it requires power on/off
cycle to restore.

This change blocks ng_ubt attachment unless operational firmware is
loaded thus preventing the lock up.

Sponsored by:	Future Crew LLC
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D46738

(cherry picked from commit 24ae172a50352ad4fd22989477f29ecca5aed6e3)
2024-12-22 06:34:09 +03:00
Martin Matuska
2ec8b69480 zfs: merge openzfs/zfs@e269af1b3 (zfs-2.2-release) into stable/14
OpenZFS release 2.2.7

Notable upstream pull request merges:
 #15457 022bf8637 Increase L2ARC write rate and headroom
 #15527 1ba5b2ef8 freebsd: remove __FBSDID macro use
 #15792 9e7af55e8 Add custom debug printing for your asserts
 #15793 a1ea40af8 libzfs: use zfs_strerror() in place of strerror()
 #16181 -multiple zdb/ztest: improve and harmonise crash output
 #16208 e5e4957a5 Allow block cloning to be interrupted by a signal
 #16210 ba4e582a6 FreeBSD: Add const qualifier to members of struct
                  opensolaris_utsname
 #16225 a6198f34b Simplify issig()
 #16335 25ec9a903 zdb: fix BRT dump
 #16364 cf80a803d zvol: ensure device minors are properly cleaned up
 #16404 384b53be8 FreeBSD: Add missing memory reclamation accounting
 #16492 -multiple Split "shared" userspace & kernel code into separate files
 #16496 f1694496a zfs_file: rename zfs_file_fallocate to zfs_file_deallocate
 #16511 bc0d89bfc Fix an uninitialized data access
 #16529 2dc8529d9 Fix handling of DNS names with '-' in them for sharenfs
 #16539 30ea44296 zfs_log: add flex array fields to log record structs
 #16546 098789216 Evicting too many bytes from MFU metadata
 #16551 54278533a Reduce and handle EAGAIN errors on AIO label reads
 #16554 84ad1d536 FreeBSD: restore zfs_znode_update_vfs()
 #16565 21c40e6d9 FreeBSD: Sync taskq_cancel_id() returns with Linux
 #16567 48482bb2f Properly release key in spa_keystore_dsl_key_hold_dd()
 #16584 e8f4592a1 Avoid computing strlen() inside loops
 #16605 acc8a3186 ARC: Cache arc_c value during arc_evict()
 #16650 fc60e0c6e freebsd: Use compiler.h from FreeBSD's base's linuxkpi
 #16667 b32b35cea zdb: show bp in uberblock dump
 #16684 1f5e1b919 Pack dmu_buf_impl_t by 16 bytes
 #16688 73b3e8ace Fix gcc uninitialized warning in FreeBSD zio_crypt.c
 #16690 727506c94 On the first vdev open ignore impossible ashift hints
 #16692 d83cd5307 zdb: add extra -T flag to show histograms of BRT refcounts
 #16693 82ab837a0 Fix gcc unused value warning in FreeBSD simd.h
 #16740 2bba6e3c5 BRT: Don't call brt_pending_remove() on holes/embedded
 #16801 299da6ace Fix race in libzfs_run_process_impl

Obtained from:	OpenZFS
OpenZFS commit: e269af1b3c
OpenZFS tag:	zfs-2.2.7
2024-12-12 13:22:56 +01:00
Christos Margiolis
01f650cb8d sound: Merge ac97 and ac97_patch
No functional change intended.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D47732

(cherry picked from commit 0b4e32912566d802c7a6501d9ce8119f04dbc2fb)
2024-12-04 13:03:36 +01:00
Shailend Chand
c7aea09126 gve: Add DQO RDA support
DQO is the descriptor format for our next generation virtual NIC.
It is necessary to make full use of the hardware bandwidth on many
newer GCP VM shapes.

One major change with DQO from its predecessor GQI is that it uses
dual descriptor rings for both TX and RX queues.

The TX path uses a descriptor ring to send descriptors to HW, and
receives packet completion events on a TX completion ring.

The RX path posts buffers to HW using an RX descriptor ring and
receives incoming packets on an RX completion ring.

In GQI-QPL, the hardware could not access arbitrary regions of
guest memory, which is why there was a pre-negotitated bounce buffer
(QPL: Queue Page List). DQO-RDA has no such limitation.

"RDA" is in contrast to QPL and stands for "Raw DMA Addressing" which
just means that HW does not need a fixed bounce buffer and can DMA
arbitrary regions of guest memory.

A subsequent patch will introduce the DQO-QPL datapath that uses the
same descriptor format as in this patch, but will have a fixed
bounce buffer.

Signed-off-by: Shailend Chand <shailend@google.com>
Reviewed-by: markj
MFC-after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D46690

(cherry picked from commit d438b4ef0cfc6986b93d0754f49ebf3ead50f269)
2024-11-20 21:41:08 +00:00
Mark Johnston
f5f29d3c13 vmm: Rename the amdiommu driver to amdviiommu
(cherry picked from commit f95acbd89d594b5932197679d94d2ba23c1d0331)
2024-11-09 21:31:28 +02:00
Ravi Pokala
393bbd23b3 modules: gpioaei: Fix arm64.LINT-FDT breakage
'acpi_if.h' was accidentally omitted from the module Makefile; add it.

Fixes:	9709bda03cd0
(cherry picked from commit bb8b3b1741188ab284e8b48ec367961a480421cb)
2024-11-03 08:01:28 -08:00
Colin Percival
5a53843aef modules: gpioaei only on ACPI-supporting archs
Fixes:	9709bda03cd0 ("GPIO: Add ACPI _AEI support")
Pointy-hat to:	cperciva
Sponsored by:	Amazon

(cherry picked from commit 6540ac118473dde29cb02f786c79c64f73834ca1)
2024-11-03 08:01:28 -08:00
Colin Percival
c2cd78d944 GPIO: Add ACPI _AEI support
Changes to acpi_gpiobus.c handle discovering and parsing the _AEI
objects and storing necessary data in device ivars.  A new gpioaei.c
file implements the device, which simply requests an interrupt when
the pin is triggered and invokes the appropriate _Exx or _Lxx ACPI
method.

This makes the GPIO "power button" work on arm64 Graviton systems,
allowing EC2 "Stop"/"Reboot" instance calls to be handled cleanly.
(Prior to this change, those requests would time out after 4 minutes
and the instance would be forcibly killed.)

Reviwed by:	imp, andrew, Ahmad Khalifa
MFC after:	3 days
Sponsored by:	Amazon
Differential Revision:	https://reviews.freebsd.org/D47253
Co-authored-by:	Andrew Turner <andrew@FreeBSD.org>

(cherry picked from commit 9709bda03cd0f20eba0ba4276fc3c2e06354a54f)
2024-11-03 08:01:28 -08:00
Ahmad Khalifa
14887d2c86 gpiobus(4): Add an acpi variant of gpiobus
This currently only implements the address space handler and attempts to
configure pins with flags obtained from ACPI.

Reviewed by:	wulf
MFC after:	1 month
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1359

(cherry picked from commit 92adaa5862d5ea94318a011e0618622d0fb72521)
2024-11-03 08:01:27 -08:00
Osama Abboud
b1718de62f ena: Update license signatures to 2024
This commit updates all the license signatures to 2024.

Approved by: cperciva (mentor)
Sponsored by: Amazon, Inc.

(cherry picked from commit 8d6806cd08c093fc001db1f94cf122368b8d1549)
2024-10-31 14:54:10 +00:00
Bjoern A. Zeeb
1579a25f0a LinuxKPI: pci: rename PCI_IRQ_LEGACY to PCI_IRQ_INTX
PCI_IRQ_LEGACY was added in 366d68f283 (likely) for rtw88 only.
The define now got renamed and I cannot find any other use but
rtw88 and rtw89.
We keep the old name as comapt while driver updates are in
progress enabling it defining LINUXKPI_VERSION for the two drivers.

Sponsored by;	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46822

(cherry picked from commit 157e93e0e8138fbaa6ab5d5b20b0c23f903667a6)
2024-10-31 14:33:56 +00:00
Eric Joyner
a9d78bb714
ice_ddp: Update to 1.3.41.0
Primarily adds support for E830 devices, unlocking all of their
functionality.

As well, update the README and remove the non-FreeBSD sections
from it.

Signed-off-by: Eric Joyner <erj@FreeBSD.org>

Sponsored by:	Intel Corporation

(cherry picked from commit f9a039060e834e89e0b2de1e8a442d78bd5c083d)
2024-10-30 13:51:47 -07:00
Dan McGregor
cfcf4ea70d
Address module reproducibility issues
Use .PATH & bare filename. This prevents the real source path from
being included in the built object, which improves reproducibility.

Signed-off-by: Dan McGregor <dan.mcgregor@usask.ca>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1211
(cherry picked from commit 8c2f6c3be0125142d3c1782e4b0ee0634c584b9e)
2024-10-30 13:51:34 -07:00
Andrew Turner
11b099f803 Add an Armv8 rndr random number provider
Armv8.5 adds an optional random number generator. This is implemented
as two special registers one to read a random number, the other to
re-seed the entropy pool before reading a random number. Both registers
will set the condition flags to tell the caller they can't produce a
random number in a reasonable amount of time.

Without a signal to reseed the entropy pool use the latter register
to provide random numbers to the kernel pool. If at a later time we
had a way to tell the provider if it needs to reseed or not we could
use the former.

On an Amazon AWS Graviton3 VM this never failed, however this may not
be the case on low end CPUs so retry reading the random number 10 times
before returning an error.

Reviewed by:	imp, delphij (csprng)
Sponsored by:	The FreeBSD Foundation
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D35411

(cherry picked from commit 9eecef052155646fbc5f8f533b952b372572d06a)
2024-10-21 15:03:26 +00:00
Bjoern A. Zeeb
71f81398f7 rtw89fw: remove module build dirs and firmware
rtw89 firmware files were removed from main a year ago after core members
asked to not import more biinary blobs into main.
Also remove the module build framework for them on stable/14 to
avoid any confusion (it was never attached to the build).

People are asked to use fwget(8) to automatically install firmware
from ports according to the man page.  A solution for the install
media is still pending.

X-MFC after:	rtw89 only
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit cf94672363d6638b7268c05b4628b62bbfc8dbe5)
(cherry picked from commit 7ff12dd25ada486c4d33e854977514b2db690e7f)
2024-10-16 22:01:56 +00:00
Bjoern A. Zeeb
a2d1e07f64 rtw89: add man page and hook driver up to the build
After two years, add the initial man page and hook Realteks rtw89
driver up to the build for more people to test given successful
reports.
devd.conf is already providing support based on the rtw<n+> regex.
The driver uses the LinuxKPI compat layer.

Firmware is provided by ports: net/wifi-firmware-rtw89-kmod or
one of the flavours.  People are advised to used fwget(8) to
automatically install the correct firmware for their chipset.

Please note that for the moment the driver requires a tunable to
be set in loader.conf: compat.linuxkpi.skb.mem_limit=1

Many thanks to everyone who in the last two years helped testing,
debugged, submitted patches to get the driver to this stage where
initial functionality seems working.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 310c31d3f04ef9d3ebe598fd076d017a48d0ca0d)
2024-10-16 21:49:29 +00:00
Bjoern A. Zeeb
dd4d05b25f mt76: add mt7615 to the pile of buildable drivers
Ignoring page_pools with the few needed adjustments and ignoring 7622
mt7615 seems to build as well.  Add it so once we can connect it to
the build people can start testing and debugging.
(The actual work was done on a newer version of the mt76 drivers but
it seems the to-build-changes equally apply here already).

Requested by:	Radu-Cristian Fotescu (freebsd-wireless, 2024-07-31)
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 7728586800bd5bb4655cff6d661133ed10cc2ff7)
2024-10-09 19:18:49 +00:00
Martin Matuska
755e773877 zfs: merge openzfs/zfs@33174af15 (zfs-2.2-release) into stable/14
OpenZFS release 2.2.6

Notable upstream pull request merges:
 #15557 bce36e21c module/icp/asm-arm/sha2: auto detect __ARM_ARCH
 #15623 2ca151537 module/icp/asm-arm/sha2: enable non-SIMD asm kernels on
                  armv5/6
 #16308 ac6500389 zfs: add bounds checking to zil_parse
 #16316 859f906a4 Fix null ptr deref when renaming a zvol with snaps and
                  snapdev=visible
 #16343 cd42e992b Enable L2 cache of all (MRU+MFU) metadata but MFU data
                  only
 #16382 3a36797ad FreeBSD: Fix RLIMIT_FSIZE handling for block cloning

Obtained from:	OpenZFS
OpenZFS commit:	33174af151
OpenZFS tag:	zfs-2.2.6
2024-09-09 22:41:36 +02:00
Andrew Turner
d5e29c62e9 linux64: Fix the build on arm64 with bti checking
When we enable checking for BTI on arm64 we need to include an ELF
note in all object files linked into a module.

As using objcopy from a binary to an ELF object file doesn't add the
note switch to using .incbin from an assembly file. This allows us to
add the needed note without affecting the included object.

Reviewed by:	imp, kib, emaste
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45468

(cherry picked from commit bed65d85c631c3a8e60a81a15a5a745c8ef92fbe)
(cherry picked from commit ec69d230933f82c7c142b053882255aa57475463)
2024-09-02 08:48:10 +00:00
Martin Matuska
d27c973264 zfs: merge openzfs/zfs@33174af15 (zfs-2.2-release) into stable/14
OpenZFS release 2.2.5

Notable upstream pull request merges:
 #15609 566841171 Only provide execvpe(3) when needed
 #15940 9edf6af4a Replace P2ALIGN with P2ALIGN_TYPED and delete P2ALIGN
 #16038 0f1e8ba2f L2ARC: Cleanup buffer re-compression
 #16104 b474dfad0 Refactor dbuf_read() for safer decryption
 #16118 938d1588e Make more taskq parameters writable
 #16131 672474659 Slightly improve dnode hash
 #16138 4c0fbd8d6 FreeBSD: Add zfs_link_create() error handling
 #16159 fa4b1a404 ZAP: Fix leaf references on zap_expand_leaf() errors
 #16162 41f2a9c81 Fix scn_queue races on very old pools
 #16165 4c484d66b Fix ZIL clone records for legacy holes
 #16206 27cc6df76 Use memset to zero stack allocations containing unions
 #16207 2eab4f7b3 Fix assertion in Persistent L2ARC
 #16214 13ccbbb47 Some improvements to metaslabs eviction
 #16216 ba3c7692c Destroy ARC buffer in case of fill error
 #16258 4d2f7f983 vdev_open: clear async fault flag after reopen
 #16264 ef08cb26d Fix long_free_dirty accounting for small files
 #16273 54ef0fdf6 head_errlog: fix use-after-free
 #16284 14cce09a6 FreeBSD: Use a statement expression to implement
                  SET_ERROR()
 #16406 6f27c4cad Make 'rmmod zfs' work after zfs-2.2.4

Obtained from:	OpenZFS
OpenZFS commit:	33174af151
OpenZFS tag:	zfs-2.2.5
2024-08-13 09:52:28 +02:00
Vladimir Kondratyev
59d36b8969 LinuxKPI: update linuxkpi_video to Linux 6.6
disable hdmi_audio_infoframe_pack_for_dp function for now as it depends
on not imported yet drm sources and is not used by drm-kmod.

Reviewed by:	manu
Sponsored by:	Serenity CyberSecurity, LLC
Differential Revision:	https://reviews.freebsd.org/D46224

(cherry picked from commit c89d94ad5d95fd15e891b2723caae8a6104ee153)
2024-08-11 13:12:38 +03:00
Mark Johnston
096cb89033 dtrace: Avoid including dtrace_isa.c directly into dtrace.c
This was done in the original DTrace import, presumably because that
made it a bit easier to handle includes.  However, this can cause
dtrace_getpcstack() to be inlined into dtrace_probe(), resulting in a
missing frame in stack traces since dtrace_getpcstack() takes care to
bump "aframes" to account for its own stack frame.

To avoid this, compile dtrace_isa.c separately on all platforms.  Add
requisite includes.

MFC after:	2 weeks
Sponsored by:	Innovate UK

(cherry picked from commit 82283cad12a417abfb1469d899b2d7cfb1d38f77)
2024-08-08 15:53:50 +00:00
Christos Margiolis
1ff260a6e1 sound: Implement dummy driver
Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D45967

(cherry picked from commit c15c9315b2cb7601cc337f7d5a8e124f4b2d5861)
2024-07-29 18:34:54 +03:00
John Baldwin
24687a65dd sys: Enable NVMe drivers on all architectures
The NVMe drivers are portable and are already included statically in
GENERIC on other architectures such as aarch64 and riscv64.

Reviewed by:	imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D44690

(cherry picked from commit 16e846fa1ed3c97419b55b292f77b0f4209f0875)
2024-07-18 13:19:18 -04:00
Warner Losh
125a2a6b67 MFC: linux: Make module standalone-buildable
Add opt_inet.h and opt_usb.h to make linux module buildable standalone.

(cherry picked from commit c5f906d32d2bc8e37f1e1911382e27af7e6240ff)
2024-07-04 02:37:57 +07:00
Souradeep Chakrabarti
7ece5993b7 Hyper-V: TLB flush enlightment using hypercall
Currently FreeBSD uses IPI based TLB flushing for remote
TLB flushing. Hyper-V allows hypercalls to flush local and
remote TLB. The use of Hyper-V hypercalls gives significant
performance improvement in TLB operations.

This patch set during test has shown near to 40 percent
TLB performance improvement.

Also this patch adds rep hypercall implementation as well.

Reviewed by:	whu, kib
Tested by:	whu
Authored-by:	Souradeep Chakrabarti <schakrabarti@microsoft.com>
Co-Authored-by:	Erni Sri Satya Vennela <ernis@microsoft.com>
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D45521

(cherry picked from commit 2b887687edc25bb4553f0d8a1183f454a85d413d)
2024-07-01 13:21:14 +00:00
Baptiste Daroussin
c333758fca mac_do: add a new MAC/do policy and mdo(1) utility
This policy enables a user to become another user without having to be
root (hence no setuid binary). it is configured via rules using sysctl
security.mac.do.rules

For example:
security.mac.do.rules=uid=1001:80,gid=0:any

The above rule means the user identifier by the uid 1001 is able to
become user 80
Any user of the group 0 are allowed to become any user on the system.

The mdo(1) utility expects the MAC/do policy to be installed and its
rules defined.

Reviewed by:	des
Differential Revision:	https://reviews.freebsd.org/D45145

(cherry picked from commit 8aac90f18aef7c9eea906c3ff9a001ca7b94f375)
2024-06-27 10:44:29 +02:00
Emmanuel Vadot
04a191c251 puc: Make kernel module working
We need uart_bus_puc.c in the module for it to work.

Sponsored by:	Beckhoff Automation GmbH & Co. KG

(cherry picked from commit 304ac69eca623d63510aa61853adc1ea60593323)
2024-06-04 14:23:21 +02:00
Emmanuel Vadot
5080cf0846 linuxkpi: Add linuxkpi_video module
This contain the hdmi code and the aperture code like in linux.

Differential Revision:	https://reviews.freebsd.org/D44925
Reviewed by:		bz
Obtained from:		drm-kmod
Sponsored by:		Beckhoff Automation GmbH & Co. KG

(cherry picked from commit 11d79c4756b7c85faf7c4a268c301a41ce0887b9)
2024-06-04 13:06:45 +02:00
Emmanuel Vadot
13671022eb linuxkpi: hdmi: Split the module declaration to a new file
In order to have a proper linuxkpi_video kmod, move the module declaration
to a new file as linuxkpi_video will also include linux_hdmi.c

Differential Revision:	https://reviews.freebsd.org/D44926
Reviewed by:		bz, emaste, wulf
Sponsored by:		Beckhoff Automation GmbH & Co. KG

(cherry picked from commit 7f84bb34a1d191949ec519a01c0c574f5e827c88)
2024-06-04 13:06:40 +02:00
Warner Losh
eff27c3872 Fix bnxt build in LINT
LINT includes bnxt_re driver. Adjust the path in files, add missing
files and add a new BNXT_C to build (which thinly wraps OFED version
with bnxt specicif stuff).

Sponsored by:		Netflix
Fixes: acd884dec99a ("RDMA/bnxt_re: Add bnxt_re RoCE driver")

(cherry picked from commit 175b2c00a6bcb0c8c1f6b76b6da9bf4879a5848e)
2024-06-03 13:23:15 -06:00