]> git.baikalelectronics.ru Git - kernel.git/commit
iommu/vt-d: Serialize IOMMU GCMD register modifications
authorLu Baolu <baolu.lu@linux.intel.com>
Fri, 28 Aug 2020 00:06:15 +0000 (08:06 +0800)
committerJoerg Roedel <jroedel@suse.de>
Fri, 4 Sep 2020 09:39:21 +0000 (11:39 +0200)
commitac9861a1aafeb05086dacf9e26f851e242fe6567
treee114b3fced2821373fcbc6e08f19aa71c5db007d
parent02c0ee7842b8b8dee13edad0f188b0a47f385981
iommu/vt-d: Serialize IOMMU GCMD register modifications

The VT-d spec requires (10.4.4 Global Command Register, GCMD_REG General
Description) that:

If multiple control fields in this register need to be modified, software
must serialize the modifications through multiple writes to this register.

However, in irq_remapping.c, modifications of IRE and CFI are done in one
write. We need to do two separate writes with STS checking after each. It
also checks the status register before writing command register to avoid
unnecessary register write.

Fixes: 8c438e0b2b213 ("x86/intel/irq_remapping: Clean up x2apic opt-out security warning mess")
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Jacob Pan <jacob.jun.pan@linux.intel.com>
Cc: Kevin Tian <kevin.tian@intel.com>
Cc: Ashok Raj <ashok.raj@intel.com>
Link: https://lore.kernel.org/r/20200828000615.8281-1-baolu.lu@linux.intel.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/intel/irq_remapping.c