[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC v7 06/26] memory: Add arch_id and leaf fields in IOTLBEntry
From: |
Eric Auger |
Subject: |
[RFC v7 06/26] memory: Add arch_id and leaf fields in IOTLBEntry |
Date: |
Mon, 16 Nov 2020 19:13:29 +0100 |
TLB entries are usually tagged with some ids such as the asid
or pasid. When propagating an invalidation command from the
guest to the host, we need to pass this id.
Also we add a leaf field which indicates, in case of invalidation
notification, whether only cache entries for the last level of
translation are required to be invalidated.
Signed-off-by: Eric Auger <eric.auger@redhat.com>
---
include/exec/memory.h | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/include/exec/memory.h b/include/exec/memory.h
index a7364875ef..46795c97f5 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -81,12 +81,30 @@ typedef enum {
#define IOMMU_ACCESS_FLAG(r, w) (((r) ? IOMMU_RO : 0) | ((w) ? IOMMU_WO : 0))
+/**
+ * IOMMUTLBEntry - IOMMU TLB entry
+ *
+ * Structure used when performing a translation or when notifying MAP or
+ * UNMAP (invalidation) events
+ *
+ * @target_as: target address space
+ * @iova: IO virtual address (input)
+ * @translated_addr: translated address (output)
+ * @addr_mask: address mask (0xfff means 4K binding), must be multiple of 2
+ * @perm: permission flag of the mapping (NONE encodes no mapping or
+ * invalidation notification)
+ * @arch_id: architecture specific ID tagging the TLB
+ * @leaf: when @perm is NONE, indicates whether only caches for the last
+ * level of translation need to be invalidated.
+ */
struct IOMMUTLBEntry {
AddressSpace *target_as;
hwaddr iova;
hwaddr translated_addr;
- hwaddr addr_mask; /* 0xfff = 4k translation */
+ hwaddr addr_mask;
IOMMUAccessFlags perm;
+ uint32_t arch_id;
+ bool leaf;
};
/*
--
2.21.3
- [RFC v7 00/26] vSMMUv3/pSMMUv3 2 stage VFIO integration, Eric Auger, 2020/11/16
- [RFC v7 01/26] update-linux-headers: Import iommu.h, Eric Auger, 2020/11/16
- [RFC v7 02/26] header update against 5.10-rc4 and IOMMU/VFIO nested stage APIs, Eric Auger, 2020/11/16
- [RFC v7 03/26] memory: Add IOMMU_ATTR_VFIO_NESTED IOMMU memory region attribute, Eric Auger, 2020/11/16
- [RFC v7 04/26] memory: Add IOMMU_ATTR_MSI_TRANSLATE IOMMU memory region attribute, Eric Auger, 2020/11/16
- [RFC v7 05/26] memory: Introduce IOMMU Memory Region inject_faults API, Eric Auger, 2020/11/16
- [RFC v7 06/26] memory: Add arch_id and leaf fields in IOTLBEntry,
Eric Auger <=
- [RFC v7 07/26] iommu: Introduce generic header, Eric Auger, 2020/11/16
- [RFC v7 08/26] pci: introduce PCIPASIDOps to PCIDevice, Eric Auger, 2020/11/16
- [RFC v7 09/26] vfio: Force nested if iommu requires it, Eric Auger, 2020/11/16
- [RFC v7 10/26] vfio: Introduce hostwin_from_range helper, Eric Auger, 2020/11/16
- [RFC v7 11/26] vfio: Introduce helpers to DMA map/unmap a RAM section, Eric Auger, 2020/11/16
- [RFC v7 12/26] vfio: Set up nested stage mappings, Eric Auger, 2020/11/16
- [RFC v7 13/26] vfio: Pass stage 1 MSI bindings to the host, Eric Auger, 2020/11/16
- [RFC v7 14/26] vfio: Helper to get IRQ info including capabilities, Eric Auger, 2020/11/16
- [RFC v7 15/26] vfio/pci: Register handler for iommu fault, Eric Auger, 2020/11/16
- [RFC v7 16/26] vfio/pci: Set up the DMA FAULT region, Eric Auger, 2020/11/16