Go to file
Yaxing Guo 3397c3cd85 uio: Add SVA support for PCI devices via uio_pci_generic_sva.c
This patch introduces a new UIO driver, uio_pci_generic_sva, which
extends the functionality of uio_pci_generic by adding support for
Shared Virtual Addressing (SVA) when IOMMU is enabled in the system.

The key enhancement allows PCI devices to directly use user-space virtual
addresses for DMA operations, eliminating the need for bounce buffers or
explicit IOVA mapping. This is achieved by leveraging the kernel's IOMMU-SVA
subsystem, including process address space attachment, page fault handling,
and shared context management between CPU and device.

With this driver, userspace applications can perform zero-copy DMA using
native pointers:

   void *addr = malloc(N);
   set_dma_addr((uint64_t)addr);  // Passing user VA directly
   start_dma();

The device can now access 'addr' through the IOMMU's PASID-based translation,
provided that the underlying IOMMU hardware (e.g., Intel VT-d 3.1+, AMD-Vi,
ARM SMMU, RISCV IOMMU) and platform support SVA.

Dependencies:
- CONFIG_IOMMU_SVA must be enabled.
- The platform must support PRI (Page Request Interface) and PASID.
- Device drivers/userspace must handle page faults if demand-paging is used.

The implementation reuses core logic from uio_pci_generic.c while adding
PASID setting, and integration with the IOMMU SVA APIs.

Also, add a read-only sysfs attribute 'pasid' to expose the Process Address
Space ID assigned by IOMMU driver when binding an SVA-enabled device.
For details, refer to the ABI documentation for uio_pci_sva driver sysfs attribute
(Documentation/ABI/testing/sysfs-driver-uio_pci_sva-pasid).

Signed-off-by: Yaxing Guo <guoyaxing@bosc.ac.cn>
Link: https://patch.msgid.link/20250926095828.506-1-guoyaxing@bosc.ac.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-11-26 15:10:39 +01:00
Documentation uio: Add SVA support for PCI devices via uio_pci_generic_sva.c 2025-11-26 15:10:39 +01:00
LICENSES
arch interconnect changes for 6.19 2025-11-24 17:35:12 +01:00
block block-6.18-20251023 2025-10-24 12:48:19 -07:00
certs
crypto
drivers uio: Add SVA support for PCI devices via uio_pci_generic_sva.c 2025-11-26 15:10:39 +01:00
fs - Remove dead code leftovers after a recent mitigations cleanup which fail 2025-10-26 09:57:18 -07:00
include virt: acrn: split acrn_mmio_dev_res out of acrn_mmiodev 2025-11-26 15:09:24 +01:00
init
io_uring
ipc
kernel - Restore the original buslock locking in a couple of places in the irq core 2025-10-26 09:54:36 -07:00
lib
mm slab fixes for 6.18-rc3 2025-10-24 12:40:51 -07:00
net
rust rust: list: add warning to List::remove docs about mem::take 2025-11-26 13:26:59 +01:00
samples
scripts
security
sound
tools - Fix x32 build due to wrong format specifier on that sub-arch 2025-10-26 09:44:36 -07:00
usr
virt
.clang-format
.clippy.toml
.cocciconfig
.editorconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
.pylintrc
.rustfmt.toml
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS MAINTAINERS: Downgrade ocxl to Odd Fixes 2025-11-26 13:35:38 +01:00
Makefile Linux 6.18-rc3 2025-10-26 15:59:49 -07:00
README

README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the reStructuredText markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.