From: Amit Shah Subject: Re: [PATCH 2/2] KVM: Device assignemnt with VT-d Date: Sat, 23 Aug 2008 14:27:42 +0530 Message-ID: <200808231427.42578.amit.shah@qumranet.com> References: <1218118487-7657-1-git-send-email-benami@il.ibm.com> <200808221314.02434.amit.shah@qumranet.com> <48AF0302.8060805@qumranet.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Cc: Ben-Ami Yassour , kvm@vger.kernel.org, Muli Ben-Yehuda , weidong.han@intel.com, "Kay, Allen M" To: Avi Kivity Return-path: Received: from mis011-1.exch011.intermedia.net ([64.78.17.182]:54636 "EHLO mis011-1.exch011.intermedia.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751678AbYHWI6k (ORCPT ); Sat, 23 Aug 2008 04:58:40 -0400 In-Reply-To: <48AF0302.8060805@qumranet.com> Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: * On Friday 22 Aug 2008 23:48:42 Avi Kivity wrote: > Amit Shah wrote: > > diff --git a/include/linux/kvm.h b/include/linux/kvm.h > > index d9ef7d3..2956e35 100644 > > --- a/include/linux/kvm.h > > +++ b/include/linux/kvm.h > > @@ -495,4 +495,6 @@ struct kvm_assigned_irq { > > __u32 flags; > > }; > > > > +#define KVM_DEV_ASSIGN_USE_VTD (1 << 1) > > + > > #endif > > (1 >> 0)? I kept the 1st field reserved for no particular implementation in mind as of now. > This is a userspace inteface, so use a generic name like iommu. We also > need a KVM_CAP so userspace can check whether an iommu is present or not. We could have multiple hardware IOMMU implementations, like Intel's VT-d and AMD's IOMMU. Also, is KVM_CAP_foo needed for this? This is the only #define that'll be used and we can simply do something like #ifdef KVM_DEV_ASSIGN_USE_VTD flags |= KVM_DEV_ASSIGN_USE_VTD #endif ?