diff options
author | Christophe Leroy <christophe.leroy@c-s.fr> | 2019-03-11 09:30:31 +0100 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2019-04-21 15:11:46 +0200 |
commit | e2fb9f5444312fd01627c84a3e018c1fe8ac6ebb (patch) | |
tree | d199c5ba49c2e30fff0d9722a4522b28c5f6959f /arch/powerpc/include/asm/kup.h | |
parent | powerpc/32: Remove MSR_PR test when returning from syscall (diff) | |
download | linux-e2fb9f5444312fd01627c84a3e018c1fe8ac6ebb.tar.xz linux-e2fb9f5444312fd01627c84a3e018c1fe8ac6ebb.zip |
powerpc/32: Prepare for Kernel Userspace Access Protection
This patch adds ASM macros for saving, restoring and checking
the KUAP state, and modifies setup_32 to call them on exceptions
from kernel.
The macros are defined as empty by default for when CONFIG_PPC_KUAP
is not selected and/or for platforms which don't handle (yet) KUAP.
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.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/arch/powerpc/include/asm/kup.h b/arch/powerpc/include/asm/kup.h index 28ad4654eed2..7d8ad3d6729d 100644 --- a/arch/powerpc/include/asm/kup.h +++ b/arch/powerpc/include/asm/kup.h @@ -6,7 +6,20 @@ #include <asm/book3s/64/kup-radix.h> #endif -#ifndef __ASSEMBLY__ +#ifdef __ASSEMBLY__ +#ifndef CONFIG_PPC_KUAP +.macro kuap_save_and_lock sp, thread, gpr1, gpr2, gpr3 +.endm + +.macro kuap_restore sp, current, gpr1, gpr2, gpr3 +.endm + +.macro kuap_check current, gpr +.endm + +#endif + +#else /* !__ASSEMBLY__ */ #include <asm/pgtable.h> |