blob: 72440eef73aa001ad615762db30460c1ab131a1d [file] [log] [blame]
From 42bc851f7d694ea48ac7b26d011a2beda082d8c7 Mon Sep 17 00:00:00 2001
From: Christophe Leroy <>
Date: Sun, 9 Feb 2020 16:02:41 +0000
Subject: [PATCH] powerpc/hugetlb: Fix 8M hugepages on 8xx
commit 50a175dd18de7a647e72aca7daf4744e3a5a81e3 upstream.
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: 22569b881d37 ("powerpc/8xx: Enable 8M hugepage support with HW assistance")
Cc: # v5.0+
Signed-off-by: Christophe Leroy <>
Signed-off-by: Michael Ellerman <>
Signed-off-by: Paul Gortmaker <>
diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h
index 0d52f57fca04..f3e5b3c73432 100644
--- a/arch/powerpc/include/asm/page.h
+++ b/arch/powerpc/include/asm/page.h
@@ -285,8 +285,13 @@ static inline bool pfn_valid(unsigned long pfn)
* Some number of bits at the level of the page table that points to
* a hugepte are used to encode the size. This masks those bits.
+ * On 8xx, HW assistance requires 4k alignment for the hugepte.
+#ifdef CONFIG_PPC_8xx
+#define HUGEPD_SHIFT_MASK 0xfff
#define HUGEPD_SHIFT_MASK 0x3f
#ifndef __ASSEMBLY__