From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:48530) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ShSxg-00068y-VU for qemu-devel@nongnu.org; Wed, 20 Jun 2012 18:01:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ShSxf-0006ZC-6G for qemu-devel@nongnu.org; Wed, 20 Jun 2012 18:01:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43856) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ShSxe-0006Z0-Ug for qemu-devel@nongnu.org; Wed, 20 Jun 2012 18:01:15 -0400 Date: Thu, 21 Jun 2012 01:00:51 +0300 From: "Michael S. Tsirkin" Message-ID: <20120620220051.GA26122@redhat.com> References: <1340087992-2399-1-git-send-email-benh@kernel.crashing.org> <1340087992-2399-4-git-send-email-benh@kernel.crashing.org> <4FE23DBF.9040706@codemonkey.ws> <20120620213217.GA25850@redhat.com> <4FE242D6.4060709@codemonkey.ws> <20120620214227.GD25850@redhat.com> <4FE244C9.1090203@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4FE244C9.1090203@codemonkey.ws> Subject: Re: [Qemu-devel] [PATCH 03/13] iommu: Add universal DMA helper functions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Richard Henderson , Eduard - Gabriel Munteanu , qemu-devel@nongnu.org, David Gibson On Wed, Jun 20, 2012 at 04:46:49PM -0500, Anthony Liguori wrote: > On 06/20/2012 04:42 PM, Michael S. Tsirkin wrote: > >On Wed, Jun 20, 2012 at 04:38:30PM -0500, Anthony Liguori wrote: > >>On 06/20/2012 04:32 PM, Michael S. Tsirkin wrote: > >>>On Wed, Jun 20, 2012 at 04:16:47PM -0500, Anthony Liguori wrote: > >>>>>diff --git a/hw/pci.h b/hw/pci.h > >>>>>index 7f223c0..ee669d9 100644 > >>>>>--- a/hw/pci.h > >>>>>+++ b/hw/pci.h > >>>>>@@ -558,10 +558,16 @@ static inline uint32_t pci_config_size(const PCIDevice *d) > >>>>> } > >>>>> > >>>>> /* DMA access functions */ > >>>>>+static inline DMAContext *pci_dma_context(PCIDevice *dev) > >>>>>+{ > >>>>>+ /* Stub for when we have no PCI iommu support */ > >>>>>+ return NULL; > >>>>>+} > >>>> > >>>>Why is all of this stuff static inline? > >>> > >>>Let's face it, most people don't need an MMU in their VM. > >>>inline stubs help make double sure we are not adding > >>>overhead for the sake of this niche case. > >> > >>It also makes for an overly complex pci.h with no obvious performance justification. > >> > >A stub in a header plus an offline empty function is even more useless > >code. inline stubs is standard procedure. > > Look at 8/13. They don't stay stubs for long. That does ont seem to touch pci.h? inlines in dma.h make sense too: a small inline wrapper that selects between the iommu/non iommu variant and an offline implementation for the iommu one. > Regards, > > Anthony Liguori > > > > >>Let's not prematurely optimize here. > >> > >>Regards, > >> > >>Anthony Liguori > > > >It's not just an optimization. It is easier to see what's going on this > >way. > >