qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: pbonzini@redhat.com
Cc: aik@truffula.fritz.box, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 07/17] memory: add address_space_valid
Date: Wed, 1 May 2013 14:02:39 +1000	[thread overview]
Message-ID: <20130501040239.GM20202@truffula.fritz.box> (raw)
In-Reply-To: <1367378320-9246-7-git-send-email-david@gibson.dropbear.id.au>

[-- Attachment #1: Type: text/plain, Size: 1880 bytes --]

Hi Paolo,

I've been looking through your iommu branch, and spotted a few things,
so sending some comments about them.  Since I haven't see where
they've been posted before (if anywhere), I've kind of reconstructed a
mail to reply to from the patch in git.  I hope the result isn't too
cryptic.

On Wed, May 01, 2013 at 01:18:30PM +1000, David Gibson wrote:
> From: Paolo Bonzini <pbonzini@redhat.com>
> 
> Checking whether an address space is possible in the old-style
> IOMMU implementation, but there is no equivalent in the memory API.
> Implement it with a lookup of the dispatch tree.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
[snip]
> ---
>  dma-helpers.c         |    5 +++++
>  exec.c                |   24 ++++++++++++++++++++++++
>  include/exec/memory.h |   12 ++++++++++++
>  include/sysemu/dma.h  |    3 ++-
>  4 files changed, 43 insertions(+), 1 deletion(-)
> 
> diff --git a/dma-helpers.c b/dma-helpers.c
> index 272632f..2962b69 100644
> --- a/dma-helpers.c
> +++ b/dma-helpers.c
> @@ -298,6 +298,11 @@ bool iommu_dma_memory_valid(DMAContext *dma, dma_addr_t addr, dma_addr_t len,
>              plen = len;
>          }
>  
> +        if (!address_space_valid(dma->as, paddr, len,
> +                                 dir == DMA_DIRECTION_FROM_DEVICE)) {
> +            return false;
> +        }

I think the argument to address_space_valid() should be plen, not
len.  Otherwise we're checking that a range the size of the original
area is valid at the target address of just the first page.  Of
course, since the target address space will usually be falt and much
bigger than a page, it's unlikely to trigger.
-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

       reply	other threads:[~2013-05-01  4:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1367378320-9246-1-git-send-email-david@gibson.dropbear.id.au>
     [not found] ` <1367378320-9246-7-git-send-email-david@gibson.dropbear.id.au>
2013-05-01  4:02   ` David Gibson [this message]
2013-05-01  7:17     ` [Qemu-devel] [PATCH 07/17] memory: add address_space_valid Paolo Bonzini
     [not found] ` <1367378320-9246-11-git-send-email-david@gibson.dropbear.id.au>
2013-05-01  4:38   ` [Qemu-devel] [PATCH 11/17] spapr: convert TCE API to use an opaque type David Gibson
     [not found] ` <1367378320-9246-13-git-send-email-david@gibson.dropbear.id.au>
2013-05-01  4:46   ` [Qemu-devel] [PATCH 13/17] spapr: use memory core for iommu support David Gibson
     [not found] ` <1367378320-9246-14-git-send-email-david@gibson.dropbear.id.au>
2013-05-01  4:49   ` [Qemu-devel] [PATCH 14/17] dma: eliminate old-style IOMMU support David Gibson
     [not found] ` <1367378320-9246-15-git-send-email-david@gibson.dropbear.id.au>
2013-05-01  5:06   ` [Qemu-devel] [PATCH 15/17] pci: use memory core for iommu support David Gibson
2013-05-01 16:07     ` Paolo Bonzini
     [not found] ` <1367378320-9246-16-git-send-email-david@gibson.dropbear.id.au>
2013-05-01  5:16   ` [Qemu-devel] [PATCH 16/17] spapr_vio: take care of creating our own AddressSpace/DMAContext David Gibson
2013-05-01 16:09     ` Paolo Bonzini
2013-05-02  2:24       ` David Gibson

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=20130501040239.GM20202@truffula.fritz.box \
    --to=david@gibson.dropbear.id.au \
    --cc=aik@truffula.fritz.box \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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).