linux/arch/riscv/mm
Ryan Roberts c04035ce80 mm: hugetlb: Add huge page size param to huge_ptep_get_and_clear()
commit 02410ac72a upstream.

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: 66b3923a1a ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2025-03-13 12:58:38 +01:00
..
cache-ops.c riscv: split cache ops out of dma-noncoherent.c 2023-11-28 17:19:49 +00:00
cacheflush.c riscv: implement the new page table range API 2023-08-24 16:20:23 -07:00
context.c membarrier: riscv: Add full memory barrier in switch_mm() 2024-09-12 11:11:45 +02:00
dma-noncoherent.c riscv: split cache ops out of dma-noncoherent.c 2023-11-28 17:19:49 +00:00
extable.c riscv: extable: fix err reg writing in dedicated uaccess handler 2022-02-08 17:02:47 -08:00
fault.c riscv: Use accessors to page table entries instead of direct dereference 2024-09-12 11:11:40 +02:00
hugetlbpage.c mm: hugetlb: Add huge page size param to huge_ptep_get_and_clear() 2025-03-13 12:58:38 +01:00
init.c riscv: mm: Fix the out of bound issue of vmemmap address 2025-01-17 13:36:17 +01:00
kasan_init.c riscv: Use accessors to page table entries instead of direct dereference 2024-09-12 11:11:40 +02:00
Makefile riscv: mm: Only compile pgtable.c if MMU 2024-09-12 11:11:40 +02:00
pageattr.c riscv: Use accessors to page table entries instead of direct dereference 2024-09-12 11:11:40 +02:00
pgtable.c riscv: Use accessors to page table entries instead of direct dereference 2024-09-12 11:11:40 +02:00
physaddr.c riscv: Use PUD/P4D/PGD pages for the linear mapping 2023-04-18 20:43:04 -07:00
pmem.c riscv: mm: dma-noncoherent: nonstandard cache operations support 2023-09-01 09:08:57 -07:00
ptdump.c riscv: correct pt_level name via pgtable_l5/4_enabled 2023-11-28 17:20:13 +00:00
tlbflush.c riscv: Apply SiFive CIP-1200 workaround to single-ASID sfence.vma 2024-07-11 12:49:06 +02:00