Skip to content

arm64: improve efficiency of setting tags for user pages

Peter Collingbourne linux-arm-kernel linux-mm 6 versions – Applied

Status from this message: Applied to arm64 (for-next/mte), thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest4 patches 4 repliesApplied 4/4
  2. v54 patches 2 repliesSuperseded
  3. v44 patches 3 repliesSuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v33 patches10 repliesSuperseded
v23 patches3 repliesSuperseded
v13 patches2 repliesSuperseded

Patches in v6 All 4 applied

#Subject and filesSizeRepliesApplied
1/4mm: arch: remove indirection level in alloc_zeroed_user_highpage_movable()arch/alpha/include/asm/page.h arch/arm64/include/asm/page.h arch/ia64/include/asm/page.h +4 more+26 -451 replyApplied
2/4kasan: use separate (un)poison implementation for integrated initinclude/linux/kasan.h mm/kasan/common.c mm/kasan/hw_tags.c +2 more+95 -560 repliesApplied
3/4arm64: mte: handle tags zeroing at page allocation timearch/arm64/include/asm/mte.h arch/arm64/include/asm/page.h arch/arm64/lib/mte.S +6 more+96 -110 repliesApplied
4/4kasan: disable freed user page poisoning with HW tagsinclude/linux/gfp.h include/linux/page-flags.h include/trace/events/mmflags.h +2 more+37 -90 repliesApplied

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchAndrey KonovalovCatalin Marinas
1/4A-b
2/4R-b
3/4R-b R-b
4/4R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v6 thread

Cover letter [PATCH v6 0/4] arm64: improve efficiency of setting tags for user pages

Currently we can end up touching PROT_MTE user pages twice on fault and once on unmap. On fault, with KASAN disabled we first clear data and then set tags to 0, and with KASAN enabled we simultaneously clear data and set tags to the KASAN random tag, and then set tags again to 0. On unmap, we poison the page by setting tags, but this is less likely to find a bug than poisoning kernel pages.

This patch series fixes these inefficiencies by only touching the pages once on fault using the DC GZVA instruction to clear both data and tags, and avoiding poisoning user pages on free.

Peter Collingbourne (4):
mm: arch: remove indirection level in
alloc_zeroed_user_highpage_movable()
kasan: use separate (un)poison implementation for integrated init
arm64: mte: handle tags zeroing at page allocation time
kasan: disable freed user page poisoning with HW tags

 arch/alpha/include/asm/page.h   |  6 +--
 arch/arm64/include/asm/mte.h    |  4 ++
 arch/arm64/include/asm/page.h   | 10 +++--
 arch/arm64/lib/mte.S            | 20 ++++++++++
 arch/arm64/mm/fault.c           | 26 +++++++++++++
 arch/arm64/mm/proc.S            | 10 +++--
 arch/ia64/include/asm/page.h    |  6 +--
 arch/m68k/include/asm/page_no.h |  6 +--
 arch/s390/include/asm/page.h    |  6 +--
 arch/x86/include/asm/page.h     |  6 +--
 include/linux/gfp.h             | 18 +++++++--
 include/linux/highmem.h         | 43 ++++++++-------------
 include/linux/kasan.h           | 64 +++++++++++++++++++-------------
 include/linux/page-flags.h      |  9 +++++
 include/trace/events/mmflags.h  |  9 ++++-
 mm/kasan/common.c               |  4 +-
 mm/kasan/hw_tags.c              | 32 ++++++++++++++++
 mm/mempool.c                    |  6 ++-
 mm/page_alloc.c                 | 66 +++++++++++++++++++--------------
 19 files changed, 242 insertions(+), 109 deletions(-)
Signature · 1 line
2.32.0.rc1.229.g3e70b5a671-goog