powerpc/book3s64/hugetlb: Fix disabling hugetlb when fadump is active
BugLink: https://bugs.launchpad.net/bugs/2111953 [ Upstream commit d629d7a8efc33d05d62f4805c0ffb44727e3d99f ] Commit8597538712("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, commit2354ad252b("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:2354ad252b("powerpc/mm: Update default hugetlb size early") Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com> Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/20241217074640.1064510-1-sourabhjain@linux.ibm.com Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Manuel Diewald <manuel.diewald@canonical.com> Signed-off-by: Mehmet Basaran <mehmet.basaran@canonical.com>
This commit is contained in:
committed by
Mehmet Basaran
parent
0288b8650f
commit
fece2dd4ca
@@ -15,6 +15,15 @@
|
||||
|
||||
extern bool hugetlb_disabled;
|
||||
|
||||
static inline bool hugepages_supported(void)
|
||||
{
|
||||
if (hugetlb_disabled)
|
||||
return false;
|
||||
|
||||
return HPAGE_SHIFT != 0;
|
||||
}
|
||||
#define hugepages_supported hugepages_supported
|
||||
|
||||
void __init hugetlbpage_init_defaultsize(void);
|
||||
|
||||
int slice_is_hugepage_only_range(struct mm_struct *mm, unsigned long addr,
|
||||
|
||||
Reference in New Issue
Block a user