Skip to content

Commit 7e51586

Browse files
jgunthorpejoergroedel
authored andcommitted
iommu/amd: Correct the reported page sizes from the V1 table
The HW only has 52 bits of physical address support, the supported page sizes should not have bits set beyond this. Further the spec says that the 6th level does not support any "default page size for translation entries" meaning leafs in the 6th level are not allowed too. Rework the definition to use GENMASK to build the range of supported pages from the top of physical to 4k. Nothing ever uses such large pages, so this is a cosmetic/documentation improvement only. Reported-by: Joao Martins <[email protected]> Reviewed-by: Vasant Hegde <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent c435209 commit 7e51586

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/iommu/amd/amd_iommu_types.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,9 @@
290290
* that we support.
291291
*
292292
* 512GB Pages are not supported due to a hardware bug
293+
* Page sizes >= the 52 bit max physical address of the CPU are not supported.
293294
*/
294-
#define AMD_IOMMU_PGSIZES ((~0xFFFUL) & ~(2ULL << 38))
295+
#define AMD_IOMMU_PGSIZES (GENMASK_ULL(51, 12) ^ SZ_512G)
295296
/* 4K, 2MB, 1G page sizes are supported */
296297
#define AMD_IOMMU_PGSIZES_V2 (PAGE_SIZE | (1ULL << 21) | (1ULL << 30))
297298

0 commit comments

Comments
 (0)