From: Auger Eric <eric.auger@redhat.com>
To: Peter Xu <peterx@redhat.com>, qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Jason Wang <jasowang@redhat.com>, Yan Zhao <yan.y.zhao@intel.com>,
"Michael S . Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 1/2] intel_iommu: Fix incorrect "end" for vtd_address_space_unmap
Date: Mon, 24 Jun 2019 09:15:54 +0200 [thread overview]
Message-ID: <34f387d7-ddfb-9a25-debc-2fddd6b82db4@redhat.com> (raw)
In-Reply-To: <20190624063733.22079-2-peterx@redhat.com>
Hi Peter,
On 6/24/19 8:37 AM, Peter Xu wrote:
> 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>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Thanks
Eric
> ---
> 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);
>
next prev parent reply other threads:[~2019-06-24 7:18 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 ` [Qemu-devel] [PATCH 1/2] intel_iommu: Fix incorrect "end" for vtd_address_space_unmap Peter Xu
2019-06-24 7:15 ` Auger Eric [this message]
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=34f387d7-ddfb-9a25-debc-2fddd6b82db4@redhat.com \
--to=eric.auger@redhat.com \
--cc=jasowang@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peterx@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).