[PATCH rfcv1 0/6] Check and sync host IOMMU cap/ecap with vIOMMU

Zhenzhong Duan posted 6 patches 10 months, 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20240115101313.131139-1-zhenzhong.duan@intel.com
Maintainers: Yi Liu <yi.l.liu@intel.com>, Eric Auger <eric.auger@redhat.com>, Zhenzhong Duan <zhenzhong.duan@intel.com>, "Michael S. Tsirkin" <mst@redhat.com>, Peter Xu <peterx@redhat.com>, Jason Wang <jasowang@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, Eduardo Habkost <eduardo@habkost.net>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Alex Williamson <alex.williamson@redhat.com>, "Cédric Le Goater" <clg@redhat.com>
There is a newer version of this series
MAINTAINERS                     |   4 +-
include/hw/i386/intel_iommu.h   |  14 ++
include/hw/pci/pci.h            |  39 +++++-
include/hw/vfio/vfio-common.h   |   2 +
include/sysemu/iommufd_device.h |  31 +++++
backends/iommufd_device.c       |  50 +++++++
hw/i386/intel_iommu.c           | 239 ++++++++++++++++++++++++++------
hw/pci/pci.c                    |  49 ++++++-
hw/vfio/iommufd.c               |   2 +
hw/vfio/pci.c                   |  24 +++-
backends/meson.build            |   2 +-
11 files changed, 402 insertions(+), 54 deletions(-)
create mode 100644 include/sysemu/iommufd_device.h
create mode 100644 backends/iommufd_device.c
[PATCH rfcv1 0/6] Check and sync host IOMMU cap/ecap with vIOMMU
Posted by Zhenzhong Duan 10 months, 2 weeks ago
Hi,

This introduces a framework for vIOMMU to get hw IOMMU cap/ecap information
through IOMMUFD interface and check or sync with vIOMMU's own cap/ecap
config.

This framework works by having device side, i.e. VFIO, register a
IOMMUFDDevice to vIOMMU, IOMMUFDDevice includes necessary data to
archive that. Currently only VFIO device is supported, but it
could also be used for other devices, i.e., VDPA.

This is also a prerequisite for incoming iommufd nesting series:
'intel_iommu: Enable stage-1 translation'.

PATCH1-4: initialize IOMMUFDDevice and pass to vIOMMU
PATCH5-6: cap/ecap sync mechanism between host IOMMU and vIOMMU

Qemu code can be found at:
https://github.com/yiliu1765/qemu/tree/zhenzhong/iommufd_nesting_preq_rfcv1

Thanks
Zhenzhong

Yi Liu (3):
  hw/pci: introduce pci_device_set/unset_iommu_device()
  intel_iommu: add set/unset_iommu_device callback
  intel_iommu: add a framework to check and sync host IOMMU cap/ecap

Zhenzhong Duan (3):
  backends/iommufd_device: introduce IOMMUFDDevice
  vfio: initialize IOMMUFDDevice and pass to vIOMMU
  intel_iommu: extract out vtd_cap_init to initialize cap/ecap

 MAINTAINERS                     |   4 +-
 include/hw/i386/intel_iommu.h   |  14 ++
 include/hw/pci/pci.h            |  39 +++++-
 include/hw/vfio/vfio-common.h   |   2 +
 include/sysemu/iommufd_device.h |  31 +++++
 backends/iommufd_device.c       |  50 +++++++
 hw/i386/intel_iommu.c           | 239 ++++++++++++++++++++++++++------
 hw/pci/pci.c                    |  49 ++++++-
 hw/vfio/iommufd.c               |   2 +
 hw/vfio/pci.c                   |  24 +++-
 backends/meson.build            |   2 +-
 11 files changed, 402 insertions(+), 54 deletions(-)
 create mode 100644 include/sysemu/iommufd_device.h
 create mode 100644 backends/iommufd_device.c

-- 
2.34.1