Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NfzVj-0004rB-5Y for qemu-devel@nongnu.org; Fri, 12 Feb 2010 12:40:59 -0500 Received: from [199.232.76.173] (port=36411 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NfzVi-0004qV-Lx for qemu-devel@nongnu.org; Fri, 12 Feb 2010 12:40:58 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NfzVi-0006y9-4i for qemu-devel@nongnu.org; Fri, 12 Feb 2010 12:40:58 -0500 Received: from mail-pz0-f187.google.com ([209.85.222.187]:35844) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NfzVh-0006y3-QL for qemu-devel@nongnu.org; Fri, 12 Feb 2010 12:40:57 -0500 Received: by pzk17 with SMTP id 17so1527804pzk.4 for ; Fri, 12 Feb 2010 09:40:56 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <4B732179.8020901@codemonkey.ws> References: <1265752899-26980-1-git-send-email-aliguori@us.ibm.com> <4B73090E.1020408@codemonkey.ws> <4B7319F6.5050506@twiddle.net> <4B732179.8020901@codemonkey.ws> From: Blue Swirl Date: Fri, 12 Feb 2010 19:40:36 +0200 Message-ID: Subject: Re: [Qemu-devel] [PATCH 0/15][RFC] New PCI interfaces Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Michael Tsirkin , Alex Graf , qemu-devel@nongnu.org, Richard Henderson On Wed, Feb 10, 2010 at 11:13 PM, Anthony Liguori w= rote: > On 02/10/2010 02:41 PM, Richard Henderson wrote: >> >> On 02/10/2010 11:29 AM, Anthony Liguori wrote: >>> >>> void *pci_memory_map(PCIDevice *dev, pcibus_t addr, pcibus_t *plen, int >>> is_write); >>> >>> void pci_memory_unmap(PCIDevice *dev, void *buf, pcibus_t *plen, int >>> is_write, pcibus_t access_len); >> >> Are these functions intended to be controllable by the root bus object? >> =C2=A0It would be awfully nice if we would design in a hook that allowed= iommu >> mapping to be done properly. > > Yes, that's the point. =C2=A0For something like virtio, you would have a = call > chain like: > > virtio_memory_map -> pci_memory_map -> sysbus_memory_map[1] -> > cpu_memory_map. > > Each layer has the ability to do things like implement iommu mapping. > > [1] I think it might make sense to have a sysbus layer but I'm not 100% s= ure > yet. In Sun4c, CPU MMU handles also IO, so there we could benefit from sysbus layer. Sun4c is very low priority though. For emulation of caches, there would need to be another layer between CPU and memory, which would not be shared with DMA.