Skip to content

Commit 2a2848e

Browse files
Anshuman Khandualctmarinas
authored andcommitted
arm64/mm: Compute PTRS_PER_[PMD|PUD] independently of PTRS_PER_PTE
Possible page table entries (or pointers) on non-zero page table levels are dependent on a single page size i.e PAGE_SIZE and size required for each individual page table entry i.e 8 bytes. PTRS_PER_[PMD|PUD] as such are not related to PTRS_PER_PTE in any manner, as being implied currently. So lets just make this very explicit and compute these macros independently. Cc: Will Deacon <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Anshuman Khandual <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent b2d229d commit 2a2848e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/arm64/include/asm/pgtable-hwdef.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
#define PMD_SHIFT ARM64_HW_PGTABLE_LEVEL_SHIFT(2)
5050
#define PMD_SIZE (_AC(1, UL) << PMD_SHIFT)
5151
#define PMD_MASK (~(PMD_SIZE-1))
52-
#define PTRS_PER_PMD PTRS_PER_PTE
52+
#define PTRS_PER_PMD (1 << (PAGE_SHIFT - 3))
5353
#endif
5454

5555
/*
@@ -59,7 +59,7 @@
5959
#define PUD_SHIFT ARM64_HW_PGTABLE_LEVEL_SHIFT(1)
6060
#define PUD_SIZE (_AC(1, UL) << PUD_SHIFT)
6161
#define PUD_MASK (~(PUD_SIZE-1))
62-
#define PTRS_PER_PUD PTRS_PER_PTE
62+
#define PTRS_PER_PUD (1 << (PAGE_SHIFT - 3))
6363
#endif
6464

6565
/*

0 commit comments

Comments
 (0)