From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Yang, Sheng" Subject: Re: [PATCH 5/5] This patch extends the VT-d driver to support KVM Date: Tue, 5 Aug 2008 14:01:42 +0800 Message-ID: <200808051401.43106.sheng.yang@intel.com> References: <1217262388-7309-1-git-send-email-benami@il.ibm.com> <1217262388-7309-5-git-send-email-benami@il.ibm.com> <1217262388-7309-6-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 , avi@qumranet.com, 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 mga11.intel.com ([192.55.52.93]:50787 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754617AbYHEF7Q (ORCPT ); Tue, 5 Aug 2008 01:59:16 -0400 In-Reply-To: <1217262388-7309-6-git-send-email-benami@il.ibm.com> Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: On Tuesday 29 July 2008 00:26:28 Ben-Ami Yassour wrote: > [Ben: fixed memory pinning] > > 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); > + Realize one serious problem here: this line pinned all memory regardless of if VT-d device have been assigned. That's means if VT-d engine is there(even without assigned device), KVM would pin all memory, then disable swapping capability. It's very undesired... I don't know if Avi aware of that. I think we should check assigned device list here to avoid this kind of thing happen. Also, we may need a lock here to prevent racy with assign_device(). -- regards Yang, Sheng