arm64/mm: Add uffd write-protect support
authorRyan Roberts <ryan.roberts@arm.com>
Fri, 3 May 2024 14:46:02 +0000 (15:46 +0100)
committerWill Deacon <will@kernel.org>
Fri, 3 May 2024 16:03:34 +0000 (17:03 +0100)
commit5b32510af77bdb275b022dc0d6d5b9c61751065b
treef5fc8042da04609208f79cfabd81773e0cc8ee96
parent55564814a838f1d2429dc757294df798f5262bd2
arm64/mm: Add uffd write-protect support

Let's use the newly-free PTE SW bit (58) to add support for uffd-wp.

The standard handlers are implemented for set/test/clear for both pte
and pmd. Additionally we must also track the uffd-wp state as a pte swp
bit, so use a free swap pte bit (3).

Acked-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Ryan Roberts <ryan.roberts@arm.com>
Link: https://lore.kernel.org/r/20240503144604.151095-5-ryan.roberts@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/Kconfig
arch/arm64/include/asm/pgtable-prot.h
arch/arm64/include/asm/pgtable.h