arm64: Enable memory encrypt for Realms
authorSuzuki K Poulose <suzuki.poulose@arm.com>
Thu, 17 Oct 2024 13:14:32 +0000 (14:14 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Wed, 23 Oct 2024 09:19:33 +0000 (10:19 +0100)
commit42be24a4178fe51e6f47d91d8621b2f53820f88b
treecccff966fc34df03ac84619547fb31b23a22542b
parent0e9cb5995b2539a332fe65ada6a28a6be55f6e40
arm64: Enable memory encrypt for Realms

Use the memory encryption APIs to trigger a RSI call to request a
transition between protected memory and shared memory (or vice versa)
and updating the kernel's linear map of modified pages to flip the top
bit of the IPA. This requires that block mappings are not used in the
direct map for realm guests.

Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Reviewed-by: Gavin Shan <gshan@redhat.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Co-developed-by: Steven Price <steven.price@arm.com>
Signed-off-by: Steven Price <steven.price@arm.com>
Link: https://lore.kernel.org/r/20241017131434.40935-10-steven.price@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/Kconfig
arch/arm64/include/asm/mem_encrypt.h
arch/arm64/include/asm/pgtable.h
arch/arm64/include/asm/set_memory.h
arch/arm64/kernel/rsi.c
arch/arm64/mm/pageattr.c