From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:59337) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RQ7ES-0000fU-T0 for qemu-devel@nongnu.org; Mon, 14 Nov 2011 19:50:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RQ7ER-00008x-LG for qemu-devel@nongnu.org; Mon, 14 Nov 2011 19:50:36 -0500 Received: from gate.crashing.org ([63.228.1.57]:45004) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RQ7ER-000078-6A for qemu-devel@nongnu.org; Mon, 14 Nov 2011 19:50:35 -0500 Message-ID: <1321318169.21206.72.camel@pasglop> From: Benjamin Herrenschmidt Date: Tue, 15 Nov 2011 11:49:29 +1100 In-Reply-To: <20111115000505.GA5035@truffala.fritz.box> References: <20111103195452.21259.93021.stgit@bling.home> <184D23435BECB444AB6B9D4630C8EC8302D5FE38@XMB-RCD-303.cisco.com> <1321034647.2682.98.camel@bling.home> <184D23435BECB444AB6B9D4630C8EC8302D603A9@XMB-RCD-303.cisco.com> <1321311540.17169.122.camel@bling.home> <20111115000505.GA5035@truffala.fritz.box> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Mime-Version: 1.0 Subject: Re: [Qemu-devel] [RFC PATCH] vfio: VFIO Driver core framework List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson Cc: "Aaron Fabbri (aafabbri)" , aik@au1.ibm.com, kvm@vger.kernel.org, pmac@au1.ibm.com, joerg.roedel@amd.com, konrad.wilk@oracle.com, agraf@suse.de, iommu@lists.linux-foundation.org, qemu-devel@nongnu.org, chrisw@sous-sol.org, B08248@freescale.com, Alex Williamson , avi@redhat.com, linux-pci@vger.kernel.org, B07421@freescale.com, "Christian Benvenuti (benve)" On Tue, 2011-11-15 at 11:05 +1100, David Gibson wrote: > Being strict, or at least enforcing strictness, requires that the > infrastructure track all the maps, so that the unmaps can be > matching. This is not a natural thing with the data structures you > want for all IOMMUs. For example on POWER, the IOMMU (aka TCE table) > is a simple 1-level pagetable. One pointer with a couple of > permission bits per IOMMU page. Handling oddly overlapping operations > on that data structure is natural, enforcing strict matching of maps > and unmaps is not and would require extra information to be stored by > vfio. On POWER, the IOMMU operations often *are* a hot path, so > manipulating those structures would have a real cost, too. In fact they are a very hot path even. There's no way we can afford the cost of tracking per page mapping/unmapping (other than bumping the page count on a page that's currently mapped or via some debug-only feature). Cheers, Ben.