diff mbox series

[v2,20/27] vfio/container: Bypass EEH if iommufd backend

Message ID 20231016083223.1519410-21-zhenzhong.duan@intel.com
State New
Headers show
Series vfio: Adopt iommufd | expand

Commit Message

Duan, Zhenzhong Oct. 16, 2023, 8:32 a.m. UTC
IBM EEH is only supported by legacy backend currently, bypass it
for IOMMUFD backend.

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
---
 hw/vfio/container.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/hw/vfio/container.c b/hw/vfio/container.c
index c86accdb38..dd9534afab 100644
--- a/hw/vfio/container.c
+++ b/hw/vfio/container.c
@@ -1047,6 +1047,8 @@  static VFIOLegacyContainer *vfio_eeh_as_container(AddressSpace *as)
 {
     VFIOAddressSpace *space = vfio_get_address_space(as);
     VFIOContainer *bcontainer = NULL;
+    const VFIOIOMMUBackendOpsClass *ops = VFIO_IOMMU_BACKEND_OPS_CLASS(
+                      object_class_by_name(TYPE_VFIO_IOMMU_BACKEND_LEGACY_OPS));
 
     if (QLIST_EMPTY(&space->containers)) {
         /* No containers to act on */
@@ -1055,7 +1057,7 @@  static VFIOLegacyContainer *vfio_eeh_as_container(AddressSpace *as)
 
     bcontainer = QLIST_FIRST(&space->containers);
 
-    if (QLIST_NEXT(bcontainer, next)) {
+    if (QLIST_NEXT(bcontainer, next) || bcontainer->ops != ops) {
         /*
          * We don't yet have logic to synchronize EEH state across
          * multiple containers