[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC v1 14/18] hw/pci: add flush_pasid_iotlb() in PCIPASIDO
From: |
Liu Yi L |
Subject: |
[Qemu-devel] [RFC v1 14/18] hw/pci: add flush_pasid_iotlb() in PCIPASIDOps |
Date: |
Fri, 5 Jul 2019 19:01:47 +0800 |
This patch adds flush_pasid_iotlb() in PCIPASIDOps for passing guest
PASID-based iotlb flush operation to host via vfio interface.
Cc: Kevin Tian <address@hidden>
Cc: Jacob Pan <address@hidden>
Cc: Peter Xu <address@hidden>
Cc: Eric Auger <address@hidden>
Cc: Yi Sun <address@hidden>
Cc: David Gibson <address@hidden>
Signed-off-by: Liu Yi L <address@hidden>
---
hw/pci/pci.c | 15 +++++++++++++++
include/hw/pci/pci.h | 4 ++++
2 files changed, 19 insertions(+)
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 2229229..cf92bed 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -2706,6 +2706,21 @@ void pci_device_unbind_gpasid(PCIBus *bus, int32_t devfn,
}
}
+void pci_device_flush_pasid_iotlb(PCIBus *bus, int32_t devfn,
+ struct iommu_cache_invalidate_info *info)
+{
+ PCIDevice *dev;
+
+ if (!bus) {
+ return;
+ }
+
+ dev = bus->devices[devfn];
+ if (dev && dev->pasid_ops) {
+ dev->pasid_ops->flush_pasid_iotlb(bus, devfn, info);
+ }
+}
+
static void pci_dev_get_w64(PCIBus *b, PCIDevice *dev, void *opaque)
{
Range *range = opaque;
diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h
index 8d849e6..77e6bb1 100644
--- a/include/hw/pci/pci.h
+++ b/include/hw/pci/pci.h
@@ -272,6 +272,8 @@ struct PCIPASIDOps {
struct gpasid_bind_data *g_bind_data);
void (*unbind_gpasid)(PCIBus *bus, int32_t devfn,
struct gpasid_bind_data *g_bind_data);
+ void (*flush_pasid_iotlb)(PCIBus *bus, int32_t devfn,
+ struct iommu_cache_invalidate_info *info);
};
struct PCIDevice {
@@ -506,6 +508,8 @@ void pci_device_bind_gpasid(PCIBus *bus, int32_t devfn,
struct gpasid_bind_data *g_bind_data);
void pci_device_unbind_gpasid(PCIBus *bus, int32_t devfn,
struct gpasid_bind_data *g_bind_data);
+void pci_device_flush_pasid_iotlb(PCIBus *bus, int32_t devfn,
+ struct iommu_cache_invalidate_info *info);
static inline void
pci_set_byte(uint8_t *config, uint8_t val)
--
2.7.4
- [Qemu-devel] [RFC v1 09/18] intel_iommu: process pasid cache invalidation, (continued)
- [Qemu-devel] [RFC v1 09/18] intel_iommu: process pasid cache invalidation, Liu Yi L, 2019/07/06
- [Qemu-devel] [RFC v1 11/18] intel_iommu: create VTDAddressSpace per BDF+PASID, Liu Yi L, 2019/07/06
- [Qemu-devel] [RFC v1 10/18] intel_iommu: tag VTDAddressSpace instance with PASID, Liu Yi L, 2019/07/06
- [Qemu-devel] [RFC v1 12/18] intel_iommu: bind/unbind guest page table to host, Liu Yi L, 2019/07/06
- [Qemu-devel] [RFC v1 14/18] hw/pci: add flush_pasid_iotlb() in PCIPASIDOps,
Liu Yi L <=
- [Qemu-devel] [RFC v1 16/18] intel_iommu: add PASID-based iotlb invalidation support, Liu Yi L, 2019/07/06
- [Qemu-devel] [RFC v1 13/18] intel_iommu: flush pasid cache after a DSI context cache flush, Liu Yi L, 2019/07/06
- [Qemu-devel] [RFC v1 15/18] vfio/pci: adds support for PASID-based iotlb flush, Liu Yi L, 2019/07/06
- [Qemu-devel] [RFC v1 17/18] intel_iommu: propagate PASID-based iotlb flush to host, Liu Yi L, 2019/07/06
- [Qemu-devel] [RFC v1 18/18] intel_iommu: do not passdown pasid bind for PASID #0, Liu Yi L, 2019/07/06