iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 5.6 01/73] iommu/amd: Fix the configuration of GCR3 table root pointer
@ 2020-04-18 13:47 Sasha Levin
  2020-04-18 13:47 ` [PATCH AUTOSEL 5.6 05/73] iommu/vt-d: Fix page request descriptor size Sasha Levin
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Sasha Levin @ 2020-04-18 13:47 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Sasha Levin, iommu, Joerg Roedel, Adrian Huang

From: Adrian Huang <ahuang12@lenovo.com>

[ 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>
---
 drivers/iommu/amd_iommu_types.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/amd_iommu_types.h b/drivers/iommu/amd_iommu_types.h
index f8d01d6b00da7..ca8c4522045b3 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
-- 
2.20.1

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-04-18 13:49 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-18 13:47 [PATCH AUTOSEL 5.6 01/73] iommu/amd: Fix the configuration of GCR3 table root pointer Sasha Levin
2020-04-18 13:47 ` [PATCH AUTOSEL 5.6 05/73] iommu/vt-d: Fix page request descriptor size Sasha Levin
2020-04-18 13:47 ` [PATCH AUTOSEL 5.6 07/73] iommu/vt-d: Fix mm reference leak Sasha Levin
2020-04-18 13:47 ` [PATCH AUTOSEL 5.6 25/73] dma-direct: fix data truncation in dma_direct_get_required_mask() Sasha Levin
2020-04-18 13:47 ` [PATCH AUTOSEL 5.6 26/73] dma-debug: fix displaying of dma allocation type Sasha Levin
2020-04-18 13:47 ` [PATCH AUTOSEL 5.6 48/73] iommu/virtio: Fix freeing of incomplete domains Sasha Levin
2020-04-18 13:47 ` [PATCH AUTOSEL 5.6 49/73] iommu/vt-d: Add build dependency on IOASID Sasha Levin
2020-04-18 13:47 ` [PATCH AUTOSEL 5.6 51/73] iommu/vt-d: Silence RCU-list debugging warning in dmar_find_atsr() Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).