[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 04/12] intel_iommu: Fix incorrect "end" for vtd_addre
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 04/12] intel_iommu: Fix incorrect "end" for vtd_address_space_unmap |
Date: |
Fri, 5 Jul 2019 21:50:31 +0200 |
From: Yan Zhao <address@hidden>
IOMMUNotifier is with inclusive ranges, so we should check
against (VTD_ADDRESS_SIZE(s->aw_bits) - 1).
Signed-off-by: Yan Zhao <address@hidden>
[peterx: split from another bigger patch]
Reviewed-by: Eric Auger <address@hidden>
Signed-off-by: Peter Xu <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
hw/i386/intel_iommu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index 44b1231..719ce19 100644
--- a/hw/i386/intel_iommu.c
+++ b/hw/i386/intel_iommu.c
@@ -3379,12 +3379,12 @@ static void vtd_address_space_unmap(VTDAddressSpace
*as, IOMMUNotifier *n)
* VT-d spec), otherwise we need to consider overflow of 64 bits.
*/
- if (end > VTD_ADDRESS_SIZE(s->aw_bits)) {
+ if (end > VTD_ADDRESS_SIZE(s->aw_bits) - 1) {
/*
* Don't need to unmap regions that is bigger than the whole
* VT-d supported address space size
*/
- end = VTD_ADDRESS_SIZE(s->aw_bits);
+ end = VTD_ADDRESS_SIZE(s->aw_bits) - 1;
}
assert(start <= end);
--
1.8.3.1
- [Qemu-devel] [PULL 00/12] Misc bugfixes for QEMU hard freeze, Paolo Bonzini, 2019/07/05
- [Qemu-devel] [PULL 02/12] checkpatch: do not warn for multiline parenthesized returned value, Paolo Bonzini, 2019/07/05
- [Qemu-devel] [PULL 01/12] pc: fix possible NULL pointer dereference in pc_machine_get_device_memory_region_size(), Paolo Bonzini, 2019/07/05
- [Qemu-devel] [PULL 03/12] i386/kvm: Fix build with -m32, Paolo Bonzini, 2019/07/05
- [Qemu-devel] [PULL 04/12] intel_iommu: Fix incorrect "end" for vtd_address_space_unmap,
Paolo Bonzini <=
- [Qemu-devel] [PULL 06/12] ioapic: clear irq_eoi when updating the ioapic redirect table entry, Paolo Bonzini, 2019/07/05
- [Qemu-devel] [PULL 05/12] intel_iommu: Fix unexpected unmaps during global unmap, Paolo Bonzini, 2019/07/05
- [Qemu-devel] [PULL 07/12] target/i386: fix feature check in hyperv-stub.c, Paolo Bonzini, 2019/07/05
- [Qemu-devel] [PULL 08/12] minikconf: do not include variables from MINIKCONF_ARGS in config-all-devices.mak, Paolo Bonzini, 2019/07/05
- [Qemu-devel] [PULL 09/12] target/i386: kvm: Fix when nested state is needed for migration, Paolo Bonzini, 2019/07/05
- [Qemu-devel] [PULL 10/12] Makefile: generate header file with the list of devices enabled, Paolo Bonzini, 2019/07/05
- [Qemu-devel] [PULL 11/12] hw/i386: Fix linker error when ISAPC is disabled, Paolo Bonzini, 2019/07/05
- [Qemu-devel] [PULL 12/12] ioapic: use irq number instead of vector in ioapic_eoi_broadcast, Paolo Bonzini, 2019/07/05