From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:42202) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UXZZH-0003HE-FS for qemu-devel@nongnu.org; Wed, 01 May 2013 12:07:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UXZZG-00088v-1I for qemu-devel@nongnu.org; Wed, 01 May 2013 12:07:43 -0400 Received: from mail-gg0-x233.google.com ([2607:f8b0:4002:c02::233]:59352) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UXZZF-00088q-Sa for qemu-devel@nongnu.org; Wed, 01 May 2013 12:07:41 -0400 Received: by mail-gg0-f179.google.com with SMTP id k25so291078ggl.10 for ; Wed, 01 May 2013 09:07:41 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <51813DBB.7060305@redhat.com> Date: Wed, 01 May 2013 18:07:23 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1367378320-9246-1-git-send-email-david@gibson.dropbear.id.au> <1367378320-9246-15-git-send-email-david@gibson.dropbear.id.au> <20130501050634.GA14106@truffula.fritz.box> In-Reply-To: <20130501050634.GA14106@truffula.fritz.box> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 15/17] pci: use memory core for iommu support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson Cc: Alexey Kardashevskiy , alex.williamson@redhat.com, qemu-devel@nongnu.org Il 01/05/2013 07:06, David Gibson ha scritto: >>> + + /* FIXME: inherit memory region from bus creator */ + >>> memory_region_init_alias(mr, "iommu-nop", get_system_memory(), >>> 0, INT64_MAX); + return mr; > I don't see the reason for creating a new alias for each PCI > device. Can't pci_dev->iommu just point directly to > get_system_memory() in the normal case? > > In addition to creating additional objects, having these aliases > makes it much les obvious how to tell if two PCI devices share an > IOMMU address space. We have to be able to determine that for > VFIO, since devices which share an address space in the host > clearly can't be assigned to different address spaces in the > guest. Right, the alias that is needed to enable/disable bus-mastering is created already below, so pci_dev->iommu can be shared (as it is in the spapr case). Paolo