]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
intel_iommu: fix incorrect device invalidate
authorPeter Xu <peterx@redhat.com>
Tue, 29 Nov 2016 05:43:40 +0000 (13:43 +0800)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 13 Dec 2016 00:06:43 +0000 (18:06 -0600)
"mask" needs to be inverted before use.

Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit 6cb99acc2808cc41e2d772a23e9cc564515535cc)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/i386/intel_iommu.c

index 28c31a2cdfa34d5fec125c05bebd71ab6f820db0..a22545b365fbf0e16c81211aa02f7adcdc80dc37 100644 (file)
@@ -985,6 +985,7 @@ static void vtd_context_device_invalidate(IntelIOMMUState *s,
         mask = 7;   /* Mask bit 2:0 in the SID field */
         break;
     }
+    mask = ~mask;
     VTD_DPRINTF(INV, "device-selective invalidation source 0x%"PRIx16
                     " mask %"PRIu16, source_id, mask);
     vtd_bus = vtd_find_as_from_bus_num(s, VTD_SID_TO_BUS(source_id));