From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:38275) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QzAC4-0007en-Eq for qemu-devel@nongnu.org; Thu, 01 Sep 2011 12:32:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QzAC3-0002qw-Fw for qemu-devel@nongnu.org; Thu, 01 Sep 2011 12:32:44 -0400 Received: from mail-yi0-f45.google.com ([209.85.218.45]:42847) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QzAC3-0002qa-0S for qemu-devel@nongnu.org; Thu, 01 Sep 2011 12:32:43 -0400 Received: by yih10 with SMTP id 10so1697949yih.4 for ; Thu, 01 Sep 2011 09:32:41 -0700 (PDT) Message-ID: <4E5FB3A6.1050909@codemonkey.ws> Date: Thu, 01 Sep 2011 11:32:38 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <1314853263-2086-1-git-send-email-david@gibson.dropbear.id.au> <1314853263-2086-2-git-send-email-david@gibson.dropbear.id.au> <4E5FAADF.1040704@us.ibm.com> <4E5FACD6.9000603@redhat.com> <4E5FAD5C.4090208@codemonkey.ws> <4E5FAEC7.1080901@redhat.com> In-Reply-To: <4E5FAEC7.1080901@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 01/10] Add stub functions for PCI device models to do PCI DMA List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: Anthony Liguori , joerg.roedel@amd.com, agraf@suse.de, qemu-devel@nongnu.org, eduard.munteanu@linux360.ro, David Gibson , rth@twiddle.net On 09/01/2011 11:11 AM, Avi Kivity wrote: > On 09/01/2011 07:05 PM, Anthony Liguori wrote: >>> I think the patchset is fine. It routes all access through pci_dma_rw(), >>> which accepts a PCIDevice. We can later define pci_dma_rw() in terms of >>> the memory API and get the benefit of the memory hierarchy. >> >> >> The challenge is what you do about something like ne2k where the core >> chipset can either be a PCI device or an ISA device. You would have to >> implement a wrapper around pci_dma_rw() in order to turn it into >> cpu_physical_memory_rw when doing ISA. >> > > True. But I still think it's the right thing. > > We can't really pass a MemoryRegion as the source address, since there > is no per-device MemoryRegion. Couldn't the PCI bus expose 255 MemoryRegions though? It could still use the pci_address_space I think since that should include RAM too, right? In fact, initially, you could have a pci_bus_get_device_memory_region(bus, dev) that just returns pci_address_space(). You just need the memory_st[bwl] functions I think. Regards, Anthony Liguori We can use pci_address_space() for basic > offsetting, and for bypassing bridge windows, but iommu source detection > has to use the PCIDevice directly. >