[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC v3.1 21/22] intel_iommu: process PASID-based Device-TLB invalidatio
From: |
Liu Yi L |
Subject: |
[RFC v3.1 21/22] intel_iommu: process PASID-based Device-TLB invalidation |
Date: |
Sat, 22 Feb 2020 00:07:22 -0800 |
This patch adds an empty handling for PASID-based Device-TLB
invalidation. For now it is enough as it is not necessary to
propagate it to host for passthru device and also there is no
emulated device has device tlb.
Cc: Kevin Tian <address@hidden>
Cc: Jacob Pan <address@hidden>
Cc: Peter Xu <address@hidden>
Cc: Yi Sun <address@hidden>
Cc: Paolo Bonzini <address@hidden>
Cc: Richard Henderson <address@hidden>
Cc: Eduardo Habkost <address@hidden>
Signed-off-by: Liu Yi L <address@hidden>
---
hw/i386/intel_iommu.c | 18 ++++++++++++++++++
hw/i386/intel_iommu_internal.h | 1 +
2 files changed, 19 insertions(+)
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index e6326ef..f5faa75 100644
--- a/hw/i386/intel_iommu.c
+++ b/hw/i386/intel_iommu.c
@@ -3354,6 +3354,17 @@ static bool vtd_process_inv_iec_desc(IntelIOMMUState *s,
return true;
}
+static bool vtd_process_device_piotlb_desc(IntelIOMMUState *s,
+ VTDInvDesc *inv_desc)
+{
+ /*
+ * no need to handle it for passthru device, for emulated
+ * devices with device tlb, it may be required, but for now,
+ * return is enough
+ */
+ return true;
+}
+
static bool vtd_process_device_iotlb_desc(IntelIOMMUState *s,
VTDInvDesc *inv_desc)
{
@@ -3475,6 +3486,13 @@ static bool vtd_process_inv_desc(IntelIOMMUState *s)
}
break;
+ case VTD_INV_DESC_DEV_PIOTLB:
+ trace_vtd_inv_desc("device-piotlb", inv_desc.hi, inv_desc.lo);
+ if (!vtd_process_device_piotlb_desc(s, &inv_desc)) {
+ return false;
+ }
+ break;
+
case VTD_INV_DESC_DEVICE:
trace_vtd_inv_desc("device", inv_desc.hi, inv_desc.lo);
if (!vtd_process_device_iotlb_desc(s, &inv_desc)) {
diff --git a/hw/i386/intel_iommu_internal.h b/hw/i386/intel_iommu_internal.h
index bd241cb..dfb54fc 100644
--- a/hw/i386/intel_iommu_internal.h
+++ b/hw/i386/intel_iommu_internal.h
@@ -386,6 +386,7 @@ typedef union VTDInvDesc VTDInvDesc;
#define VTD_INV_DESC_WAIT 0x5 /* Invalidation Wait Descriptor */
#define VTD_INV_DESC_PIOTLB 0x6 /* PASID-IOTLB Invalidate Desc */
#define VTD_INV_DESC_PC 0x7 /* PASID-cache Invalidate Desc */
+#define VTD_INV_DESC_DEV_PIOTLB 0x8 /* PASID-based-DIOTLB inv_desc*/
#define VTD_INV_DESC_NONE 0 /* Not an Invalidate Descriptor */
/* Masks for Invalidation Wait Descriptor*/
--
2.7.4
- [RFC v3.1 06/22] vfio/pci: init HostIOMMUContext per-container, (continued)
- [RFC v3.1 06/22] vfio/pci: init HostIOMMUContext per-container, Liu Yi L, 2020/02/22
- [RFC v3.1 01/22] scripts/update-linux-headers: Import iommu.h, Liu Yi L, 2020/02/22
- [RFC v3.1 05/22] hw/pci: add pci_device_setup_iommu, Liu Yi L, 2020/02/22
- [RFC v3.1 08/22] vfio/common: add pasid_alloc/free support, Liu Yi L, 2020/02/22
- [RFC v3.1 11/22] intel_iommu: process pasid cache invalidation, Liu Yi L, 2020/02/22
- [RFC v3.1 19/22] intel_iommu: process PASID-based iotlb invalidation, Liu Yi L, 2020/02/22
- [RFC v3.1 04/22] hw/iommu: introduce HostIOMMUContext, Liu Yi L, 2020/02/22
- [RFC v3.1 07/22] vfio: get nesting iommu cap info from Kernel, Liu Yi L, 2020/02/22
- [RFC v3.1 10/22] intel_iommu: add virtual command capability support, Liu Yi L, 2020/02/22
- [RFC v3.1 17/22] intel_iommu: do not pass down pasid bind for PASID #0, Liu Yi L, 2020/02/22
- [RFC v3.1 21/22] intel_iommu: process PASID-based Device-TLB invalidation,
Liu Yi L <=
- [RFC v3.1 15/22] intel_iommu: replay guest pasid bindings to host, Liu Yi L, 2020/02/22
- [RFC v3.1 02/22] header file update VFIO/IOMMU vSVA APIs, Liu Yi L, 2020/02/22
- [RFC v3.1 12/22] intel_iommu: add PASID cache management infrastructure, Liu Yi L, 2020/02/22
- [RFC v3.1 14/22] intel_iommu: bind/unbind guest page table to host, Liu Yi L, 2020/02/22
- [RFC v3.1 16/22] intel_iommu: replay pasid binds after context cache invalidation, Liu Yi L, 2020/02/22
- [RFC v3.1 18/22] vfio/common: add support for flush iommu stage-1 cache, Liu Yi L, 2020/02/22
- [RFC v3.1 20/22] intel_iommu: propagate PASID-based iotlb invalidation to host, Liu Yi L, 2020/02/22
- [RFC v3.1 22/22] intel_iommu: modify x-scalable-mode to be string option, Liu Yi L, 2020/02/22
- Re: [RFC v3.1 00/22] intel_iommu: expose Shared Virtual Addressing to VMs, no-reply, 2020/02/22