Skip to content

Commit

Permalink
iommu/amd: Fix the configuration of GCR3 table root pointer
Browse files Browse the repository at this point in the history
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: 52815b7 ("iommu/amd: Add support for IOMMUv2 domain mode")
Signed-off-by: Joerg Roedel <jroedel@suse.de>
  • Loading branch information
Adrian Huang authored and Joerg Roedel committed Feb 28, 2020
1 parent f8788d8 commit c20f365
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/iommu/amd_iommu_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c20f365

Please sign in to comment.