All of lore.kernel.org
 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 10:33:14 +0200	[thread overview]
Message-ID: <558130CA.4030502@redhat.com> (raw)
In-Reply-To: <20150616174846.GA17031@aurel32.net>



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.

If I read correctly the patch that introduced address_space_translate,
the bug has always been there.

> One fix would be to adjust the
> length even without IOMMU. That would have some performance impact
> though, so maybe we want to make this assumption clear and always use an
> IOMMU in that case.

I don't think there would be a performance impact, except in buggy cases
such as the one Hervé is fixing.

Paolo

>>> I therefore wonder if
>>> you therefore shouldn't model this DMA translation tables by using IOMMU
>>> ops instead of subregions.
>>>
>> No, in my opinion, that's an implementation detail. Paolo said that it was OK:
>> "Both are okay.  The IOMMU makes address space changes faster; your
>> scheme is basically a form of caching, it trades update performance for
>> improved translation performance."
>> http://lists.gnu.org/archive/html/qemu-devel/2015-03/msg05486.html
> 
> It seems wrong with the current code. And if we fix the bug by adjusting
> the length, the above sentence about the performances might becomes
> wrong
> 
> Aurelien.
> 

  reply	other threads:[~2015-06-17  8:33 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 [this message]
2015-06-17 17:09         ` Paolo Bonzini
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=558130CA.4030502@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.