aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhenzhong Duan <zhenzhong.duan@intel.com>2024-07-22 15:07:12 +0800
committerCédric Le Goater <clg@redhat.com>2024-07-23 17:14:52 +0200
commitc598d65aef4016b80608c93e2fba2c46d4c5e42e (patch)
treeaa1d568be3a24c8fc2c29cf0868a3acb20e75ad4
parentb07dcb7d4f116b157de5aaacfa9d58a496a9ed1d (diff)
vfio/ap: Don't initialize HOST_IOMMU_DEVICE with mdev
mdevs aren't "physical" devices and when asking for backing IOMMU info, it fails the entire provisioning of the guest. Fix that by setting vbasedev->mdev true so skipping HostIOMMUDevice initialization in the presence of mdevs. Fixes: 930589520128 ("vfio/iommufd: Implement HostIOMMUDeviceClass::realize() handler") Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com> Reviewed-by: Joao Martins <joao.m.martins@oracle.com> Reviewed-by: Eric Auger <eric.auger@redhat.com>
-rw-r--r--hw/vfio/ap.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/vfio/ap.c b/hw/vfio/ap.c
index 0c4354e3e7..71bf32b83c 100644
--- a/hw/vfio/ap.c
+++ b/hw/vfio/ap.c
@@ -230,6 +230,9 @@ static void vfio_ap_instance_init(Object *obj)
*/
vfio_device_init(vbasedev, VFIO_DEVICE_TYPE_AP, &vfio_ap_ops,
DEVICE(vapdev), true);
+
+ /* AP device is mdev type device */
+ vbasedev->mdev = true;
}
#ifdef CONFIG_IOMMUFD