From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [RFC] [VTD][patch 1/3] vt-d support for pci passthrough: kvm-vtd--kernel.patch Date: Tue, 06 May 2008 13:34:31 +0300 Message-ID: <48203437.60802@qumranet.com> References: <1FE6DD409037234FAB833C420AA843EC01438CB3@orsmsx424.amr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Chris Wright , kvm-devel@lists.sourceforge.net, Ben-Ami Yassour1 To: "Kay, Allen M" Return-path: In-Reply-To: <1FE6DD409037234FAB833C420AA843EC01438CB3@orsmsx424.amr.corp.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces@lists.sourceforge.net Errors-To: kvm-devel-bounces@lists.sourceforge.net List-Id: kvm.vger.kernel.org Kay, Allen M wrote: > + > +#include > +#include > +#include > +#include > +#include > + > +//#define DEBUG > + > +#define DEFAULT_DOMAIN_ADDRESS_WIDTH 48 > The name "domain" is too generic; please use dma_domain or io_domain or something similar. > +static int kvm_iommu_map_memslots(struct kvm *kvm) > +{ > + int i, status; > + for (i = 0; i < kvm->nmemslots; i++) { > + status = kvm_iommu_map_pages(kvm, > kvm->memslots[i].base_gfn, > + kvm->memslots[i].npages); > + if (status) > + return status; > Need to undo in case of partial completion. > diff --git a/include/asm-x86/kvm_para.h b/include/asm-x86/kvm_para.h > index 5f93b78..6202ed1 100644 > --- a/include/asm-x86/kvm_para.h > +++ b/include/asm-x86/kvm_para.h > @@ -170,5 +170,6 @@ struct kvm_pci_pt_info { > struct kvm_pci_passthrough_dev { > struct kvm_pci_pt_info guest; > struct kvm_pci_pt_info host; > + struct pci_dev *pdev; /* kernel device pointer for host dev > */ > This should be stored somewhere private (not sure, but I think kvm_pci_passthrough_dev is a public interface). -- Do not meddle in the internals of kernels, for they are subtle and quick to panic. ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone