[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-arm] [RFC v2 24/28] memory: Introduce IOMMU_NOTIFIER_INIT_CFG IOMM
From: |
Eric Auger |
Subject: |
[Qemu-arm] [RFC v2 24/28] memory: Introduce IOMMU_NOTIFIER_INIT_CFG IOMMU Config Notifier |
Date: |
Fri, 21 Sep 2018 10:18:15 +0200 |
This patch adds a new IOMMU config notifier. It aims at
configuring the fault reporting from host to guest.
Signed-off-by: Eric Auger <address@hidden>
---
I acknowledge I am not a big fan of having a vfio uapi struct
referenced in IOMMUConfig. However this config really sets
something at VFIO layer. Also I may rename IOMMU_NOTIFIER_INIT_CFG
into IOMMU_NOTIFIER_FAULT_CONFIG. Globally it is also questionnable
at this stage if such a notifier really is requested. I devised that
to allow the SMMU to pass a fifo size to the kernel. This size can
be aligned to the size as seen/set by the guest. However for
unrecoverable errors we may consider that having an arbitrary size
determined by vfio/common.c can be sufficient?
---
include/exec/memory.h | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/include/exec/memory.h b/include/exec/memory.h
index 93150e1450..f54c39b248 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -28,6 +28,7 @@
#include "hw/qdev-core.h"
#ifdef CONFIG_LINUX
#include <linux/iommu.h>
+#include <linux/vfio.h>
#endif
#define RAM_ADDR_INVALID (~(ram_addr_t)0)
@@ -82,6 +83,7 @@ typedef struct IOMMUConfig {
union {
#ifdef __linux__
struct iommu_pasid_table_config pasid_cfg;
+ struct vfio_iommu_type1_guest_fault_config fault_cfg;
#endif
};
} IOMMUConfig;
@@ -98,10 +100,13 @@ typedef enum {
IOMMU_NOTIFIER_MAP = 0x2,
/* Notify stage 1 config changes */
IOMMU_NOTIFIER_PASID_CFG = 0x4,
+ /* Notify IOMMU initial setup */
+ IOMMU_NOTIFIER_INIT_CFG = 0x8,
} IOMMUNotifierFlag;
#define IOMMU_NOTIFIER_IOTLB_ALL (IOMMU_NOTIFIER_MAP | IOMMU_NOTIFIER_UNMAP)
-#define IOMMU_NOTIFIER_CONFIG_ALL (IOMMU_NOTIFIER_PASID_CFG)
+#define IOMMU_NOTIFIER_CONFIG_ALL (IOMMU_NOTIFIER_PASID_CFG | \
+ IOMMU_NOTIFIER_INIT_CFG)
struct IOMMUNotifier;
struct IOMMUConfig;
--
2.17.1
- [Qemu-arm] [RFC v2 12/28] memory: Add arch_id in IOTLBEntry, (continued)
- [Qemu-arm] [RFC v2 12/28] memory: Add arch_id in IOTLBEntry, Eric Auger, 2018/09/21
- [Qemu-arm] [RFC v2 14/28] hw/arm/smmuv3: Implement dummy replay, Eric Auger, 2018/09/21
- [Qemu-arm] [RFC v2 16/28] hw/arm/smmuv3: Fill the IOTLBEntry arch_id on NH_VA invalidation, Eric Auger, 2018/09/21
- [Qemu-arm] [RFC v2 15/28] hw/arm/smmuv3: Notify on config changes, Eric Auger, 2018/09/21
- [Qemu-arm] [RFC v2 17/28] hw/vfio/common: Introduce vfio_alloc_guest_iommu helper, Eric Auger, 2018/09/21
- [Qemu-arm] [RFC v2 18/28] hw/vfio/common: Introduce vfio_dma_(un)map_ram_section helpers, Eric Auger, 2018/09/21
- [Qemu-arm] [RFC v2 19/28] hw/vfio/common: Register specific nested mode notifiers and memory_listener, Eric Auger, 2018/09/21
- [Qemu-arm] [RFC v2 22/28] vfio/pci: Always set up MSI route before enabling vectors, Eric Auger, 2018/09/21
- [Qemu-arm] [RFC v2 21/28] target/arm/kvm: Notifies IOMMU on MSI stage 1 binding, Eric Auger, 2018/09/21
- [Qemu-arm] [RFC v2 20/28] hw/vfio/common: Register MAP notifier for MSI binding, Eric Auger, 2018/09/21
- [Qemu-arm] [RFC v2 24/28] memory: Introduce IOMMU_NOTIFIER_INIT_CFG IOMMU Config Notifier,
Eric Auger <=
- [Qemu-arm] [RFC v2 23/28] hw/arm/smmuv3: Remove warning about unsupported MAP notifiers, Eric Auger, 2018/09/21
- [Qemu-arm] [RFC v2 25/28] memory: Introduce IOMMU Memory Region inject_faults API, Eric Auger, 2018/09/21
- [Qemu-arm] [RFC v2 26/28] hw/vfio/common: Handle fault_handler, Eric Auger, 2018/09/21
- [Qemu-arm] [RFC v2 27/28] hw/arm/smmuv3: Init fault handling, Eric Auger, 2018/09/21
- [Qemu-arm] [RFC v2 28/28] hw/arm/smmuv3: Implement fault injection, Eric Auger, 2018/09/21