This series adds migration support for the emulated RISC-V IOMMU,
covering both PCI and system-bus devices.
The common IOMMU state is migrated using VMState, including the
registers, device directory configuration, and command, fault,
and page-request queue state. HPM cycle counter state and the
overflow timer are saved in a separate subsection, while the
event-to-counter mapping is reconstructed after loading.
For the PCI device, the existing PCI and MSI-X migration helpers
are used to preserve the configuration space, MSI-X table, and
pending bit array. The system-bus device saves its MSI-X table
and pending bit array directly.
The series was tested with TCG and KVM live migration of
RISC-V Linux guests using both PCI and system-bus IOMMUs.
NVMe and e1000e DMA continued working after migration.
Queue, interrupt, and HPM state restoration were also tested
with qtest.
KVM live migration was tested with the following AIA
migration series applied:
https://lore.kernel.org/qemu-devel/20261026024048.630015-1-wang.yechao255@zte.com.cn/
Tan Chi (3):
hw/riscv: iommu: Add migration support for common state
hw/riscv: iommu-pci: Add migration support
hw/riscv: iommu-sys: Add migration support
hw/riscv/riscv-iommu-hpm.c | 27 +++++++++++++++++++
hw/riscv/riscv-iommu-hpm.h | 2 ++
hw/riscv/riscv-iommu-pci.c | 22 +++++++++++++---
hw/riscv/riscv-iommu-sys.c | 21 +++++++++++++++
hw/riscv/riscv-iommu.c | 54 ++++++++++++++++++++++++++++++++++++++
5 files changed, 122 insertions(+), 4 deletions(-)
--
2.53.0