Skip to content

Commit d629d7a

Browse files
sourabhjainsmaddy-kerneldev
authored andcommitted
powerpc/book3s64/hugetlb: Fix disabling hugetlb when fadump is active
Commit 8597538 ("powerpc/fadump: Do not use hugepages when fadump is active") disabled hugetlb support when fadump is active by returning early from hugetlbpage_init():arch/powerpc/mm/hugetlbpage.c and not populating hpage_shift/HPAGE_SHIFT. Later, commit 2354ad2 ("powerpc/mm: Update default hugetlb size early") moved the allocation of hpage_shift/HPAGE_SHIFT to early boot, which inadvertently re-enabled hugetlb support when fadump is active. Fix this by implementing hugepages_supported() on powerpc. This ensures that disabling hugetlb for the fadump kernel is independent of hpage_shift/HPAGE_SHIFT. Fixes: 2354ad2 ("powerpc/mm: Update default hugetlb size early") Reviewed-by: Ritesh Harjani (IBM) <[email protected]> Signed-off-by: Sourabh Jain <[email protected]> Signed-off-by: Madhavan Srinivasan <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent 9fa9712 commit d629d7a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

arch/powerpc/include/asm/hugetlb.h

+9
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@
1515

1616
extern bool hugetlb_disabled;
1717

18+
static inline bool hugepages_supported(void)
19+
{
20+
if (hugetlb_disabled)
21+
return false;
22+
23+
return HPAGE_SHIFT != 0;
24+
}
25+
#define hugepages_supported hugepages_supported
26+
1827
void __init hugetlbpage_init_defaultsize(void);
1928

2029
int slice_is_hugepage_only_range(struct mm_struct *mm, unsigned long addr,

0 commit comments

Comments
 (0)