AMD IOMMU: fix an init time spinlock flaw
authorQuan Xu <quan.xu@intel.com>
Mon, 14 Mar 2016 11:59:39 +0000 (12:59 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 14 Mar 2016 11:59:39 +0000 (12:59 +0100)
commitbf55ead25c5e9a7fbd8fa47c64ec8d1557478efb
tree3a42d178ed8717f686a022bc12729bd381f2173c
parente46a729b18af85b4dd040578643f7fa430b22a48
AMD IOMMU: fix an init time spinlock flaw

pcidevs_lock doesn't require interrupts to be disabled while being acquired.
However there remains an exception in AMD IOMMU code, where the lock is
acquired with interrupt disabled. This inconsistency might lead to deadlock.

The fix is straightforward to use spin_lock instead. Also interrupt has been
enabled when this function is invoked, so we're sure consistency around
pcidevs_lock can be guaranteed after this fix.

Signed-off-by: Quan Xu <quan.xu@intel.com>
Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/drivers/passthrough/amd/iommu_init.c