All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC v3 0/8] vfio: expose virtual Shared Virtual Addressing to VMs
@ 2020-01-29 12:11 ` Liu, Yi L
  0 siblings, 0 replies; 48+ messages in thread
From: Liu, Yi L @ 2020-01-29 12:11 UTC (permalink / raw)
  To: alex.williamson, eric.auger
  Cc: kevin.tian, jacob.jun.pan, joro, ashok.raj, yi.l.liu, jun.j.tian,
	yi.y.sun, jean-philippe.brucker, peterx, iommu, kvm,
	linux-kernel

Shared Virtual Addressing (SVA), a.k.a, Shared Virtual Memory (SVM) on
Intel platforms allows address space sharing between device DMA and
applications. SVA can reduce programming complexity and enhance security.

This VFIO series is intended to expose SVA usage to VMs. i.e. Sharing
guest application address space with passthru devices. This is called
vSVA in this series. The whole vSVA enabling requires QEMU/VFIO/IOMMU
changes. For IOMMU and QEMU changes, they are in separate series (listed
in the "Related series").

The high-level architecture for SVA virtualization is as below, the key
design of vSVA support is to utilize the dual-stage IOMMU translation (
also known as IOMMU nesting translation) capability in host IOMMU.


    .-------------.  .---------------------------.
    |   vIOMMU    |  | Guest process CR3, FL only|
    |             |  '---------------------------'
    .----------------/
    | PASID Entry |--- PASID cache flush -
    '-------------'                       |
    |             |                       V
    |             |                CR3 in GPA
    '-------------'
Guest
------| Shadow |--------------------------|--------
      v        v                          v
Host
    .-------------.  .----------------------.
    |   pIOMMU    |  | Bind FL for GVA-GPA  |
    |             |  '----------------------'
    .----------------/  |
    | PASID Entry |     V (Nested xlate)
    '----------------\.------------------------------.
    |             |   |SL for GPA-HPA, default domain|
    |             |   '------------------------------'
    '-------------'
Where:
 - FL = First level/stage one page tables
 - SL = Second level/stage two page tables

There are roughly four parts in this patchset which are
corresponding to the basic vSVA support for PCI device
assignment
 1. vfio support for PASID allocation and free for VMs
 2. vfio support for guest page table binding request from VMs
 3. vfio support for IOMMU cache invalidation from VMs
 4. vfio support for vSVA usage on IOMMU-backed mdevs

The complete vSVA kernel upstream patches are divided into three phases:
    1. Common APIs and PCI device direct assignment
    2. IOMMU-backed Mediated Device assignment
    3. Page Request Services (PRS) support

This RFC patchset is aiming for the phase 1 and phase 2, and works
together with the VT-d driver[1] changes and QEMU changes[2]. Complete
set for current vSVA can be found in below branch. This branch also
includes the patches for exposing PASID capability to VM, which will be
in another patchset.
https://github.com/luxis1999/linux-vsva: vsva-linux-5.5-rc3
old version: https://github.com/jacobpan/linux.git:siov_sva.

Related series:
[1] [PATCH V9 00/10] Nested Shared Virtual Address (SVA) VT-d support:
    https://lkml.org/lkml/2020/1/29/37
    [PATCH 0/3] IOMMU user API enhancement:
    https://lkml.org/lkml/2020/1/29/45

[2] [RFC v3 00/25] intel_iommu: expose Shared Virtual Addressing to VMs
    The complete QEMU set can be found in below link:
    https://github.com/luxis1999/qemu.git: sva_vtd_v9_rfcv3

Changelog:
	- RFC v2 -> v3:
	  a) Refine the whole patchset to fit the roughly parts in this series
	  b) Adds complete vfio PASID management framework. e.g. pasid alloc,
	  free, reclaim in VM crash/down and per-VM PASID quota to prevent
	  PASID abuse.
	  c) Adds IOMMU uAPI version check and page table format check to ensure
	  version compatibility and hardware compatibility.
	  d) Adds vSVA vfio support for IOMMU-backed mdevs.

	- RFC v1 -> v2:
	  Dropped vfio: VFIO_IOMMU_ATTACH/DETACH_PASID_TABLE.

Liu Yi L (8):
  vfio: Add VFIO_IOMMU_PASID_REQUEST(alloc/free)
  vfio/type1: Make per-application (VM) PASID quota tunable
  vfio: Reclaim PASIDs when application is down
  vfio/type1: Add VFIO_NESTING_GET_IOMMU_UAPI_VERSION
  vfio/type1: Report 1st-level/stage-1 page table format to userspace
  vfio/type1: Bind guest page tables to host
  vfio/type1: Add VFIO_IOMMU_CACHE_INVALIDATE
  vfio/type1: Add vSVA support for IOMMU-backed mdevs

 drivers/vfio/vfio.c             | 183 +++++++++++++++++
 drivers/vfio/vfio_iommu_type1.c | 421 ++++++++++++++++++++++++++++++++++++++++
 include/linux/vfio.h            |  21 ++
 include/uapi/linux/vfio.h       | 148 ++++++++++++++
 4 files changed, 773 insertions(+)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 48+ messages in thread

end of thread, other threads:[~2020-02-18  5:07 UTC | newest]

Thread overview: 48+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-29 12:11 [RFC v3 0/8] vfio: expose virtual Shared Virtual Addressing to VMs Liu, Yi L
2020-01-29 12:11 ` Liu, Yi L
2020-01-29 12:11 ` [RFC v3 1/8] vfio: Add VFIO_IOMMU_PASID_REQUEST(alloc/free) Liu, Yi L
2020-01-29 12:11   ` Liu, Yi L
2020-01-29 23:55   ` Alex Williamson
2020-01-29 23:55     ` Alex Williamson
2020-01-31 12:41     ` Liu, Yi L
2020-01-31 12:41       ` Liu, Yi L
2020-02-06  9:41       ` Liu, Yi L
2020-02-06  9:41         ` Liu, Yi L
2020-02-06 18:12       ` Jacob Pan
2020-02-06 18:12         ` Jacob Pan
2020-02-18  5:07       ` Liu, Yi L
2020-02-18  5:07         ` Liu, Yi L
2020-01-29 12:11 ` [RFC v3 2/8] vfio/type1: Make per-application (VM) PASID quota tunable Liu, Yi L
2020-01-29 12:11   ` Liu, Yi L
2020-01-29 23:56   ` Alex Williamson
2020-01-29 23:56     ` Alex Williamson
2020-02-05  6:23     ` Liu, Yi L
2020-02-05  6:23       ` Liu, Yi L
2020-02-07 19:43   ` Jacob Pan
2020-02-07 19:43     ` Jacob Pan
2020-02-08  8:46     ` Liu, Yi L
2020-02-08  8:46       ` Liu, Yi L
2020-01-29 12:11 ` [RFC v3 3/8] vfio: Reclaim PASIDs when application is down Liu, Yi L
2020-01-29 12:11   ` Liu, Yi L
2020-01-29 23:56   ` Alex Williamson
2020-01-29 23:56     ` Alex Williamson
2020-01-31 12:42     ` Liu, Yi L
2020-01-31 12:42       ` Liu, Yi L
2020-01-29 12:11 ` [RFC v3 4/8] vfio/type1: Add VFIO_NESTING_GET_IOMMU_UAPI_VERSION Liu, Yi L
2020-01-29 12:11   ` Liu, Yi L
2020-01-29 23:56   ` Alex Williamson
2020-01-29 23:56     ` Alex Williamson
2020-01-31 13:04     ` Liu, Yi L
2020-01-31 13:04       ` Liu, Yi L
2020-02-03 18:00       ` Alex Williamson
2020-02-03 18:00         ` Alex Williamson
2020-02-05  6:19         ` Liu, Yi L
2020-02-05  6:19           ` Liu, Yi L
2020-01-29 12:11 ` [RFC v3 5/8] vfio/type1: Report 1st-level/stage-1 page table format to userspace Liu, Yi L
2020-01-29 12:11   ` Liu, Yi L
2020-01-29 12:11 ` [RFC v3 6/8] vfio/type1: Bind guest page tables to host Liu, Yi L
2020-01-29 12:11   ` Liu, Yi L
2020-01-29 12:11 ` [RFC v3 7/8] vfio/type1: Add VFIO_IOMMU_CACHE_INVALIDATE Liu, Yi L
2020-01-29 12:11   ` Liu, Yi L
2020-01-29 12:11 ` [RFC v3 8/8] vfio/type1: Add vSVA support for IOMMU-backed mdevs Liu, Yi L
2020-01-29 12:11   ` Liu, Yi L

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.