From: Peter Xu <peterx@redhat.com>
To: qemu-devel@nongnu.org
Cc: Yan Zhao <yan.y.zhao@intel.com>,
"Michael S . Tsirkin" <mst@redhat.com>,
Jason Wang <jasowang@redhat.com>,
peterx@redhat.com, Auger Eric <eric.auger@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>
Subject: [Qemu-devel] [PATCH 1/2] intel_iommu: Fix incorrect "end" for vtd_address_space_unmap
Date: Mon, 24 Jun 2019 14:37:32 +0800 [thread overview]
Message-ID: <20190624063733.22079-2-peterx@redhat.com> (raw)
In-Reply-To: <20190624063733.22079-1-peterx@redhat.com>
From: Yan Zhao <yan.y.zhao@intel.com>
IOMMUNotifier is with inclusive ranges, so we should check
against (VTD_ADDRESS_SIZE(s->aw_bits) - 1).
Signed-off-by: Yan Zhao <yan.y.zhao@intel.com>
[peterx: split from another bigger patch]
Signed-off-by: Peter Xu <peterx@redhat.com>
---
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 44b1231157..719ce19ab3 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);
--
2.21.0
next prev parent reply other threads:[~2019-06-24 6:41 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-24 6:37 [Qemu-devel] [PATCH 0/2] intel_iommu: Fix unexpected unmaps during global unmap Peter Xu
2019-06-24 6:37 ` Peter Xu [this message]
2019-06-24 7:15 ` [Qemu-devel] [PATCH 1/2] intel_iommu: Fix incorrect "end" for vtd_address_space_unmap Auger Eric
2019-06-24 6:37 ` [Qemu-devel] [PATCH 2/2] intel_iommu: Fix unexpected unmaps during global unmap Peter Xu
2019-06-24 6:41 ` Yan Zhao
2019-06-24 6:57 ` Peter Xu
2019-06-24 7:04 ` Yan Zhao
2019-06-24 8:06 ` Peter Xu
2019-06-24 8:43 ` Paolo Bonzini
2019-06-24 9:09 ` Peter Xu
2019-06-24 10:11 ` Paolo Bonzini
2019-06-24 10:28 ` Peter Xu
2019-06-24 8:22 ` Yan Zhao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190624063733.22079-2-peterx@redhat.com \
--to=peterx@redhat.com \
--cc=eric.auger@redhat.com \
--cc=jasowang@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=yan.y.zhao@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).