From: Ben-Ami Yassour Subject: Re: [PATCH] KVM: PCIPT: VT-d support Date: Mon, 14 Jul 2008 10:49:36 +0300 Message-ID: <1216021776.31546.210.camel@cluwyn.haifa.ibm.com> References: <1215681282-3449-1-git-send-email-benami@il.ibm.com> <200807101730.26586.sheng.yang@intel.com> <1215683513.31546.175.camel@cluwyn.haifa.ibm.com> <200807101807.28719.sheng.yang@intel.com> <20080710144124.GD7273@il.ibm.com> <48762374.3000002@qumranet.com> <20080710160047.GE7273@il.ibm.com> <4879AFFC.8000004@qumranet.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: Muli Ben-Yehuda , "Yang, Sheng" , kvm@vger.kernel.org, amit.shah@qumranet.com, weidong.han@intel.com, anthony@codemonkey.ws, "Kay, Allen M" To: Avi Kivity Return-path: Received: from mtagate7.uk.ibm.com ([195.212.29.140]:35472 "EHLO mtagate7.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755985AbYGNHvy (ORCPT ); Mon, 14 Jul 2008 03:51:54 -0400 Received: from d06nrmr1407.portsmouth.uk.ibm.com (d06nrmr1407.portsmouth.uk.ibm.com [9.149.38.185]) by mtagate7.uk.ibm.com (8.13.8/8.13.8) with ESMTP id m6E7nsM9336632 for ; Mon, 14 Jul 2008 07:49:54 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 m6E7nl0d753754 for ; Mon, 14 Jul 2008 08:49:51 +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 m6E7ne1l018081 for ; Mon, 14 Jul 2008 08:49:40 +0100 In-Reply-To: <4879AFFC.8000004@qumranet.com> Sender: kvm-owner@vger.kernel.org List-ID: On Sun, 2008-07-13 at 10:34 +0300, Avi Kivity wrote: > Muli Ben-Yehuda wrote: > > > >> On the other hand, this means that you will not be able to assign > >> devices unless you specified this when creating the VM; but I think > >> this is fair. > >> > > > > It will be nice to support hot-plugged pass-through devices some time > > in the future. > > > > > > And it should be easy to do too. The question is whether we need to > allocate the iommu domain up front (which would mean that a command line > parameter would be needed, meaning roughly 'support pci device > assignment on this guest'. Kind of like -usb, which means 'support usb > device assignment on this guest'. > I don't think that its that simple... On a single machine you can have multiple iommu units, each of which controls certain PCI slots. To configure the iommu for a specific device you need to configure the iommu unit that controls that device. This means that we need to know the bus/dev/func of the device before we create the VT-d domain. For hot-plug devices it means that by the time we can create the domain we already have memory slots that we need to add to the VT-d mapping. In addition, some times it is desirable to be able to map the memory as late as possible. For example if the guest supports PVDMA then there is no need to map the entire guest memory, however the host can not tell if the guest supports PVDMA before the memory slots are created. In this case we would like to postpone the mapping of the entire guest memory until we know we have to. Regards, Ben