]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
arm64: mm: __ptep_set_access_flags must hint correct TTL
authorRyan Roberts <ryan.roberts@arm.com>
Mon, 23 Mar 2026 16:39:16 +0000 (16:39 +0000)
committerCatalin Marinas <catalin.marinas@arm.com>
Wed, 25 Mar 2026 18:08:13 +0000 (18:08 +0000)
commitb7d9d2e3a8ab535ff3bc8e9156a917bb8934f856
tree06598168d06e2e24ee6380652b420065568ae8d6
parent752a0d1d483e9479f5c59519256fd190139d0b39
arm64: mm: __ptep_set_access_flags must hint correct TTL

It has been reported that since commit 752a0d1d483e9 ("arm64: mm:
Provide level hint for flush_tlb_page()"), the arm64
check_hugetlb_options selftest has been locking up while running "Check
child hugetlb memory with private mapping, sync error mode and mmap
memory".

This is due to hugetlb (and THP) helpers casting their PMD/PUD entries
to PTE and calling __ptep_set_access_flags(), which issues a
__flush_tlb_page(). Now that this is hinted for level 3, in this case,
the TLB entry does not get evicted and we end up in a spurious fault
loop.

Fix this by creating a __ptep_set_access_flags_anysz() function which
takes the pgsize of the entry. It can then add the appropriate hint. The
"_anysz" approach is the established pattern for problems of this class.

Reported-by: Aishwarya TCV <Aishwarya.TCV@arm.com>
Fixes: 752a0d1d483e ("arm64: mm: Provide level hint for flush_tlb_page()")
Signed-off-by: Ryan Roberts <ryan.roberts@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/include/asm/pgtable.h
arch/arm64/mm/fault.c
arch/arm64/mm/hugetlbpage.c