diff options
author | Mike Travis <travis@sgi.com> | 2011-05-28 14:15:03 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2011-06-01 07:47:36 -0400 |
commit | cb452a4040bb051d92e85d6e7eb60c11734c1781 (patch) | |
tree | ef19298ec70274c9c199fa74a4f08e77cc69080b /drivers | |
parent | 8fcc5372fbac085199d84a880503ed67aba3fe49 (diff) |
intel-iommu: Speed up processing of the identity_mapping function
When there are a large count of PCI devices, and the pass through
option for iommu is set, much time is spent in the identity_mapping
function hunting though the iommu domains to check if a specific
device is "identity mapped".
Speed up the function by checking the cached info to see if
it's mapped to the static identity domain.
Signed-off-by: Mike Travis <travis@sgi.com>
Reviewed-by: Mike Habeck <habeck@sgi.com>
Cc: stable@kernel.org
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/pci/intel-iommu.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c index dcf051d53b74..98be0b55ac0b 100644 --- a/drivers/pci/intel-iommu.c +++ b/drivers/pci/intel-iommu.c | |||
@@ -2235,10 +2235,10 @@ static int identity_mapping(struct pci_dev *pdev) | |||
2235 | if (likely(!iommu_identity_mapping)) | 2235 | if (likely(!iommu_identity_mapping)) |
2236 | return 0; | 2236 | return 0; |
2237 | 2237 | ||
2238 | info = pdev->dev.archdata.iommu; | ||
2239 | if (info && info != DUMMY_DEVICE_DOMAIN_INFO) | ||
2240 | return (info->domain == si_domain); | ||
2238 | 2241 | ||
2239 | list_for_each_entry(info, &si_domain->devices, link) | ||
2240 | if (info->dev == pdev) | ||
2241 | return 1; | ||
2242 | return 0; | 2242 | return 0; |
2243 | } | 2243 | } |
2244 | 2244 | ||