From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:53643) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UN6aS-0000NP-3f for qemu-devel@nongnu.org; Tue, 02 Apr 2013 15:09:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UN6aL-00047B-MR for qemu-devel@nongnu.org; Tue, 02 Apr 2013 15:09:40 -0400 Received: from mail-ea0-x236.google.com ([2a00:1450:4013:c01::236]:58019) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UN6aL-00045A-FG for qemu-devel@nongnu.org; Tue, 02 Apr 2013 15:09:33 -0400 Received: by mail-ea0-f182.google.com with SMTP id q15so389767ead.13 for ; Tue, 02 Apr 2013 12:09:32 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <515B2CE6.3040703@redhat.com> Date: Tue, 02 Apr 2013 21:09:26 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1364919044-18413-1-git-send-email-peter.maydell@linaro.org> <515B0A79.50906@redhat.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 0/2] Drop support for qdev taddr properties List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Anthony Liguori , David Gibson , qemu-devel@nongnu.org, patches@linaro.org Il 02/04/2013 19:07, Peter Maydell ha scritto: > On 2 April 2013 17:42, Paolo Bonzini wrote: >> Il 02/04/2013 18:10, Peter Maydell ha scritto: >>> Aside: I may try to get rid of the DMAADDR property too at some >>> point, because what the sysbus-ohci device should actually be doing >>> is taking a MemoryRegion* [or maybe a DMAContext*] >> >> Avi had patches to unify DMAContext and MemoryRegion. I should revive >> them perhaps. > > Yes please. > >>> representing what >>> it should be DMAing into, rather than the current "DMA into the >>> system address space at addr + some constant offset" hack. One >>> thing at a time, though. >> >> That's a general problem with sysbus. I guess if you need another >> address space you should define your own bus, like PCI does. > > It's not a problem with sysbus, it's a problem with people > being lazy about implementing things that do DMA. For instance > PCI doesn't take a MemoryRegion* for DMA, it just assumes it > can DMA into the system address space. PCI does provide its own DMAContext*, which includes an AddressSpace. This address space ("view of the world") is different for each device. > (it does let you pass > a DMAContext, but maybe that goes away with the patches you > mention above; it's only used for spapr.) It is extended so that it is also used for spapr with those patches. Paolo > NB that "the PCI address space", ie the view of the world that > the host controller sees when it makes a PCI access, is not > the same as the address space that another bus mastering PCI > device sees when it does a DMA access. Chances are good that > the former shouldn't have any of the system's RAM in it and > the latter should. (This is easy to handle though, you just > create container MemoryRegions for each and pass them to the > PCI code and make sure that you're using the right one at > any particular point.) > > -- PMM > >