Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/6] Fix incorrect access of hugetlb pte entries
@ 2026-07-03 11:41 Dev Jain
  2026-07-03 11:41 ` [PATCH v3 1/6] arm64: make huge_ptep_get handled unaligned addresses Dev Jain
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Dev Jain @ 2026-07-03 11:41 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, apopple, rcampbell, ziy, matthew.brost,
	joshua.hahnjy, rakie.kim, byungchul, gourry, ying.huang, ak,
	nao.horiguchi, mel, j-nomura, pfalcato, tglx, dave.hansen,
	jpoimboe, 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.

---
v2->v3:
 - Place comment at appropriate place in patches 2 and 3
 - Modify indentation in patch 2, patch 6

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     |  2 ++
 mm/migrate.c                |  6 +++++-
 mm/mprotect.c               | 12 +++++++++---
 mm/page_vma_mapped.c        |  8 +++++++-
 mm/rmap.c                   | 32 ++++++++++++++++++++------------
 6 files changed, 44 insertions(+), 18 deletions(-)

-- 
2.43.0



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

end of thread, other threads:[~2026-07-03 11:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-03 11:41 [PATCH v3 0/6] Fix incorrect access of hugetlb pte entries Dev Jain
2026-07-03 11:41 ` [PATCH v3 1/6] arm64: make huge_ptep_get handled unaligned addresses Dev Jain
2026-07-03 11:41 ` [PATCH v3 2/6] mm/rmap: use huge_ptep_get() in try_to_unmap_one() Dev Jain
2026-07-03 11:41 ` [PATCH v3 3/6] mm/rmap: use huge_ptep_get() in try_to_migrate_one() Dev Jain
2026-07-03 11:41 ` [PATCH v3 4/6] mm/migrate: use huge_ptep_get() in remove_migration_pte() Dev Jain
2026-07-03 11:41 ` [PATCH v3 5/6] mm/page_vma_mapped: use huge_ptep_get() for hugetlb Dev Jain
2026-07-03 11:41 ` [PATCH v3 6/6] mm/mprotect: " Dev Jain

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