Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/6] Fix incorrect access of hugetlb pte entries
@ 2026-07-02  5:13 Dev Jain
  2026-07-02  5:13 ` [PATCH v2 1/6] arm64: make huge_ptep_get handled unaligned addresses Dev Jain
                   ` (5 more replies)
  0 siblings, 6 replies; 21+ messages in thread
From: Dev Jain @ 2026-07-02  5:13 UTC (permalink / raw)
  To: muchun.song, osalvador, akpm, ljs, david, liam
  Cc: Dev Jain, riel, vbabka, harry, jannh, lance.yang, kas, linux-mm,
	linux-kernel, rcampbell, apopple, ziy, matthew.brost,
	joshua.hahnjy, rakie.kim, byungchul, gourry, ying.huang, j-nomura,
	nao.horiguchi, ak, mel, pfalcato, jpoimboe, dave.hansen, tglx,
	catalin.marinas, will, linux-arm-kernel, ryan.roberts,
	anshuman.khandual

There are various places which use ptep_get() to get the pte entry
corresponding to a hugetlb folio. Some arches (like s390) have special
handling to compute the pteval, so they provide huge_ptep_get(). Use this
helper consistently.

Additionally, some code paths may provide huge_ptep_get with an unaligned
address. This is a problem on arm64 (I checked other arches and it looks
fine for them), which is fixed in patch 1. The fix is made to be
backport-friendly: the cleaner fix would be to perhaps pass the hstate
to huge_ptep_get() - that is wider churn and we can do that later.

---
v1->v2:
 - Add patch 1
 - Mention s390 in cover letter

Dev Jain (6):
  arm64: make huge_ptep_get handled unaligned addresses
  mm/rmap: use huge_ptep_get() in try_to_unmap_one()
  mm/rmap: use huge_ptep_get() in try_to_migrate_one()
  mm/migrate: use huge_ptep_get() in remove_migration_pte()
  mm/page_vma_mapped: use huge_ptep_get() for hugetlb
  mm/mprotect: use huge_ptep_get() for hugetlb

 arch/arm64/mm/hugetlbpage.c |  2 +-
 include/linux/hugetlb.h     |  3 +++
 mm/migrate.c                |  6 +++++-
 mm/mprotect.c               |  8 +++++++-
 mm/page_vma_mapped.c        |  8 +++++++-
 mm/rmap.c                   | 32 ++++++++++++++++++++------------
 6 files changed, 43 insertions(+), 16 deletions(-)

-- 
2.43.0



^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2026-07-02 15:47 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-02  5:13 [PATCH v2 0/6] Fix incorrect access of hugetlb pte entries Dev Jain
2026-07-02  5:13 ` [PATCH v2 1/6] arm64: make huge_ptep_get handled unaligned addresses Dev Jain
2026-07-02 15:28   ` David Hildenbrand (Arm)
2026-07-02  5:13 ` [PATCH v2 2/6] mm/rmap: use huge_ptep_get() in try_to_unmap_one() Dev Jain
2026-07-02  8:47   ` Muchun Song
2026-07-02  9:08     ` Dev Jain
2026-07-02  9:35       ` Muchun Song
2026-07-02 15:30         ` David Hildenbrand (Arm)
2026-07-02 15:32   ` David Hildenbrand (Arm)
2026-07-02  5:13 ` [PATCH v2 3/6] mm/rmap: use huge_ptep_get() in try_to_migrate_one() Dev Jain
2026-07-02 15:34   ` David Hildenbrand (Arm)
2026-07-02  5:13 ` [PATCH v2 4/6] mm/migrate: use huge_ptep_get() in remove_migration_pte() Dev Jain
2026-07-02 15:44   ` David Hildenbrand (Arm)
2026-07-02  5:13 ` [PATCH v2 5/6] mm/page_vma_mapped: use huge_ptep_get() for hugetlb Dev Jain
2026-07-02  8:33   ` Muchun Song
2026-07-02 15:44   ` David Hildenbrand (Arm)
2026-07-02  5:13 ` [PATCH v2 6/6] mm/mprotect: " Dev Jain
2026-07-02  5:18   ` Dev Jain
2026-07-02  8:29     ` Muchun Song
2026-07-02  8:30   ` Muchun Song
2026-07-02 15:47   ` David Hildenbrand (Arm)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox