From: Zhenzhong Duan Date: Mon, 22 Jul 2024 07:07:13 +0000 (+0800) Subject: vfio/ccw: Don't initialize HOST_IOMMU_DEVICE with mdev X-Git-Tag: pull-vmclock-20250108~228^2~9 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=8b8705e7f20afa545862fcae15c1515b8a832d2d;p=users%2Fdwmw2%2Fqemu.git vfio/ccw: 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 Reviewed-by: Joao Martins Acked-by: Eric Farman Reviewed-by: Eric Auger --- diff --git a/hw/vfio/ccw.c b/hw/vfio/ccw.c index 1f8e1272c7..115862f430 100644 --- a/hw/vfio/ccw.c +++ b/hw/vfio/ccw.c @@ -675,6 +675,9 @@ static void vfio_ccw_instance_init(Object *obj) VFIOCCWDevice *vcdev = VFIO_CCW(obj); VFIODevice *vbasedev = &vcdev->vdev; + /* CCW device is mdev type device */ + vbasedev->mdev = true; + /* * All vfio-ccw devices are believed to operate in a way compatible with * discarding of memory in RAM blocks, ie. pages pinned in the host are