summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Huang <ahuang12@lenovo.com>2020-02-14 13:44:51 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-04-24 09:01:22 +0300
commit3b098eb7486fa87445ac3f8332986b5a50bd0822 (patch)
tree893a9e2442918a85346daa82cd7e603d8ab713d6
parent483af85a4e71fa0bd7a41e9666683cc94b1ccf0f (diff)
downloadlinux-3b098eb7486fa87445ac3f8332986b5a50bd0822.tar.xz
iommu/amd: Fix the configuration of GCR3 table root pointer
[ Upstream commit c20f36534666e37858a14e591114d93cc1be0d34 ] The SPA of the GCR3 table root pointer[51:31] masks 20 bits. However, this requires 21 bits (Please see the AMD IOMMU specification). This leads to the potential failure when the bit 51 of SPA of the GCR3 table root pointer is 1'. Signed-off-by: Adrian Huang <ahuang12@lenovo.com> Fixes: 52815b75682e2 ("iommu/amd: Add support for IOMMUv2 domain mode") Signed-off-by: Joerg Roedel <jroedel@suse.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/iommu/amd_iommu_types.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iommu/amd_iommu_types.h b/drivers/iommu/amd_iommu_types.h
index 3054c0971759..74c8638aac2b 100644
--- a/drivers/iommu/amd_iommu_types.h
+++ b/drivers/iommu/amd_iommu_types.h
@@ -348,7 +348,7 @@
#define DTE_GCR3_VAL_A(x) (((x) >> 12) & 0x00007ULL)
#define DTE_GCR3_VAL_B(x) (((x) >> 15) & 0x0ffffULL)
-#define DTE_GCR3_VAL_C(x) (((x) >> 31) & 0xfffffULL)
+#define DTE_GCR3_VAL_C(x) (((x) >> 31) & 0x1fffffULL)
#define DTE_GCR3_INDEX_A 0
#define DTE_GCR3_INDEX_B 1