]> git.ipfire.org Git - thirdparty/qemu.git/commit
vfio/iommufd: Restore vbasedev's reference to hwpt after CPR transfer
authorZhenzhong Duan <zhenzhong.duan@intel.com>
Sun, 28 Sep 2025 08:54:30 +0000 (04:54 -0400)
committerCédric Le Goater <clg@redhat.com>
Wed, 22 Oct 2025 06:12:52 +0000 (08:12 +0200)
commit8bf49fff0dfbb065ad65daa48d2e1a63ad2fd552
tree779f35f8eeae86e597865348a01c5a6993fca055
parentd59db04aed750ba4fc56f79cae99814334ec8285
vfio/iommufd: Restore vbasedev's reference to hwpt after CPR transfer

After CPR transfer, if there are more than one VFIO devices, device is
not added to hwpt->device_list and its reference to hwpt isn't restored
on destination. We still need to call iommufd_cdev_attach_container() to
restore it after a matching container is found, or else SIGSEV triggers.

Fixes: 4296ee07455e ("vfio/iommufd: reconstruct device")
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: Steve Sistare <steven.sistare@oracle.com>
Link: https://lore.kernel.org/qemu-devel/20250928085432.40107-5-zhenzhong.duan@intel.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
hw/vfio/iommufd.c