All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v11 00/13] SMMUv3 Nested Stage Setup (VFIO part)
@ 2020-11-16 11:00 ` Eric Auger
  0 siblings, 0 replies; 99+ messages in thread
From: Eric Auger @ 2020-11-16 11:00 UTC (permalink / raw)
  To: eric.auger.pro, eric.auger, iommu, linux-kernel, kvm, kvmarm,
	will, joro, maz, robin.murphy, alex.williamson
  Cc: jean-philippe, zhangfei.gao, zhangfei.gao, vivek.gautam,
	shameerali.kolothum.thodi, jacob.jun.pan, yi.l.liu, tn,
	nicoleotsuka, yuzenghui

This series brings the VFIO part of HW nested paging support
in the SMMUv3.

This is a rebase on top of v5.10-rc4

The series depends on:
[PATCH v12 00/15] SMMUv3 Nested Stage Setup (IOMMU part)

3 new IOCTLs are introduced that allow the userspace to
1) pass the guest stage 1 configuration
2) pass stage 1 MSI bindings
3) invalidate stage 1 related caches

They map onto the related new IOMMU API functions.

We introduce the capability to register specific interrupt
indexes (see [1]). A new DMA_FAULT interrupt index allows to register
an eventfd to be signaled whenever a stage 1 related fault
is detected at physical level. Also two specific regions allow to
- expose the fault records to the user space and
- inject page responses.

This latter functionality is not exercised in this series
but is provided as a POC for further vSVA activities (Shameer's input).

Best Regards

Eric

This series can be found at:
https://github.com/eauger/linux/tree/5.10-rc4-2stage-v12

The series series includes Tina's patch steming from
[1] "[RFC PATCH v2 1/3] vfio: Use capability chains to handle device
specific irq" plus patches originally contributed by Yi.

History:

v10 -> v11:
- rebase on top of v5.10-rc4
- adapt to changes on the IOMMU API (compliant with the doc
  written by Jacob/Yi)
- addition of the page response region
- Took into account Zenghui's comments
- In this version I have kept the ioctl separate. Since
  Yi's series [2] is currently stalled, I've just rebased here.

[2] [PATCH v7 00/16] vfio: expose virtual Shared Virtual Addressing
to VMs

v9 -> v10
- rebase on top of 5.6.0-rc3 (no change versus v9)

v8 -> v9:
- introduce specific irq framework
- single fault region
- iommu_unregister_device_fault_handler failure case not handled
  yet.

v7 -> v8:
- rebase on top of v5.2-rc1 and especially
  8be39a1a04c1  iommu/arm-smmu-v3: Add a master->domain pointer
- dynamic alloc of s1_cfg/s2_cfg
- __arm_smmu_tlb_inv_asid/s1_range_nosync
- check there is no HW MSI regions
- asid invalidation using pasid extended struct (change in the uapi)
- add s1_live/s2_live checks
- move check about support of nested stages in domain finalise
- fixes in error reporting according to the discussion with Robin
- reordered the patches to have first iommu/smmuv3 patches and then
  VFIO patches

v6 -> v7:
- removed device handle from bind/unbind_guest_msi
- added "iommu/smmuv3: Nested mode single MSI doorbell per domain
  enforcement"
- added few uapi comments as suggested by Jean, Jacop and Alex

v5 -> v6:
- Fix compilation issue when CONFIG_IOMMU_API is unset

v4 -> v5:
- fix bug reported by Vincent: fault handler unregistration now happens in
  vfio_pci_release
- IOMMU_FAULT_PERM_* moved outside of struct definition + small
  uapi changes suggested by Kean-Philippe (except fetch_addr)
- iommu: introduce device fault report API: removed the PRI part.
- see individual logs for more details
- reset the ste abort flag on detach

v3 -> v4:
- took into account Alex, jean-Philippe and Robin's comments on v3
- rework of the smmuv3 driver integration
- add tear down ops for msi binding and PASID table binding
- fix S1 fault propagation
- put fault reporting patches at the beginning of the series following
  Jean-Philippe's request
- update of the cache invalidate and fault API uapis
- VFIO fault reporting rework with 2 separate regions and one mmappable
  segment for the fault queue
- moved to PATCH

v2 -> v3:
- When registering the S1 MSI binding we now store the device handle. This
  addresses Robin's comment about discimination of devices beonging to
  different S1 groups and using different physical MSI doorbells.
- Change the fault reporting API: use VFIO_PCI_DMA_FAULT_IRQ_INDEX to
  set the eventfd and expose the faults through an mmappable fault region

v1 -> v2:
- Added the fault reporting capability
- asid properly passed on invalidation (fix assignment of multiple
  devices)
- see individual change logs for more info


Eric Auger (10):
  vfio: VFIO_IOMMU_SET_MSI_BINDING
  vfio/pci: Add VFIO_REGION_TYPE_NESTED region type
  vfio/pci: Register an iommu fault handler
  vfio/pci: Allow to mmap the fault queue
  vfio/pci: Add framework for custom interrupt indices
  vfio: Add new IRQ for DMA fault reporting
  vfio/pci: Register and allow DMA FAULT IRQ signaling
  vfio: Document nested stage control
  vfio/pci: Register a DMA fault response region
  vfio/pci: Inject page response upon response region fill

Liu, Yi L (2):
  vfio: VFIO_IOMMU_SET_PASID_TABLE
  vfio: VFIO_IOMMU_CACHE_INVALIDATE

Tina Zhang (1):
  vfio: Use capability chains to handle device specific irq

 Documentation/driver-api/vfio.rst   |  77 +++++
 drivers/vfio/pci/vfio_pci.c         | 430 ++++++++++++++++++++++++++--
 drivers/vfio/pci/vfio_pci_intrs.c   |  62 ++++
 drivers/vfio/pci/vfio_pci_private.h |  33 +++
 drivers/vfio/pci/vfio_pci_rdwr.c    |  84 ++++++
 drivers/vfio/vfio_iommu_type1.c     | 186 ++++++++++++
 include/uapi/linux/vfio.h           | 140 ++++++++-
 7 files changed, 993 insertions(+), 19 deletions(-)

-- 
2.21.3


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

end of thread, other threads:[~2021-03-16  8:25 UTC | newest]

Thread overview: 99+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-16 11:00 [PATCH v11 00/13] SMMUv3 Nested Stage Setup (VFIO part) Eric Auger
2020-11-16 11:00 ` Eric Auger
2020-11-16 11:00 ` Eric Auger
2020-11-16 11:00 ` [PATCH v11 01/13] vfio: VFIO_IOMMU_SET_PASID_TABLE Eric Auger
2020-11-16 11:00   ` Eric Auger
2020-11-16 11:00   ` Eric Auger
2020-11-17  2:11   ` kernel test robot
2020-11-17  2:11     ` kernel test robot
2020-11-17  2:11     ` kernel test robot
2020-11-17  2:11     ` kernel test robot
2020-11-24 21:31   ` Alex Williamson
2020-11-24 21:31     ` Alex Williamson
2020-11-24 21:31     ` Alex Williamson
2021-02-02 12:34   ` Keqian Zhu
2021-02-02 12:34     ` Keqian Zhu
2021-02-02 12:34     ` Keqian Zhu
2021-02-22 10:53     ` Auger Eric
2021-02-22 10:53       ` Auger Eric
2021-02-22 10:53       ` Auger Eric
2021-02-22 12:20       ` Keqian Zhu
2021-02-22 12:20         ` Keqian Zhu
2021-02-22 12:20         ` Keqian Zhu
2021-02-22 16:12         ` Auger Eric
2021-02-22 16:12           ` Auger Eric
2021-02-22 16:12           ` Auger Eric
2020-11-16 11:00 ` [PATCH v11 02/13] vfio: VFIO_IOMMU_CACHE_INVALIDATE Eric Auger
2020-11-16 11:00   ` Eric Auger
2020-11-16 11:00   ` Eric Auger
2020-11-16 11:00 ` [PATCH v11 03/13] vfio: VFIO_IOMMU_SET_MSI_BINDING Eric Auger
2020-11-16 11:00   ` Eric Auger
2020-11-16 11:00   ` Eric Auger
2021-02-02 12:08   ` Keqian Zhu
2021-02-02 12:08     ` Keqian Zhu
2021-02-02 12:08     ` Keqian Zhu
2020-11-16 11:00 ` [PATCH v11 04/13] vfio/pci: Add VFIO_REGION_TYPE_NESTED region type Eric Auger
2020-11-16 11:00   ` Eric Auger
2020-11-16 11:00   ` Eric Auger
2020-12-17 11:49   ` Kunkun Jiang
2020-12-17 11:49     ` Kunkun Jiang
2020-12-17 11:49     ` Kunkun Jiang
2021-02-23 12:45     ` Shenming Lu
2021-02-23 12:45       ` Shenming Lu
2021-02-23 12:45       ` Shenming Lu
2021-02-23 12:57       ` Auger Eric
2021-02-23 12:57         ` Auger Eric
2021-02-23 12:57         ` Auger Eric
2020-11-16 11:00 ` [PATCH v11 05/13] vfio/pci: Register an iommu fault handler Eric Auger
2020-11-16 11:00   ` Eric Auger
2020-11-16 11:00   ` Eric Auger
2020-11-16 13:51   ` kernel test robot
2020-11-16 13:51     ` kernel test robot
2020-11-16 13:51     ` kernel test robot
2020-11-16 13:51     ` kernel test robot
2020-11-16 19:30   ` kernel test robot
2020-11-16 19:30     ` kernel test robot
2020-11-16 19:30     ` kernel test robot
2020-11-16 19:30     ` kernel test robot
2020-11-16 11:00 ` [PATCH v11 06/13] vfio/pci: Allow to mmap the fault queue Eric Auger
2020-11-16 11:00   ` Eric Auger
2020-11-16 11:00   ` Eric Auger
2020-11-16 11:00 ` [PATCH v11 07/13] vfio: Use capability chains to handle device specific irq Eric Auger
2020-11-16 11:00   ` Eric Auger
2020-11-16 11:00   ` Eric Auger
2020-11-16 11:00 ` [PATCH v11 08/13] vfio/pci: Add framework for custom interrupt indices Eric Auger
2020-11-16 11:00   ` Eric Auger
2020-11-16 11:00   ` Eric Auger
2020-11-23 12:51   ` Shameerali Kolothum Thodi
2020-11-23 12:51     ` Shameerali Kolothum Thodi
2020-11-23 12:51     ` Shameerali Kolothum Thodi
2020-11-24  8:35     ` Auger Eric
2020-11-24  8:35       ` Auger Eric
2020-11-24  8:35       ` Auger Eric
2020-11-16 11:00 ` [PATCH v11 09/13] vfio: Add new IRQ for DMA fault reporting Eric Auger
2020-11-16 11:00   ` Eric Auger
2020-11-16 11:00   ` Eric Auger
2020-11-16 11:00 ` [PATCH v11 10/13] vfio/pci: Register and allow DMA FAULT IRQ signaling Eric Auger
2020-11-16 11:00   ` Eric Auger
2020-11-16 11:00   ` Eric Auger
2020-11-16 11:00 ` [PATCH v11 11/13] vfio: Document nested stage control Eric Auger
2020-11-16 11:00   ` Eric Auger
2020-11-16 11:00   ` Eric Auger
2020-11-16 11:00 ` [PATCH v11 12/13] vfio/pci: Register a DMA fault response region Eric Auger
2020-11-16 11:00   ` Eric Auger
2020-11-16 11:00   ` Eric Auger
2021-01-08 15:19   ` Shameerali Kolothum Thodi
2021-01-08 15:19     ` Shameerali Kolothum Thodi
2021-01-08 15:19     ` Shameerali Kolothum Thodi
2021-02-18 10:36   ` Shameerali Kolothum Thodi
2021-02-18 10:36     ` Shameerali Kolothum Thodi
2021-02-18 10:36     ` Shameerali Kolothum Thodi
2021-02-18 10:48     ` Auger Eric
2021-02-18 10:48       ` Auger Eric
2021-02-18 10:48       ` Auger Eric
2020-11-16 11:00 ` [PATCH v11 13/13] vfio/pci: Inject page response upon response region fill Eric Auger
2020-11-16 11:00   ` Eric Auger
2020-11-16 11:00   ` Eric Auger
2021-03-15 18:04 ` [PATCH v11 00/13] SMMUv3 Nested Stage Setup (VFIO part) Krishna Reddy
2021-03-15 18:04   ` Krishna Reddy
2021-03-15 18:04   ` Krishna Reddy

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.