aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/arch/powerpc/mm/hugetlbpage.c
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2021-12-02 00:41:50 +1000
committerMichael Ellerman <mpe@ellerman.id.au>2021-12-09 22:40:24 +1100
commitdebeda017189e40bff23d1c3d2e4567ca8541aed (patch)
treef82896f7267656ea2448eb43fbca485a18d2901f /arch/powerpc/mm/hugetlbpage.c
parentpowerpc/64s: Fix radix MMU when MMU_FTR_HPTE_TABLE is clear (diff)
downloadwireguard-linux-debeda017189e40bff23d1c3d2e4567ca8541aed.tar.xz
wireguard-linux-debeda017189e40bff23d1c3d2e4567ca8541aed.zip
powerpc/64s: Always define arch unmapped area calls
To avoid any functional changes to radix paths when building with hash MMU support disabled (and CONFIG_PPC_MM_SLICES=n), always define the arch get_unmapped_area calls on 64s platforms. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20211201144153.2456614-16-npiggin@gmail.com
Diffstat (limited to 'arch/powerpc/mm/hugetlbpage.c')
-rw-r--r--arch/powerpc/mm/hugetlbpage.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
index 82d8b368ca6d..ddead41e2194 100644
--- a/arch/powerpc/mm/hugetlbpage.c
+++ b/arch/powerpc/mm/hugetlbpage.c
@@ -542,20 +542,26 @@ retry:
return page;
}
-#ifdef CONFIG_PPC_MM_SLICES
+#ifdef HAVE_ARCH_HUGETLB_UNMAPPED_AREA
+static inline int file_to_psize(struct file *file)
+{
+ struct hstate *hstate = hstate_file(file);
+ return shift_to_mmu_psize(huge_page_shift(hstate));
+}
+
unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
unsigned long len, unsigned long pgoff,
unsigned long flags)
{
- struct hstate *hstate = hstate_file(file);
- int mmu_psize = shift_to_mmu_psize(huge_page_shift(hstate));
-
#ifdef CONFIG_PPC_RADIX_MMU
if (radix_enabled())
return radix__hugetlb_get_unmapped_area(file, addr, len,
pgoff, flags);
#endif
- return slice_get_unmapped_area(addr, len, flags, mmu_psize, 1);
+#ifdef CONFIG_PPC_MM_SLICES
+ return slice_get_unmapped_area(addr, len, flags, file_to_psize(file), 1);
+#endif
+ BUG();
}
#endif