From: Zhenzhong Duan Date: Tue, 6 Jan 2026 06:12:59 +0000 (-0500) Subject: intel_iommu: Add migration support with x-flts=on X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cba6f4a9b54e4152a7c14197f7a966fd33c232e9;p=thirdparty%2Fqemu.git intel_iommu: Add migration support with x-flts=on When x-flts=on, we set up bindings to nested HWPT in host, after migration, VFIO device binds to nesting parent HWPT by default. We need to re-establish the bindings to nested HWPT, or else device DMA will break. Signed-off-by: Zhenzhong Duan Reviewed-by: Eric Auger Reviewed-by: Yi Liu Reviewed-by: Michael S. Tsirkin Link: https://lore.kernel.org/qemu-devel/20260106061304.314546-18-zhenzhong.duan@intel.com Signed-off-by: Cédric Le Goater --- diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index 08236b85ee..f971cdd14c 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -4090,6 +4090,13 @@ static int vtd_post_load(void *opaque, int version_id) */ vtd_switch_address_space_all(iommu); + /* + * Bindings to nested HWPT in host is set up dynamically depending + * on pasid entry configuration from guest. After migration, we + * need to re-establish the bindings before restoring device's DMA. + */ + vtd_replay_pasid_bindings_all(iommu); + return 0; }