iommu/vt-d: Convert global spinlock into per domain lock
authorLu Baolu <baolu.lu@linux.intel.com>
Tue, 12 Jul 2022 00:09:02 +0000 (08:09 +0800)
committerJoerg Roedel <jroedel@suse.de>
Fri, 15 Jul 2022 08:21:39 +0000 (10:21 +0200)
commit5eaafdf0c05577f9b6cf8c64dee7d39ccdafa63a
tree83d2f75b50ee5268f606d4b99be2f57cdd37b79f
parent969aaefbaaf2b444852c1980ac0cbbb66463fdae
iommu/vt-d: Convert global spinlock into per domain lock

Using a global device_domain_lock spinlock to protect per-domain device
tracking lists is an inefficient way, especially considering this lock
is also needed in the hot paths. This optimizes the locking mechanism
by converting the global lock to per domain lock.

On the other hand, as the device tracking lists are never accessed in
any interrupt context, there is no need to disable interrupts while
spinning. Replace irqsave variant with spinlock calls.

Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Link: https://lore.kernel.org/r/20220706025524.2904370-12-baolu.lu@linux.intel.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/intel/iommu.c
drivers/iommu/intel/iommu.h