From: Jason Wang <jasowang@redhat.com>
To: Peter Xu <peterx@redhat.com>, qemu-devel@nongnu.org
Cc: Auger Eric <eric.auger@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Yan Zhao <yan.y.zhao@intel.com>,
"Michael S . Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2 1/2] intel_iommu: Fix incorrect "end" for vtd_address_space_unmap
Date: Thu, 4 Jul 2019 13:39:16 +0800 [thread overview]
Message-ID: <6b1efecf-64eb-3306-d2a8-86f731b07d08@redhat.com> (raw)
In-Reply-To: <20190624091811.30412-2-peterx@redhat.com>
On 2019/6/24 下午5:18, 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]
> Reviewed-by: Eric Auger <eric.auger@redhat.com>
> 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);
Acked-by: Jason Wang <jasowang@redhat.com>
next prev parent reply other threads:[~2019-07-04 5:41 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-24 9:18 [Qemu-devel] [PATCH v2 0/2] intel_iommu: Fix unexpected unmaps during global unmap Peter Xu
2019-06-24 9:18 ` [Qemu-devel] [PATCH v2 1/2] intel_iommu: Fix incorrect "end" for vtd_address_space_unmap Peter Xu
2019-07-04 5:39 ` Jason Wang [this message]
2019-06-24 9:18 ` [Qemu-devel] [PATCH v2 2/2] intel_iommu: Fix unexpected unmaps during global unmap Peter Xu
2019-06-24 10:09 ` Auger Eric
2019-06-24 11:10 ` Peter Xu
2019-06-24 12:48 ` Auger Eric
2019-06-24 13:21 ` Paolo Bonzini
2019-06-24 10:12 ` Paolo Bonzini
2019-06-25 3:02 ` Yan Zhao
2019-06-25 7:00 ` Auger Eric
2019-07-04 5:45 ` Jason Wang
2019-07-04 8:17 ` Peter Xu
2019-07-01 12:00 ` [Qemu-devel] [PATCH v2 0/2] " Michael S. Tsirkin
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=6b1efecf-64eb-3306-d2a8-86f731b07d08@redhat.com \
--to=jasowang@redhat.com \
--cc=eric.auger@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).