Skip to content

arm64: MTE swap and hibernation support

Steven Price linux-arch linux-arm-kernel linux-mm 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4mm: Add PG_ARCH_2 page flagfs/proc/page.c include/linux/kernel-page-flags.h include/linux/page-flags.h +3 more+20 -10 replies
2/4mm: Add arch hooks for saving/restoring tagsinclude/asm-generic/pgtable.h mm/page_io.c mm/shmem.c +1 more+37 -03 replies
3/4arm64: mte: Enable swap of tagged pagesarch/arm64/Kconfig arch/arm64/include/asm/mte.h arch/arm64/include/asm/pgtable.h +3 more+200 -24 replies
4/4arm64: mte: Save tags when hibernatingarch/arm64/kernel/hibernate.c+116 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] arm64: MTE swap and hibernation support

This adds support for swapping and hibernation with MTE tagged memory. It's based on Catalin's v3 series[1].

To support swap, a new page flag is added which tracks whether a page has been mapped into user space with MTE enabled (and therefore may have valid data in the tags). Arch hooks are added to enable the saving/restoring of these tags (in memory) when the pages are swapped out.

Hibernation builds on the swap support by simply copying the tags out of hardware tag storage into normal memory before the hibernation image is created. On restore the tags are returned to the hardware tag storage.

Feedback on the approach is welcomed.

[1] https://lore.kernel.org/linux-arm-kernel/[email protected]/

Steven Price (4):
mm: Add PG_ARCH_2 page flag
mm: Add arch hooks for saving/restoring tags
arm64: mte: Enable swap of tagged pages
arm64: mte: Save tags when hibernating

 arch/arm64/Kconfig                |   2 +-
 arch/arm64/include/asm/mte.h      |   6 ++
 arch/arm64/include/asm/pgtable.h  |  44 ++++++++++++
 arch/arm64/kernel/hibernate.c     | 116 ++++++++++++++++++++++++++++++
 arch/arm64/lib/mte.S              |  50 +++++++++++++
 arch/arm64/mm/Makefile            |   2 +-
 arch/arm64/mm/mteswap.c           |  98 +++++++++++++++++++++++++
 fs/proc/page.c                    |   3 +
 include/asm-generic/pgtable.h     |  23 ++++++
 include/linux/kernel-page-flags.h |   1 +
 include/linux/page-flags.h        |   3 +
 include/trace/events/mmflags.h    |   9 ++-
 mm/Kconfig                        |   3 +
 mm/page_io.c                      |   6 ++
 mm/shmem.c                        |   6 ++
 mm/swapfile.c                     |   2 +
 tools/vm/page-types.c             |   2 +
 17 files changed, 373 insertions(+), 3 deletions(-)
 create mode 100644 arch/arm64/mm/mteswap.c
Signature · 1 line
2.20.1