From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Yang, Sheng" Subject: Re: [PATCH] KVM: PCIPT: VT-d support Date: Thu, 10 Jul 2008 17:30:25 +0800 Message-ID: <200807101730.26586.sheng.yang@intel.com> References: <1215681282-3449-1-git-send-email-benami@il.ibm.com> <1215681282-3449-2-git-send-email-benami@il.ibm.com> <1215681282-3449-3-git-send-email-benami@il.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Cc: Ben-Ami Yassour , amit.shah@qumranet.com, muli@il.ibm.com, weidong.han@intel.com, anthony@codemonkey.ws, "Kay, Allen M" To: kvm@vger.kernel.org Return-path: Received: from mga02.intel.com ([134.134.136.20]:40812 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751648AbYGJJ3L (ORCPT ); Thu, 10 Jul 2008 05:29:11 -0400 In-Reply-To: <1215681282-3449-3-git-send-email-benami@il.ibm.com> Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: On Thursday 10 July 2008 17:14:42 Ben-Ami Yassour wrote: > From: Kay, Allen M > > This patch includes the functions to support VT-d for passthrough > devices. > > [Ben: fixed memory pinning] > > Signed-off-by: Kay, Allen M > Signed-off-by: Weidong Han > Signed-off-by: Ben-Ami Yassour > --- > arch/x86/kvm/Makefile | 2 +- > arch/x86/kvm/vtd.c | 176 > ++++++++++++++++++++++++++++++++++++++++++++ arch/x86/kvm/x86.c > | 10 +++ > include/asm-x86/kvm_host.h | 1 + > include/linux/kvm_host.h | 6 ++ > virt/kvm/kvm_main.c | 6 ++ > 6 files changed, 200 insertions(+), 1 deletions(-) > create mode 100644 arch/x86/kvm/vtd.c > > diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c > index 531d635..dc67d90 100644 > --- a/virt/kvm/kvm_main.c > +++ b/virt/kvm/kvm_main.c > @@ -41,6 +41,7 @@ > #include > #include > #include > +#include > > #include > #include > @@ -422,6 +423,11 @@ int __kvm_set_memory_region(struct kvm *kvm, > } > > kvm_free_physmem_slot(&old, &new); > + > + /* map the pages in iommu page table */ > + if (intel_iommu_found()) > + kvm_iommu_map_pages(kvm, base_gfn, npages); > + I don't understand why we need this along with kvm_iommu_map_memslots(). This works during the memory setup, and in kvm_iommu_map_guest() we do it again with the overlapped memory region? I think even if we need pin all pages, we still just need do it once... -- Thanks Yang, Sheng