aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/kup.h
diff options
context:
space:
mode:
authorChristophe Leroy <christophe.leroy@c-s.fr>2019-04-18 16:51:18 +1000
committerMichael Ellerman <mpe@ellerman.id.au>2019-04-21 23:05:54 +1000
commit69795cabe4cfe5122438d50010ad5310c113a013 (patch)
tree1a6f463d544b6ce25276c05558123d3614a7b6db /arch/powerpc/include/asm/kup.h
parentpowerpc/powernv/idle: Restore AMR/UAMOR/AMOR after idle (diff)
downloadlinux-dev-69795cabe4cfe5122438d50010ad5310c113a013.tar.xz
linux-dev-69795cabe4cfe5122438d50010ad5310c113a013.zip
powerpc: Add framework for Kernel Userspace Protection
This patch adds a skeleton for Kernel Userspace Protection functionnalities like Kernel Userspace Access Protection and Kernel Userspace Execution Prevention The subsequent implementation of KUAP for radix makes use of a MMU feature in order to patch out assembly when KUAP is disabled or unsupported. This won't work unless there's an entry point for KUP support before the feature magic happens, so for PPC64 setup_kup() is called early in setup. On PPC32, feature_fixup() is done too early to allow the same. Suggested-by: Russell Currey <ruscur@russell.cc> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/include/asm/kup.h')
-rw-r--r--arch/powerpc/include/asm/kup.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/kup.h b/arch/powerpc/include/asm/kup.h
new file mode 100644
index 000000000000..7a88b8b9b54d
--- /dev/null
+++ b/arch/powerpc/include/asm/kup.h
@@ -0,0 +1,11 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _ASM_POWERPC_KUP_H_
+#define _ASM_POWERPC_KUP_H_
+
+#ifndef __ASSEMBLY__
+
+void setup_kup(void);
+
+#endif /* !__ASSEMBLY__ */
+
+#endif /* _ASM_POWERPC_KUP_H_ */