diff mbox series

[PULL,06/16] vfio/ap: Don't initialize HOST_IOMMU_DEVICE with mdev

Message ID 20240723140019.387786-7-clg@redhat.com (mailing list archive)
State New, archived
Headers show
Series [PULL,01/16] hw/vfio/container: Fix SIGSEV on vfio_container_instance_finalize() | expand

Commit Message

Cédric Le Goater July 23, 2024, 2 p.m. UTC
From: Zhenzhong Duan <zhenzhong.duan@intel.com>

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>
---
 hw/vfio/ap.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/hw/vfio/ap.c b/hw/vfio/ap.c
index 0c4354e3e70169ec072e16da0919936647d1d351..71bf32b83c50b9892b018db10e2f2ae0cf312e97 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