mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
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 <[email protected]> Reviewed-by: Mike Habeck <[email protected]> Cc: [email protected] Signed-off-by: David Woodhouse <[email protected]>
This commit is contained in:
parent
8fcc5372fb
commit
cb452a4040
1 changed files with 3 additions and 3 deletions
|
|
@ -2235,10 +2235,10 @@ static int identity_mapping(struct pci_dev *pdev)
|
|||
if (likely(!iommu_identity_mapping))
|
||||
return 0;
|
||||
|
||||
info = pdev->dev.archdata.iommu;
|
||||
if (info && info != DUMMY_DEVICE_DOMAIN_INFO)
|
||||
return (info->domain == si_domain);
|
||||
|
||||
list_for_each_entry(info, &si_domain->devices, link)
|
||||
if (info->dev == pdev)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue