]> git.proxmox.com Git - mirror_ubuntu-focal-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)
committerKelsey Skunberg <kelsey.skunberg@canonical.com>
Thu, 17 Sep 2020 06:47:05 +0000 (00:47 -0600)
commit070b15b5e3bb27c3d1ceb5b6ac1ccda0dbe3caf5
treef3ceca19ec223ca573b6420a77333c0fa7a5a2d5
parent6ce6e7aad0a1a36438fcaccded202934a947c170
iommu/vt-d: Serialize IOMMU GCMD register modifications

BugLink: https://bugs.launchpad.net/bugs/1895880
[ Upstream commit 6e4e9ec65078093165463c13d4eb92b3e8d7b2e8 ]

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: af8d102f999a4 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: William Breathitt Gray <william.gray@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
drivers/iommu/intel_irq_remapping.c