From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:48423) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UUyuD-0006Qg-Rk for qemu-devel@nongnu.org; Wed, 24 Apr 2013 08:34:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UUyuC-0003Cs-KS for qemu-devel@nongnu.org; Wed, 24 Apr 2013 08:34:37 -0400 Received: from mail-qc0-x22a.google.com ([2607:f8b0:400d:c01::22a]:59381) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UUyuC-0003Co-Fm for qemu-devel@nongnu.org; Wed, 24 Apr 2013 08:34:36 -0400 Received: by mail-qc0-f170.google.com with SMTP id d42so910602qca.1 for ; Wed, 24 Apr 2013 05:34:36 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <5177D14D.5000609@redhat.com> Date: Wed, 24 Apr 2013 14:34:21 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1366804881-553-1-git-send-email-david@gibson.dropbear.id.au> <1366804881-553-3-git-send-email-david@gibson.dropbear.id.au> In-Reply-To: <1366804881-553-3-git-send-email-david@gibson.dropbear.id.au> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/5] pci: Don't create an address space object for every PCI device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson Cc: aik@ozlabs.ru, alex.williamson@redhat.com, qemu-devel@nongnu.org Il 24/04/2013 14:01, David Gibson ha scritto: > So while its true that the DMAContext handling needs to be better > integrated with the MemoryRegion and AddressSpace handling, that commit > wasn't actually a step in the right direction for it. Since then, the > DMAContext has been extended so it can backend onto an AddressSpace, and > thereby, a MemoryRegion. Effectively a DMAContext is now an AddressSpace > with iommu translation handling on top. > > Therefore, this patch essentially reverts the earlier commit, making all > PCI devices by default shared the global dma_context_memory which backs > onto main system memory. Those cases which need to set up different DMA > address spaces for each PCI device should supply a suitable dma_context_fn > in the bus to correctly assign / create suitable DMAContext structures. I think this will be handled correctly when I submit IOMMU AddressSpace patches (next week or so). The structure will be PCI device 1 PCI device 2 --------------------------------------------------------------- AddressSpace 1 AddressSpace 2 | | | (enable/disable) | (enable/disable) '-------------------. .----------------' v v IOMMU AddressSpace | | (translation) v system memory VFIO will be able to access the IOMMU AddressSpace simply via pci_dev->iommu, and that field will be ==-identical for different PCI devices. Paolo