Skip to content

Commit 87def77

Browse files
committed
powerpc/mm/64s: Restrict THP to Radix or HPT w/64K pages
Transparent hugepages (THP) are not supported when using the Hash Page Table (HPT) MMU with 4K pages. Currently a HPT-only 4K kernel still allows THP to be enabled, which is misleading. Add restrictions to the PPC_THP symbol so that if the kernel is configured with 4K pages and only the HPT MMU (no Radix), then THP is disabled. Note that it's still possible to build a combined Radix/HPT kernel with 4K pages, which does allow THP to be enabled at build time. As such the HPT code still needs to provide some THP related symbols, to allow the build to succeed, but those code paths are never run. See the stubs in arch/powerpc/include/asm/book3s/64/hash-4k.h. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/20240823032911.1238471-2-mpe@ellerman.id.au
1 parent f61d413 commit 87def77

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

arch/powerpc/platforms/Kconfig.cputype

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ endchoice
108108
config PPC_THP
109109
def_bool y
110110
depends on PPC_BOOK3S_64
111+
depends on PPC_RADIX_MMU || (PPC_64S_HASH_MMU && PAGE_SIZE_64KB)
111112
select HAVE_ARCH_TRANSPARENT_HUGEPAGE
112113
select HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD
113114
select ARCH_ENABLE_THP_MIGRATION if TRANSPARENT_HUGEPAGE

0 commit comments

Comments
 (0)