@@ -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;
This patch adds a new IOMMU config notifier. It aims at configuring the fault reporting from host to guest. Signed-off-by: Eric Auger <eric.auger@redhat.com> --- 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(-)