qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Aurelien Jarno" <aurelien@aurel32.net>,
	"Hervé Poussineau" <hpoussin@reactos.org>
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Leon Alrae <leon.alrae@imgtec.com>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] dma/rc4030: do multiple calls to address_space_rw when doing DMA transfers
Date: Wed, 17 Jun 2015 19:09:11 +0200	[thread overview]
Message-ID: <5581A9B7.3040700@redhat.com> (raw)
In-Reply-To: <558130CA.4030502@redhat.com>



On 17/06/2015 10:33, Paolo Bonzini wrote:
> On 16/06/2015 19:48, Aurelien Jarno wrote:
>> The code assumes that if you don't have an IOMMU, the address range in
>> the underlying memory region is linear.
> 
> I think this is exactly what Peter Crosthwaite's infamous :) "exec:
> Respect as_translate_internal length clamp" patch was trying to fix.
> However, address_space_translate_internal uses section->mr->size instead
> of section->size.  I'll post a patch once I'm through the email deluge
> from 1 week of absence.

Can you test this?

diff --git a/exec.c b/exec.c
index 76bfc4a..fabb8bb 100644
--- a/exec.c
+++ b/exec.c
@@ -350,7 +350,7 @@
address_space_translate_internal(AddressSpaceDispatch *d, hwaddr addr,
hwaddr *x
     /* Compute offset within MemoryRegion */
     *xlat = addr + section->offset_within_region;

-    diff = int128_sub(section->mr->size, int128_make64(addr));
+    diff = int128_sub(section->size, int128_make64(addr));
     *plen = int128_get64(int128_min(diff, int128_make64(*plen)));
     return section;
 }

Paolo

  reply	other threads:[~2015-06-17 17:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-11 20:30 [Qemu-devel] [PATCH] dma/rc4030: do multiple calls to address_space_rw when doing DMA transfers Hervé Poussineau
2015-06-11 23:30 ` Aurelien Jarno
2015-06-15 20:44   ` Hervé Poussineau
2015-06-16 17:48     ` Aurelien Jarno
2015-06-17  8:33       ` Paolo Bonzini
2015-06-17 17:09         ` Paolo Bonzini [this message]
2015-06-17 18:31           ` Hervé Poussineau
2015-06-17 19:15             ` Paolo Bonzini

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=5581A9B7.3040700@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=aurelien@aurel32.net \
    --cc=hpoussin@reactos.org \
    --cc=leon.alrae@imgtec.com \
    --cc=peter.maydell@linaro.org \
    --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).