[RFC PATCH 04/15] iommu: Add preserve iommu_domain op

Samiullah Khawaja
2025-09-28T19:07:48Z

Add an optional preserve iommu_domain op that can be implemented by the
iommu drivers to preserve the iommu domain.

Signed-off-by: Samiullah Khawaja <skhawaja@google.com>
---
include/linux/iommu.h | 3 +++
1 file changed, 3 insertions(+)

diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index d23d078f7c18..40801d8eac61 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -758,6 +758,8 @@ struct iommu_ops {
* specific mechanisms.
* @set_pgtable_quirks: Set io page table quirks (IO_PGTABLE_QUIRK_*)
* @free: Release the domain after use.
+ * @preserve: Preserve the iommu domain for liveupdate.
+ * Returns 0 on success, a negative errno on failure.
*/
struct iommu_domain_ops {
int (*attach_dev)(struct iommu_domain *domain, struct device *dev);
@@ -787,6 +789,7 @@ struct iommu_domain_ops {
unsigned long quirks);

void (*free)(struct iommu_domain *domain);
+ int (*preserve)(struct iommu_domain *domain);
};

/**
--
2.51.0.536.g15c5d4f767-goog