Skip to content

Commit c20f365

Browse files
Adrian Huangjoergroedel
authored andcommitted
iommu/amd: Fix the configuration of GCR3 table root pointer
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 <[email protected]> Fixes: 52815b7 ("iommu/amd: Add support for IOMMUv2 domain mode") Signed-off-by: Joerg Roedel <[email protected]>
1 parent f8788d8 commit c20f365

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/iommu/amd_iommu_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@
348348

349349
#define DTE_GCR3_VAL_A(x) (((x) >> 12) & 0x00007ULL)
350350
#define DTE_GCR3_VAL_B(x) (((x) >> 15) & 0x0ffffULL)
351-
#define DTE_GCR3_VAL_C(x) (((x) >> 31) & 0xfffffULL)
351+
#define DTE_GCR3_VAL_C(x) (((x) >> 31) & 0x1fffffULL)
352352

353353
#define DTE_GCR3_INDEX_A 0
354354
#define DTE_GCR3_INDEX_B 1

0 commit comments

Comments
 (0)