summaryrefslogtreecommitdiff
path: root/arch/arm64/include/asm/mem_encrypt.h
diff options
context:
space:
mode:
authorWill Deacon <will@kernel.org>2024-08-30 14:01:46 +0100
committerWill Deacon <will@kernel.org>2024-08-30 16:30:41 +0100
commite7bafbf7177750e6643941473b343ed72fc5a100 (patch)
tree2bc8382e382b9a538385346b9e80125d3aca8ec8 /arch/arm64/include/asm/mem_encrypt.h
parenta06c3fad49a50d5d5eb078f93e70f4d3eca5d5a5 (diff)
arm64: mm: Add top-level dispatcher for internal mem_encrypt API
Implementing the internal mem_encrypt API for arm64 depends entirely on the Confidential Computing environment in which the kernel is running. Introduce a simple dispatcher so that backend hooks can be registered depending upon the environment in which the kernel finds itself. Reviewed-by: Catalin Marinas <catalin.marinas@arm.com> Reviewed-by: Steven Price <steven.price@arm.com> Acked-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20240830130150.8568-4-will@kernel.org Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'arch/arm64/include/asm/mem_encrypt.h')
-rw-r--r--arch/arm64/include/asm/mem_encrypt.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/mem_encrypt.h b/arch/arm64/include/asm/mem_encrypt.h
new file mode 100644
index 000000000000..b0c9a86b13a4
--- /dev/null
+++ b/arch/arm64/include/asm/mem_encrypt.h
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef __ASM_MEM_ENCRYPT_H
+#define __ASM_MEM_ENCRYPT_H
+
+struct arm64_mem_crypt_ops {
+ int (*encrypt)(unsigned long addr, int numpages);
+ int (*decrypt)(unsigned long addr, int numpages);
+};
+
+int arm64_mem_crypt_ops_register(const struct arm64_mem_crypt_ops *ops);
+
+int set_memory_encrypted(unsigned long addr, int numpages);
+int set_memory_decrypted(unsigned long addr, int numpages);
+
+#endif /* __ASM_MEM_ENCRYPT_H */