From: Greg KH <gregkh@linuxfoundation.org>
To: Yaxing Guo <guoyaxing@bosc.ac.cn>
Cc: linux-kernel@vger.kernel.org, wangran@bosc.ac.cn,
zhangjian@bosc.ac.cn, anxu@bosc.ac.cn
Subject: Re: [PATCH v2 1/3] uio: Add SVA support for PCI devices via uio_pci_generic_sva.c
Date: Thu, 25 Sep 2025 14:29:55 +0200 [thread overview]
Message-ID: <2025092539-tamper-subtype-2839@gregkh> (raw)
In-Reply-To: <20250925104018.57053-1-guoyaxing@bosc.ac.cn>
On Thu, Sep 25, 2025 at 06:40:16PM +0800, Yaxing Guo wrote:
> 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); // Pass 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.
>
> Signed-off-by: Yaxing Guo <guoyaxing@bosc.ac.cn>
> ---
> Changes in v2:
> -- Use sysfs_emit() instead of sprintf in pasid_show()
> -- Use the default attribute list instead of sysfs_create_file
> -- Add MODULE_DESCRIPTION
> -- Modify "2024" to "2025" in copyright
>
> drivers/uio/uio_pci_generic_sva.c | 192 ++++++++++++++++++++++++++++++
> 1 file changed, 192 insertions(+)
> create mode 100644 drivers/uio/uio_pci_generic_sva.c
>
> diff --git a/drivers/uio/uio_pci_generic_sva.c b/drivers/uio/uio_pci_generic_sva.c
> new file mode 100644
> index 000000000000..97e9ab9a081a
> --- /dev/null
> +++ b/drivers/uio/uio_pci_generic_sva.c
> @@ -0,0 +1,192 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * UIO PCI Express sva driver
> + *
> + * Copyright (c) 2025 Beijing Institute of Open Source Chip (BOSC)
Shouldn't that be 2024-2025 if work happened on this in 2024?
next prev parent reply other threads:[~2025-09-25 12:29 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-25 10:40 Yaxing Guo
2025-09-25 10:40 ` [PATCH v2 3/3] doc: Add ABI documentation for uio_pci_sva driver sysfs attributes Yaxing Guo
2025-09-25 12:32 ` Greg KH
2025-09-26 5:57 ` yaxing guo
2025-09-26 6:03 ` Greg KH
2025-09-25 12:29 ` Greg KH [this message]
[not found] ` <20250925104018.57053-2-guoyaxing@bosc.ac.cn>
2025-09-25 12:30 ` [PATCH v2 2/3] uio: Add Kconfig and Makefile support for UIO_PCI_GENERIC_SVA Greg KH
2025-09-25 12:30 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2025092539-tamper-subtype-2839@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=anxu@bosc.ac.cn \
--cc=guoyaxing@bosc.ac.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=wangran@bosc.ac.cn \
--cc=zhangjian@bosc.ac.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®