aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/kup.h
diff options
context:
space:
mode:
authorChristophe Leroy <christophe.leroy@csgroup.eu>2021-03-12 12:50:48 +0000
committerMichael Ellerman <mpe@ellerman.id.au>2021-03-29 13:22:11 +1100
commitad2d2344771dabc5f0f14d85d5e7d2ddc613f385 (patch)
tree87747558238a0c82274b1f727d9c9f485142c1b7 /arch/powerpc/include/asm/kup.h
parentpowerpc/32s: Move KUEP locking/unlocking in C (diff)
downloadlinux-dev-ad2d2344771dabc5f0f14d85d5e7d2ddc613f385.tar.xz
linux-dev-ad2d2344771dabc5f0f14d85d5e7d2ddc613f385.zip
powerpc/64s: Make kuap_check_amr() and kuap_get_and_check_amr() generic
In preparation of porting powerpc32 to C syscall entry/exit, rename kuap_check_amr() and kuap_get_and_check_amr() as kuap_assert_locked() and kuap_get_and_assert_locked(), and move in the generic asm/kup.h the stub for when CONFIG_PPC_KUAP is not selected. Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> Reviewed-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/f82614d9b17b83abd739aa18fc08811815d0c2e3.1615552867.git.christophe.leroy@csgroup.eu
Diffstat (limited to 'arch/powerpc/include/asm/kup.h')
-rw-r--r--arch/powerpc/include/asm/kup.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/powerpc/include/asm/kup.h b/arch/powerpc/include/asm/kup.h
index 25671f711ec2..aa5f77459311 100644
--- a/arch/powerpc/include/asm/kup.h
+++ b/arch/powerpc/include/asm/kup.h
@@ -74,7 +74,15 @@ bad_kuap_fault(struct pt_regs *regs, unsigned long address, bool is_write)
return false;
}
-static inline void kuap_check_amr(void) { }
+static inline void kuap_assert_locked(void) { }
+static inline void kuap_save_and_lock(struct pt_regs *regs) { }
+static inline void kuap_user_restore(struct pt_regs *regs) { }
+static inline void kuap_kernel_restore(struct pt_regs *regs, unsigned long amr) { }
+
+static inline unsigned long kuap_get_and_assert_locked(void)
+{
+ return 0;
+}
/*
* book3s/64/kup-radix.h defines these functions for the !KUAP case to flush