]> Git Repo - qemu.git/commitdiff
spapr_iommu: Fix vhost integration regression
authorEric Auger <[email protected]>
Tue, 9 Feb 2021 21:32:33 +0000 (22:32 +0100)
committerAlex Williamson <[email protected]>
Tue, 16 Mar 2021 16:06:44 +0000 (10:06 -0600)
Previous work on dev-iotlb message broke spapr_iommu/vhost integration
as it did for SMMU and virtio-iommu. The spapr_iommu currently
only sends IOMMU_NOTIFIER_UNMAP notifications. Since commit
958ec334bca3 ("vhost: Unbreak SMMU and virtio-iommu on dev-iotlb support"),
VHOST first tries to register IOMMU_NOTIFIER_DEVIOTLB_UNMAP notifier
and if it fails, falls back to legacy IOMMU_NOTIFIER_UNMAP. So
spapr_iommu must fail on the IOMMU_NOTIFIER_DEVIOTLB_UNMAP
registration.

Reported-by: Peter Xu <[email protected]>
Fixes: b68ba1ca5767 ("memory: Add IOMMU_NOTIFIER_DEVIOTLB_UNMAP IOMMUTLBNotificationType")
Signed-off-by: Eric Auger <[email protected]>
Message-Id: <20210209213233[email protected]>
Acked-by: David Gibson <[email protected]>
Acked-by: Jason Wang <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Reviewed-by: Greg Kurz <[email protected]>
Signed-off-by: Alex Williamson <[email protected]>
hw/ppc/spapr_iommu.c

index 30352df00ea35e53500fc8c07591ec226b9e1f13..24537ffcbd32284b852dace00779f4e6f4181679 100644 (file)
@@ -212,6 +212,11 @@ static int spapr_tce_notify_flag_changed(IOMMUMemoryRegion *iommu,
 {
     struct SpaprTceTable *tbl = container_of(iommu, SpaprTceTable, iommu);
 
+    if (new & IOMMU_NOTIFIER_DEVIOTLB_UNMAP) {
+        error_setg(errp, "spart_tce does not support dev-iotlb yet");
+        return -EINVAL;
+    }
+
     if (old == IOMMU_NOTIFIER_NONE && new != IOMMU_NOTIFIER_NONE) {
         spapr_tce_set_need_vfio(tbl, true);
     } else if (old != IOMMU_NOTIFIER_NONE && new == IOMMU_NOTIFIER_NONE) {
This page took 0.028751 seconds and 4 git commands to generate.