|
|
b38b0f |
From 94edd1b203f3a88065ce05d9e027b24a3e8eed2f Mon Sep 17 00:00:00 2001
|
|
|
b38b0f |
From: Peter Xu <peterx@redhat.com>
|
|
|
b38b0f |
Date: Tue, 2 Apr 2019 07:25:28 +0100
|
|
|
b38b0f |
Subject: [PATCH 4/7] intel_iommu: fix operator in vtd_switch_address_space
|
|
|
b38b0f |
|
|
|
b38b0f |
RH-Author: Peter Xu <peterx@redhat.com>
|
|
|
b38b0f |
Message-id: <20190402072531.23771-2-peterx@redhat.com>
|
|
|
b38b0f |
Patchwork-id: 85298
|
|
|
b38b0f |
O-Subject: [RHEL-8.1 qemu-kvm PATCH 1/4] intel_iommu: fix operator in vtd_switch_address_space
|
|
|
b38b0f |
Bugzilla: 1662272
|
|
|
b38b0f |
RH-Acked-by: Wei Huang <wei@redhat.com>
|
|
|
b38b0f |
RH-Acked-by: Xiao Wang <jasowang@redhat.com>
|
|
|
b38b0f |
RH-Acked-by: Michael S. Tsirkin <mst@redhat.com>
|
|
|
b38b0f |
|
|
|
b38b0f |
When calculating use_iommu, we wanted to first detect whether DMAR is
|
|
|
b38b0f |
enabled, then check whether PT is enabled if DMAR is enabled. However
|
|
|
b38b0f |
in the current code we used "&" rather than "&&" so the ordering
|
|
|
b38b0f |
requirement is lost (instead it'll be an "AND" operation). This could
|
|
|
b38b0f |
introduce errors dumped in QEMU console when rebooting a guest with
|
|
|
b38b0f |
both assigned device and vIOMMU, like:
|
|
|
b38b0f |
|
|
|
b38b0f |
qemu-system-x86_64: vtd_dev_to_context_entry: invalid root entry:
|
|
|
b38b0f |
rsvd=0xf000ff53f000e2c3, val=0xf000ff53f000ff53 (reserved nonzero)
|
|
|
b38b0f |
|
|
|
b38b0f |
Acked-by: Jason Wang <jasowang@redhat.com>
|
|
|
b38b0f |
Signed-off-by: Peter Xu <peterx@redhat.com>
|
|
|
b38b0f |
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
|
|
|
b38b0f |
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
|
|
|
b38b0f |
(cherry picked from commit 2a078b1080917dc6143783e1dd645e188d11dc8f)
|
|
|
b38b0f |
Signed-off-by: Peter Xu <peterx@redhat.com>
|
|
|
b38b0f |
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
|
|
|
b38b0f |
---
|
|
|
b38b0f |
hw/i386/intel_iommu.c | 2 +-
|
|
|
b38b0f |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
b38b0f |
|
|
|
b38b0f |
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
|
|
|
b38b0f |
index 12af410..7170266 100644
|
|
|
b38b0f |
--- a/hw/i386/intel_iommu.c
|
|
|
b38b0f |
+++ b/hw/i386/intel_iommu.c
|
|
|
b38b0f |
@@ -1145,7 +1145,7 @@ static bool vtd_switch_address_space(VTDAddressSpace *as)
|
|
|
b38b0f |
|
|
|
b38b0f |
assert(as);
|
|
|
b38b0f |
|
|
|
b38b0f |
- use_iommu = as->iommu_state->dmar_enabled & !vtd_dev_pt_enabled(as);
|
|
|
b38b0f |
+ use_iommu = as->iommu_state->dmar_enabled && !vtd_dev_pt_enabled(as);
|
|
|
b38b0f |
|
|
|
b38b0f |
trace_vtd_switch_address_space(pci_bus_num(as->bus),
|
|
|
b38b0f |
VTD_PCI_SLOT(as->devfn),
|
|
|
b38b0f |
--
|
|
|
b38b0f |
1.8.3.1
|
|
|
b38b0f |
|