From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:59415) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGMT3-0001nS-Fn for qemu-devel@nongnu.org; Tue, 18 Oct 2011 23:05:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RGMT2-0003iw-HP for qemu-devel@nongnu.org; Tue, 18 Oct 2011 23:05:21 -0400 Received: from ozlabs.org ([203.10.76.45]:48141) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGMT1-0003id-WC for qemu-devel@nongnu.org; Tue, 18 Oct 2011 23:05:20 -0400 From: Rusty Russell In-Reply-To: <20111018014650.GB6655@truffala.fritz.box> References: <20111002102547.GC30747@redhat.com> <4E883CF4.6060606@redhat.com> <20111002105238.GE30747@redhat.com> <4E8843DB.1020404@redhat.com> <20111002111700.GF30747@redhat.com> <4E885286.30905@redhat.com> <20111002121426.GK30747@redhat.com> <4E89B5D1.4080600@us.ibm.com> <20111014021407.GB4580@truffala.fritz.box> <4E9AD909.1000509@redhat.com> <20111018014650.GB6655@truffala.fritz.box> Date: Wed, 19 Oct 2011 11:01:12 +1030 Message-ID: <87zkgxakkv.fsf@rustcorp.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] [PATCH 1/9] Add stub functions for PCI device models to do PCI DMA List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson , Avi Kivity Cc: Anthony Liguori , "Michael S. Tsirkin" , joerg.roedel@amd.com, qemu-devel@nongnu.org, agraf@suse.de, kraxel@redhat.com, eduard.munteanu@linux360.ro, rth@twiddle.net On Tue, 18 Oct 2011 12:46:50 +1100, David Gibson wrote: > On Sun, Oct 16, 2011 at 03:15:53PM +0200, Avi Kivity wrote: > > On 10/14/2011 04:14 AM, David Gibson wrote: > > > > Virtio is a very, very special case. virtio requires coherent RAM access. > > > > > > Right. Virtio's access to memory is *not* emulated PCI DMA, it's > > > god-like hypervisor access to guest system memory. It should > > > correctly bypass any IOMMU, and so should remain as > > > cpu_physical_memory_rw() or the atomic accessors, rather than being > > > converted to this new API. > > > > virtio should definitely not bypass an iommu. > > So, I just had a chat with Rusty about this. Perhaps it shouldn't, > but it does. The spec is in terms of guest physical addresses, not > bus/DMA addresses, and more to the point the Linux driver does *not* > do the necessary dma_map() and unmap operations to treat this as a PCI > DMA. So like it or not, god-like hypervisor access rather than > emulated PCI DMA is what it does. Yep, it shouldn't but it does. Can't break it now without a feature bit, and there's no particular reason to add it until someone really wants it. Cheers, Rusty.