Re: [PATCH v2 06/16] iommupt: Implement preserve/unpreserve/restore callbacks

From: Samiullah Khawaja

Date: Wed May 27 2026 - 13:13:08 EST


On Sat, May 23, 2026 at 10:33:57AM -0300, Jason Gunthorpe wrote:
On Mon, Apr 27, 2026 at 05:56:23PM +0000, Samiullah Khawaja wrote:
@@ -266,12 +273,22 @@ struct pt_iommu_cfg {
}; \
IOMMU_PROTOTYPES(fmt)

+#ifdef CONFIG_IOMMU_LIVEUPDATE
+#define IOMMU_PT_LIVEUPDATE_OPS(fmt) \
+ , .preserve = &pt_iommu_##fmt##_preserve, \
+ .unpreserve = &pt_iommu_##fmt##_unpreserve, \
+ .restore = &pt_iommu_##fmt##_restore
+#else
+#define IOMMU_PT_LIVEUPDATE_OPS(fmt)
+#endif

Don't do it like this at all, new iommupt unique ops should be routed
through struct pt_iommu_ops

See how map_range/unmap_range now work

Ah yes. That also looks much cleaner. I will update this.

Jason

Sami