[RFC PATCH v1 1/9] iommu/kho: Extend IOMMU KHO ABI for ARM SMMUv3
From: Pranjal Shrivastava
Date: Tue Sep 29 2026 - 03:20:17 EST
Extend the KHO IOMMU ABI to support state preservation for Arm SMMUv3.
Introduce struct iommu_smmuv3_hw_ser to capture SMMU hardware state,
including the register base, Stream Table config and Live Update state
tokens for the preserved Stream Tables.
Additionally, introduce struct iommu_master_smmuv3_ser to capture per
master state. For now it is used to preserve CD tables for Stage-1
translation.
Signed-off-by: Pranjal Shrivastava <praan@xxxxxxxxxx>
---
include/linux/kho/abi/iommu.h | 36 +++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/include/linux/kho/abi/iommu.h b/include/linux/kho/abi/iommu.h
index 308cd83fd3e3..397fdb0449a6 100644
--- a/include/linux/kho/abi/iommu.h
+++ b/include/linux/kho/abi/iommu.h
@@ -82,6 +82,7 @@
enum iommu_type_ser {
IOMMU_INVALID,
IOMMU_INTEL,
+ IOMMU_ARM_SMMUV3,
};
#define IOMMU_SER_FLAG_DELETED (1 << 0)
@@ -142,6 +143,23 @@ struct iommu_device_intel_ser {
u64 max_pasid;
} __packed;
+/**
+ * struct iommu_master_smmuv3_ser - SMMUv3 specific device state
+ * @l1_cdtab_lu_state: Live update state token for the linear/L1 CD table
+ * @num_l2_cdtables: Number of active L2 CD tables preserved
+ * @l2_cdtab_lu_states_phys: Physical pointer to an array of u64 LU state tokens
+ * for the active L2 CD tables (0 if linear)
+ *
+ * Note: Currently unused for Stage-2 Live Update. Reserved for future
+ * preservation of Stage-1 per-device Context Descriptor (CD) tables.
+ */
+struct iommu_master_smmuv3_ser {
+ u64 l1_cdtab_lu_state;
+ u32 num_l2_cdtables;
+ u32 padding;
+ u64 l2_cdtab_lu_states_phys;
+} __packed;
+
/**
* struct iommu_device_ser - Serialized state of a device
* @hdr: Common object header
@@ -159,6 +177,7 @@ struct iommu_device_ser {
struct iommu_dev_map_ser domain_iommu_ser;
union {
struct iommu_device_intel_ser intel;
+ struct iommu_master_smmuv3_ser smmuv3;
};
} __packed;
@@ -181,6 +200,22 @@ struct iommu_intel_ser {
u64 context_tables_bitmap[VTD_PRESERVED_BITMAP_LONGS];
};
+/**
+ * struct iommu_smmuv3_hw_ser - SMMUv3 specific hardware state
+ * @phys_addr: Physical address of the SMMU register base
+ * @strtab_base_cfg: STRTAB_BASE_CFG register value
+ * @l1_strtab_lu_state: Live update state token for the linear table OR the L1 table
+ * @l2_strtab_lu_states_phys: Physical pointer to an array of u64 LU state tokens
+ * indexed by L1 index, 0 for L2 tables that aren't
+ * preserved (0 if linear)
+ */
+struct iommu_smmuv3_hw_ser {
+ u64 phys_addr;
+ u64 strtab_base_cfg;
+ u64 l1_strtab_lu_state;
+ u64 l2_strtab_lu_states_phys;
+} __packed;
+
/**
* struct iommu_hw_ser - Serialized state of an IOMMU instance
* @hdr: Common object header
@@ -194,6 +229,7 @@ struct iommu_hw_ser {
u64 type;
union {
struct iommu_intel_ser intel;
+ struct iommu_smmuv3_hw_ser smmuv3;
};
} __packed;
--
2.56.0.rc1.315.gc6ed9934b7-goog