mm: Add arch hooks for saving/restoring tags
authorSteven Price <steven.price@arm.com>
Wed, 13 May 2020 15:37:49 +0000 (16:37 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Fri, 4 Sep 2020 11:46:07 +0000 (12:46 +0100)
commit8a84802e2a2b1a682761a31c2685506b9f4e1840
treef1833efdf37bde1c4281f9864c38d2f53810a2c3
parentd563d678aa0be06e7bff2953c986f5ff0355f79c
mm: Add arch hooks for saving/restoring tags

Arm's Memory Tagging Extension (MTE) adds some metadata (tags) to
every physical page, when swapping pages out to disk it is necessary to
save these tags, and later restore them when reading the pages back.

Add some hooks along with dummy implementations to enable the
arch code to handle this.

Three new hooks are added to the swap code:
 * arch_prepare_to_swap() and
 * arch_swap_invalidate_page() / arch_swap_invalidate_area().
One new hook is added to shmem:
 * arch_swap_restore()

Signed-off-by: Steven Price <steven.price@arm.com>
[catalin.marinas@arm.com: add unlock_page() on the error path]
[catalin.marinas@arm.com: dropped the _tags suffix]
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/pgtable.h
mm/page_io.c
mm/shmem.c
mm/swapfile.c