[RFC PATCH 09/15] iommu/vt-d: Add live update freeze callback

From: Samiullah Khawaja

Date: Sun Sep 28 2025 - 15:07:55 EST


The iommu_ser needs to be updated during freeze to set the physical
address of the iommu_units and devices array as the virtual addresses
will not be valid after kexec in the next kernel.

Signed-off-by: Samiullah Khawaja <skhawaja@xxxxxxxxxx>
---
drivers/iommu/intel/liveupdate.c | 11 +++++++++++
1 file changed, 11 insertions(+)

diff --git a/drivers/iommu/intel/liveupdate.c b/drivers/iommu/intel/liveupdate.c
index fb214736aa3c..a7d9b07aaada 100644
--- a/drivers/iommu/intel/liveupdate.c
+++ b/drivers/iommu/intel/liveupdate.c
@@ -258,10 +258,21 @@ static void intel_liveupdate_finish(struct liveupdate_subsystem *handle, u64 dat
pr_warn("Not implemented\n");
}

+static int intel_liveupdate_freeze(struct liveupdate_subsystem *handle, u64 *data)
+{
+ struct iommu_ser *ser = __va(*data);
+
+ ser->iommu_units_phys = __pa(ser->iommu_units);
+ ser->devices_phys = __pa(ser->devices);
+
+ return 0;
+}
+
static struct liveupdate_subsystem_ops intel_liveupdate_subsystem_ops = {
.prepare = intel_liveupdate_prepare,
.finish = intel_liveupdate_finish,
.cancel = intel_liveupdate_cancel,
+ .freeze = intel_liveupdate_freeze,
};

static struct liveupdate_subsystem intel_liveupdate_subsystem = {
--
2.51.0.536.g15c5d4f767-goog