Received: from eggs.gnu.org ([140.186.70.92]:50489) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QzLzE-00010D-Ba for qemu-devel@nongnu.org; Fri, 02 Sep 2011 01:08:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QzLzC-0004Pc-UU for qemu-devel@nongnu.org; Fri, 02 Sep 2011 01:08:16 -0400 Received: from e23smtp07.au.ibm.com ([202.81.31.140]:38178) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QzLzC-00049S-Bh for qemu-devel@nongnu.org; Fri, 02 Sep 2011 01:08:14 -0400 Received: from d23relay03.au.ibm.com (d23relay03.au.ibm.com [202.81.31.245]) by e23smtp07.au.ibm.com (8.14.4/8.13.1) with ESMTP id p8257uni013455 for ; Fri, 2 Sep 2011 15:07:56 +1000 Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96]) by d23relay03.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p8257sjW1040408 for ; Fri, 2 Sep 2011 15:07:56 +1000 Received: from d23av01.au.ibm.com (loopback [127.0.0.1]) by d23av01.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p8257rNq001713 for ; Fri, 2 Sep 2011 15:07:54 +1000 Date: Fri, 2 Sep 2011 14:38:25 +1000 From: David Gibson Message-ID: <20110902043825.GX11906@yookeroo.fritz.box> References: <1314853263-2086-1-git-send-email-david@gibson.dropbear.id.au> <1314853263-2086-2-git-send-email-david@gibson.dropbear.id.au> <20110901153550.GC10989@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110901153550.GC10989@redhat.com> 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: "Michael S. Tsirkin" Cc: aliguori@us.ibm.com, joerg.roedel@amd.com, qemu-devel@nongnu.org, agraf@suse.de, eduard.munteanu@linux360.ro, rth@twiddle.net On Thu, Sep 01, 2011 at 06:35:51PM +0300, Michael S. Tsirkin wrote: > On Thu, Sep 01, 2011 at 03:00:54PM +1000, David Gibson wrote: [snip] > > +#define DECLARE_LDST_DMA(_lname, _sname, _bits) \ > > + uint##_bits##_t ld##_lname##_pci_dma(PCIDevice *dev, dma_addr_t addr); \ > > + void st##_sname##_pci_dma(PCIDevice *dev, dma_addr_t addr, \ > > + uint##_bits##_t val); \ > > prefix macros with PCI_ please. Corrected for the next spin. > > +DECLARE_LDST_DMA(ub, b, 8); > > +DECLARE_LDST_DMA(uw, w, 16); > > +DECLARE_LDST_DMA(l, l, 32); > > +DECLARE_LDST_DMA(q, q, 64); > > + > > +#undef DECLARE_LDST_DMA > > + > > #endif > > I'd prefer the stubs to be inline. Not just as an optimization: > it also makes it easier to grok what goes on in the common > no-iommu case. To elaborate on my earlier mail. The problem with making them inlines is that the cpu_physical_*() functions then appear in pci.h, which is used in pci.c amongst other places that are included in libhw32/libhw64, where those functions are poisoned. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson