Skip to content

SVM API declaration for emulated devices

CLEMENT MATHIEU--DRIF qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest11 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11pcie: Add helper to declare PASID capability for a pcie devicehw/pci/pcie.c include/hw/pci/pcie.h include/hw/pci/pcie_regs.h+35 -10 replies
2/11pcie: Helper functions to check if PASID is enabledhw/pci/pcie.c include/hw/pci/pcie.h+11 -00 replies
3/11pcie: Helper function to check if ATS is enabledhw/pci/pcie.c include/hw/pci/pcie.h+10 -00 replies
4/11pcie: Add a helper to declare the PRI capability for a pcie devicehw/pci/pcie.c include/hw/pci/pcie.h include/hw/pci/pcie_regs.h+33 -10 replies
5/11pcie: Helper functions to check to check if PRI is enabledhw/pci/pcie.c include/hw/pci/pcie.h+10 -00 replies
6/11pci: Cache the bus mastering status in the devicehw/pci/pci.c include/hw/pci/pci_device.h+14 -100 replies
7/11pci: Add an API to get IOMMU's min page size and virtual address widthhw/pci/pci.c include/hw/pci/pci.h+43 -00 replies
8/11memory: Store user data pointer in the IOMMU notifiersinclude/system/memory.h+1 -00 replies
9/11pci: Add a pci-level initialization function for IOMMU notifiershw/pci/pci.c include/hw/pci/pci.h+50 -00 replies
10/11pci: Add a pci-level API for ATShw/pci/pci.c include/hw/pci/pci.h+207 -00 replies
11/11pci: Add a PCI-level API for PRIhw/pci/pci.c include/hw/pci/pci.h+196 -00 replies

Reviews trailers per patch

None of the 11 patches has a Reviewed-by or Acked-by.

PatchEthan Milon
1/11
2/11
3/11
4/11
5/11
6/11
7/11
8/11
9/11
10/11Co-authored-by
11/11Co-authored-by

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 00/11] SVM API declaration for emulated devices

This patch set belongs to a list of series that add SVM support in VT-d.

Here we focus on introducing a common PCI-level API for ATS and PRI to be used by virtual devices.

The API introduced in this series is mainly based on the PCIe Gen 5 spec.

What is ATS?
''''''''''''

ATS (Address Translation Service) is a PCIe-level protocol that enables PCIe devices to query an IOMMU for virtual to physical address translations in a specific address space (such as a userspace process address space). When a device receives translation responses from an IOMMU, it may decide to store them in an internal cache, often known as "ATC" (Address Translation Cache) or "Device IOTLB". To keep page tables and caches consistent, the IOMMU is allowed to send asynchronous invalidation requests to its client devices.

What is PRI?
''''''''''''

PRI (Page Request Interface) is a PCIe-level protocol that enables PCIe devices to request page fault resolutions to the kernel through an IOMMU. PRI combined with ATS are the 2 cornerstones of a technology called SVM (Shared Virtual Memory) or SVA (Shared Virtual Addressing) which allows PCIe devices to read to and write from the memory of userspace applications without requiring page pinning.

Here is a link to our GitHub repository that contains:
- Qemu with all the patches for SVM in VT-d
- ATS
- PRI
- Device IOTLB invalidations
- Requests with already pre-translated addresses
- A demo device
- A simple driver for the demo device
- A userspace program (for testing and demonstration purposes)

https://github.com/BullSequana/Qemu-in-guest-SVM-demo

Clement Mathieu--Drif (11):
pcie: Add helper to declare PASID capability for a pcie device
pcie: Helper functions to check if PASID is enabled
pcie: Helper function to check if ATS is enabled
pcie: Add a helper to declare the PRI capability for a pcie device
pcie: Helper functions to check to check if PRI is enabled
pci: Cache the bus mastering status in the device
pci: Add an API to get IOMMU's min page size and virtual address width
memory: Store user data pointer in the IOMMU notifiers
pci: Add a pci-level initialization function for IOMMU notifiers
pci: Add a pci-level API for ATS
pci: Add a PCI-level API for PRI

 hw/pci/pci.c                | 204 +++++++++++++++++++++--
 hw/pci/pcie.c               |  78 +++++++++
 include/hw/pci/pci.h        | 315 ++++++++++++++++++++++++++++++++++++
 include/hw/pci/pci_device.h |   1 +
 include/hw/pci/pcie.h       |  13 +-
 include/hw/pci/pcie_regs.h  |   8 +
 include/system/memory.h     |   1 +
 7 files changed, 609 insertions(+), 11 deletions(-)
Signature · 1 line
2.49.0