Re: [PATCH v3 02/18] iommu: Implement IOMMU Live update FLB callbacks

From: Samiullah Khawaja

Date: Fri Aug 07 2026 - 22:36:21 EST


On Fri, Jul 31, 2026 at 05:58:20AM +0000, Ankit Soni wrote:
On Sun, Jun 14, 2026 at 11:37:12PM +0000, Samiullah Khawaja wrote:
Add liveupdate FLB for IOMMU state preservation. Use KHO preserve memory
alloc/free helper functions to allocate memory for the IOMMU Live update
FLB object and the serialization structs for device, domain and iommu.

During retrieve, walk through the preserved obj array headers and
restore each folio. Also recreate the FLB obj.

Signed-off-by: Samiullah Khawaja <skhawaja@xxxxxxxxxx>
---
MAINTAINERS | 9 ++
drivers/iommu/Kconfig | 12 ++
drivers/iommu/Makefile | 1 +
drivers/iommu/liveupdate.c | 212 +++++++++++++++++++++++++++++++
include/linux/iommu-liveupdate.h | 18 +++
include/linux/kho/abi/iommu.h | 207 ++++++++++++++++++++++++++++++
6 files changed, 459 insertions(+)
create mode 100644 drivers/iommu/liveupdate.c
create mode 100644 include/linux/iommu-liveupdate.h
create mode 100644 include/linux/kho/abi/iommu.h


../..


[snip]


Hi,

nit, The v3 changelog has "Replace bitfields with u32 flags", but sign_extend:1
looks like it was missed. this is 37 bytes, the only arrayed record in this
header that isn't a multiple of 8 (iommu_device_ser is 56, iommu_hw_ser 112).
The arrays are strided with pointer arithmetic, so the skew accumulates: from
objects[1] onwards none of the u64s are naturally aligned.

Looks like a leftover from the bitfield cleanup.

Yes, missed this one in v3. Just sent out v4, it should be cleaned up now.

Thanks,
Sami

-Ankit