From: David Woodhouse Subject: Re: [PATCH v5 6/6] VT-d: support the device IOTLB Date: Sun, 09 Aug 2009 10:33:54 +0100 Message-ID: <1249810434.4919.57.camel@macbook.infradead.org> References: <1242625897-1678-1-git-send-email-yu.zhao@intel.com> <1242625897-1678-7-git-send-email-yu.zhao@intel.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: linux-pci@vger.kernel.org, iommu@lists.linux-foundation.org, kvm@vger.kernel.org, jbarnes@virtuousgeek.org To: Yu Zhao Return-path: Received: from bombadil.infradead.org ([18.85.46.34]:38279 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753391AbZHIJd7 (ORCPT ); Sun, 9 Aug 2009 05:33:59 -0400 In-Reply-To: <1242625897-1678-7-git-send-email-yu.zhao@intel.com> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, 2009-05-18 at 13:51 +0800, Yu Zhao wrote: > Enable the device IOTLB (i.e. ATS) for both the bare metal and KVM > environments. Hmmm. Your iommu_flush_dev_iotlb() function takes the _global_ spinlock 'device_domain_lock'. And you do this unconditionally -- you aren't even calling it only for domains which have ATS-capable devices attached. How about using a flag similar to iommu_snooping, which is recalculated only when you add or remove a device? And only calling iommu_flush_dev_iotlb() if that's set? -- David Woodhouse Open Source Technology Centre David.Woodhouse@intel.com Intel Corporation