From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] [RESEND] VT-d: Support multiple device assignment to one guest Date: Wed, 08 Oct 2008 12:32:12 +0200 Message-ID: <48EC8C2C.5070801@redhat.com> References: <0122C7C995D32147B66BF4F440D3016301CF9679@pdsmsx415.ccr.corp.intel.com> <48EB6431.4070300@redhat.com> <0122C7C995D32147B66BF4F440D3016301D2955D@pdsmsx415.ccr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Joerg Roedel , kvm@vger.kernel.org, Amit Shah , "Kay, Allen M" , "Yang, Sheng" , benami@il.ibm.com, muli@il.ibm.com To: "Han, Weidong" Return-path: Received: from mx2.redhat.com ([66.187.237.31]:54555 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751182AbYJHKf0 (ORCPT ); Wed, 8 Oct 2008 06:35:26 -0400 In-Reply-To: <0122C7C995D32147B66BF4F440D3016301D2955D@pdsmsx415.ccr.corp.intel.com> Sender: kvm-owner@vger.kernel.org List-ID: Han, Weidong wrote: >> Oh, I see it now. Different devices may need to go under different >> iommus. >> >> This really feels like it should be handled by the iommu API. Users >> shouldn't need to bother with it. >> > > Why do you say it should be handled by iommu API? Because the logic of which iommu controls which device is only understood by iommu developers. Also, because this logic would be duplicated by anyone attempting to do the same thing. So it seems reasonable it should be implemented by the iommu API, not its users. > The direct way to > support multiple device assignment is keep a dmar_domain list for each > guest, each device corresponds to one dmar_domain. But this will cost > more memory because each dmar_domain has its own VT-d page table. Our > method lets the devices which are under smae iommu and assigned to the > same guest share the same VT-d page table. > If we devolve this to the iommu API, the same io page table can be shared by all iommus, so long as they all use the same page table format. -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.