]> git.ipfire.org Git - thirdparty/linux.git/commit
mm: hugetlb: Add huge page size param to huge_ptep_get_and_clear()
authorRyan Roberts <ryan.roberts@arm.com>
Wed, 26 Feb 2025 12:06:51 +0000 (12:06 +0000)
committerWill Deacon <will@kernel.org>
Thu, 27 Feb 2025 17:40:57 +0000 (17:40 +0000)
commit02410ac72ac3707936c07ede66e94360d0d65319
treeaaf419134bd855f292f69d0037c8f5ac7b151fd9
parent2b1283e1ea9b5e0b06f075f79391a51d9f70749b
mm: hugetlb: Add huge page size param to huge_ptep_get_and_clear()

In order to fix a bug, arm64 needs to be told the size of the huge page
for which the huge_pte is being cleared in huge_ptep_get_and_clear().
Provide for this by adding an `unsigned long sz` parameter to the
function. This follows the same pattern as huge_pte_clear() and
set_huge_pte_at().

This commit makes the required interface modifications to the core mm as
well as all arches that implement this function (arm64, loongarch, mips,
parisc, powerpc, riscv, s390, sparc). The actual arm64 bug will be fixed
in a separate commit.

Cc: stable@vger.kernel.org
Fixes: 66b3923a1a0f ("arm64: hugetlb: add support for PTE contiguous bit")
Acked-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com> # riscv
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
Signed-off-by: Ryan Roberts <ryan.roberts@arm.com>
Acked-by: Alexander Gordeev <agordeev@linux.ibm.com> # s390
Link: https://lore.kernel.org/r/20250226120656.2400136-2-ryan.roberts@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
16 files changed:
arch/arm64/include/asm/hugetlb.h
arch/arm64/mm/hugetlbpage.c
arch/loongarch/include/asm/hugetlb.h
arch/mips/include/asm/hugetlb.h
arch/parisc/include/asm/hugetlb.h
arch/parisc/mm/hugetlbpage.c
arch/powerpc/include/asm/hugetlb.h
arch/riscv/include/asm/hugetlb.h
arch/riscv/mm/hugetlbpage.c
arch/s390/include/asm/hugetlb.h
arch/s390/mm/hugetlbpage.c
arch/sparc/include/asm/hugetlb.h
arch/sparc/mm/hugetlbpage.c
include/asm-generic/hugetlb.h
include/linux/hugetlb.h
mm/hugetlb.c