From: Ben-Ami Yassour Subject: VT-d pci passthrough patches Date: Thu, 10 Jul 2008 12:14:40 +0300 Message-ID: <1215681282-3449-1-git-send-email-benami@il.ibm.com> Cc: kvm@vger.kernel.org, muli@il.ibm.com, benami@il.ibm.com, weidong.han@intel.com, anthony@codemonkey.ws To: amit.shah@qumranet.com Return-path: Received: from mtagate1.uk.ibm.com ([195.212.29.134]:56603 "EHLO mtagate1.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755908AbYGJJO7 (ORCPT ); Thu, 10 Jul 2008 05:14:59 -0400 Received: from d06nrmr1407.portsmouth.uk.ibm.com (d06nrmr1407.portsmouth.uk.ibm.com [9.149.38.185]) by mtagate1.uk.ibm.com (8.13.8/8.13.8) with ESMTP id m6A9EjG4246272 for ; Thu, 10 Jul 2008 09:14:45 GMT Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1407.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v9.0) with ESMTP id m6A9Eja72318472 for ; Thu, 10 Jul 2008 10:14:45 +0100 Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m6A9EiFP026257 for ; Thu, 10 Jul 2008 10:14:45 +0100 Sender: kvm-owner@vger.kernel.org List-ID: The following two patches contains the VT-d support for pci passthrough devices. The first patch contains the changes that are required to the generic VT-d code. The second patch contains the changes to KVM. These patches contains fixes based on comments by Anthony, on the pervious version. The VT-d code is used by the pci-passthrough code to map the entire guest memory in the IOMMU. Once mmu-notifiers go in, we will be able to support finer grained forms of protection. The main differences from the previous version, sent by Weidong, are fixes for the page pinning. In the destruction path we need to call put_page for each page that was mapped in the iommu and pinned during initialization.. The KVM process page tables are already released by the time the KVM vm destroy path is executed. Therefore we can not use gfn_to_pfn (which uses get_user_pages) to get the pages. The approach in the current patch is to find the pages to unpin by looking at the IOMMU page table. This patch applies to the Amit's PCI passthrough tree. Any comments are welcome. Regards, Ben