Skip to content

Commit 50a175d

Browse files
chleroympe
authored andcommitted
powerpc/hugetlb: Fix 8M hugepages on 8xx
With HW assistance all page tables must be 4k aligned, the 8xx drops the last 12 bits during the walk. Redefine HUGEPD_SHIFT_MASK to mask last 12 bits out. HUGEPD_SHIFT_MASK is used to for alignment of page table cache. Fixes: 22569b8 ("powerpc/8xx: Enable 8M hugepage support with HW assistance") Cc: [email protected] # v5.0+ Signed-off-by: Christophe Leroy <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/778b1a248c4c7ca79640eeff7740044da6a220a0.1581264115.git.christophe.leroy@c-s.fr
1 parent f2b67ef commit 50a175d

File tree

1 file changed

+5
-0
lines changed
  • arch/powerpc/include/asm

1 file changed

+5
-0
lines changed

arch/powerpc/include/asm/page.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,13 @@ static inline bool pfn_valid(unsigned long pfn)
295295
/*
296296
* Some number of bits at the level of the page table that points to
297297
* a hugepte are used to encode the size. This masks those bits.
298+
* On 8xx, HW assistance requires 4k alignment for the hugepte.
298299
*/
300+
#ifdef CONFIG_PPC_8xx
301+
#define HUGEPD_SHIFT_MASK 0xfff
302+
#else
299303
#define HUGEPD_SHIFT_MASK 0x3f
304+
#endif
300305

301306
#ifndef __ASSEMBLY__
302307

0 commit comments

Comments
 (0)