[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 11/25] intel_iommu: fix operator in vtd_switch_addres
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 11/25] intel_iommu: fix operator in vtd_switch_address_space |
Date: |
Mon, 4 Feb 2019 09:43:40 -0500 |
From: Peter Xu <address@hidden>
When calculating use_iommu, we wanted to first detect whether DMAR is
enabled, then check whether PT is enabled if DMAR is enabled. However
in the current code we used "&" rather than "&&" so the ordering
requirement is lost (instead it'll be an "AND" operation). This could
introduce errors dumped in QEMU console when rebooting a guest with
both assigned device and vIOMMU, like:
qemu-system-x86_64: vtd_dev_to_context_entry: invalid root entry:
rsvd=0xf000ff53f000e2c3, val=0xf000ff53f000ff53 (reserved nonzero)
Acked-by: Jason Wang <address@hidden>
Signed-off-by: Peter Xu <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
hw/i386/intel_iommu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index 8b72735650..6d5cc1d039 100644
--- a/hw/i386/intel_iommu.c
+++ b/hw/i386/intel_iommu.c
@@ -1153,7 +1153,7 @@ static bool vtd_switch_address_space(VTDAddressSpace *as)
assert(as);
- use_iommu = as->iommu_state->dmar_enabled & !vtd_dev_pt_enabled(as);
+ use_iommu = as->iommu_state->dmar_enabled && !vtd_dev_pt_enabled(as);
trace_vtd_switch_address_space(pci_bus_num(as->bus),
VTD_PCI_SLOT(as->devfn),
--
MST
- [Qemu-devel] [PULL 20/25] fw_cfg: fix the life cycle and the name of "qemu_extra_params_fw", (continued)
- [Qemu-devel] [PULL 20/25] fw_cfg: fix the life cycle and the name of "qemu_extra_params_fw", Michael S. Tsirkin, 2019/02/04
- [Qemu-devel] [PULL 24/25] r2d: fix build on mingw, Michael S. Tsirkin, 2019/02/04
- [Qemu-devel] [PULL 06/25] vhost-net-user: add stubs for when no virtio-net device is present, Michael S. Tsirkin, 2019/02/04
- [Qemu-devel] [PULL 22/25] mmap-alloc: unfold qemu_ram_mmap(), Michael S. Tsirkin, 2019/02/04
- [Qemu-devel] [PULL 17/25] vhost-user-blk: add discard/write zeroes features support, Michael S. Tsirkin, 2019/02/04
- [Qemu-devel] [PULL 18/25] hw/virtio: Use CONFIG_VIRTIO_PCI switch instead of CONFIG_PCI, Michael S. Tsirkin, 2019/02/04
- [Qemu-devel] [PULL 19/25] acpi: Make TPM 2.0 with TIS available as MSFT0101, Michael S. Tsirkin, 2019/02/04
- [Qemu-devel] [PULL 16/25] contrib/vhost-user-blk: fix the compilation issue, Michael S. Tsirkin, 2019/02/04
- [Qemu-devel] [PULL 14/25] i386/kvm: ignore masked irqs when update msi routes, Michael S. Tsirkin, 2019/02/04
- [Qemu-devel] [PULL 07/25] vhost: restrict Linux dependency to kernel vhost, Michael S. Tsirkin, 2019/02/04
- [Qemu-devel] [PULL 11/25] intel_iommu: fix operator in vtd_switch_address_space,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 08/25] vhost-net: compile it on all targets that have virtio-net., Michael S. Tsirkin, 2019/02/04
- [Qemu-devel] [PULL 15/25] contrib: compile vhost-user-blk tool by default, Michael S. Tsirkin, 2019/02/04
[Qemu-devel] [PULL 13/25] pci/msi: export msi_is_masked(), Michael S. Tsirkin, 2019/02/04
[Qemu-devel] [PULL 02/25] contrib/libvhost-user: switch to uint64_t, Michael S. Tsirkin, 2019/02/04
[Qemu-devel] [PULL 09/25] vhost-net: revamp configure logic, Michael S. Tsirkin, 2019/02/04