[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC v6 02/13] memory: Add IOMMUTLBNotificationType to IOMMUTLBEntry
From: |
Eugenio Pérez |
Subject: |
[RFC v6 02/13] memory: Add IOMMUTLBNotificationType to IOMMUTLBEntry |
Date: |
Wed, 26 Aug 2020 16:36:40 +0200 |
This way we can tell between MAPs and UNMAP, and potentially avoid to
send them to a notifier that does not require them.
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
---
include/exec/memory.h | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/include/exec/memory.h b/include/exec/memory.h
index 22c5f564d1..f6d91c54aa 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -59,6 +59,12 @@ struct ReservedRegion {
typedef struct IOMMUTLBEntry IOMMUTLBEntry;
+typedef enum {
+ IOMMU_IOTLB_NONE = 0,
+ IOMMU_IOTLB_UNMAP = 1,
+ IOMMU_IOTLB_MAP = 2,
+} IOMMUTLBNotificationType;
+
/* See address_space_translate: bit 0 is read, bit 1 is write. */
typedef enum {
IOMMU_NONE = 0,
@@ -70,11 +76,12 @@ typedef enum {
#define IOMMU_ACCESS_FLAG(r, w) (((r) ? IOMMU_RO : 0) | ((w) ? IOMMU_WO : 0))
struct IOMMUTLBEntry {
- AddressSpace *target_as;
- hwaddr iova;
- hwaddr translated_addr;
- hwaddr addr_mask; /* 0xfff = 4k translation */
- IOMMUAccessFlags perm;
+ AddressSpace *target_as;
+ hwaddr iova;
+ hwaddr translated_addr;
+ hwaddr addr_mask; /* 0xfff = 4k translation */
+ IOMMUAccessFlags perm;
+ IOMMUTLBNotificationType type; /* Only valid if it is a notification */
};
/*
--
2.18.1
- [RFC v6 00/13] memory: Delete assertion in memory_region_unregister_iommu_notifier, Eugenio Pérez, 2020/08/26
- [RFC v6 01/13] memory: Rename memory_region_notify_one to memory_region_notify_iommu_one, Eugenio Pérez, 2020/08/26
- [RFC v6 02/13] memory: Add IOMMUTLBNotificationType to IOMMUTLBEntry,
Eugenio Pérez <=
- [RFC v6 03/13] hw/alpha/typhoon: Mark all IOMMUTLBEntry as IOMMU_IOTLB_NONE type, Eugenio Pérez, 2020/08/26
- [RFC v6 04/13] amd_iommu: Mark all IOMMUTLBEntry as IOMMU_IOTLB_NONE type, Eugenio Pérez, 2020/08/26
- [RFC v6 05/13] hw/arm/smmu: Fill IOMMUTLBEntry notifier type, Eugenio Pérez, 2020/08/26
- [RFC v6 06/13] dma/rc4030: Mark all IOMMUTLBEntry as IOMMU_IOTLB_NONE type, Eugenio Pérez, 2020/08/26
- [RFC v6 07/13] intel_iommu: Mark IOMMUTLBEntry of page notification as IOMMU_IOTLB_UNMAP type, Eugenio Pérez, 2020/08/26
- [RFC v6 08/13] virtio-iommu: Mark virtio_iommu_translate IOTLB as IOMMU_IOTLB_NONE type, Eugenio Pérez, 2020/08/26
- [RFC v6 09/13] intel_iommu: Set IOMMUTLBEntry type in vtd_page_walk_level, Eugenio Pérez, 2020/08/26