Patch "powerpc/book3s64/hugetlb: Fix disabling hugetlb when fadump is active" has been added to the 6.12-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    powerpc/book3s64/hugetlb: Fix disabling hugetlb when fadump is active

to the 6.12-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     powerpc-book3s64-hugetlb-fix-disabling-hugetlb-when-.patch
and it can be found in the queue-6.12 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 8fa0eb046c88519ace67d0d5555b749b4f309ba4
Author: Sourabh Jain <sourabhjain@xxxxxxxxxxxxx>
Date:   Tue Dec 17 13:16:40 2024 +0530

    powerpc/book3s64/hugetlb: Fix disabling hugetlb when fadump is active
    
    [ Upstream commit d629d7a8efc33d05d62f4805c0ffb44727e3d99f ]
    
    Commit 8597538712eb ("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 2354ad252b66 ("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: 2354ad252b66 ("powerpc/mm: Update default hugetlb size early")
    Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@xxxxxxxxx>
    Signed-off-by: Sourabh Jain <sourabhjain@xxxxxxxxxxxxx>
    Signed-off-by: Madhavan Srinivasan <maddy@xxxxxxxxxxxxx>
    Link: https://patch.msgid.link/20241217074640.1064510-1-sourabhjain@xxxxxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/powerpc/include/asm/hugetlb.h b/arch/powerpc/include/asm/hugetlb.h
index 18a3028ac3b6d..dad2e7980f245 100644
--- a/arch/powerpc/include/asm/hugetlb.h
+++ b/arch/powerpc/include/asm/hugetlb.h
@@ -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,




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux