summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/pkeys.h
diff options
context:
space:
mode:
authorThiago Jung Bauermann <bauerman@linux.vnet.ibm.com>2018-01-18 17:50:43 -0800
committerMichael Ellerman <mpe@ellerman.id.au>2018-01-20 22:59:06 +1100
commitc5cc1f4df6b16646f8fae7aab523c1820bf916e8 (patch)
tree83164522643b8dc08f2825b3c7643f88cc74f0b5 /arch/powerpc/include/asm/pkeys.h
parent99cd1302327a2ccaedf905e9f6a8d8fd234bd485 (diff)
downloadlinux-c5cc1f4df6b16646f8fae7aab523c1820bf916e8.tar.bz2
powerpc/ptrace: Add memory protection key regset
The AMR/IAMR/UAMOR are part of the program context. Allow it to be accessed via ptrace and through core files. Signed-off-by: Ram Pai <linuxram@us.ibm.com> Signed-off-by: Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/include/asm/pkeys.h')
-rw-r--r--arch/powerpc/include/asm/pkeys.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/pkeys.h b/arch/powerpc/include/asm/pkeys.h
index 2298771b066b..c3cbad824e5a 100644
--- a/arch/powerpc/include/asm/pkeys.h
+++ b/arch/powerpc/include/asm/pkeys.h
@@ -202,6 +202,11 @@ static inline int arch_set_user_pkey_access(struct task_struct *tsk, int pkey,
return __arch_set_user_pkey_access(tsk, pkey, init_val);
}
+static inline bool arch_pkeys_enabled(void)
+{
+ return !static_branch_likely(&pkey_disabled);
+}
+
extern void pkey_mm_init(struct mm_struct *mm);
extern void thread_pkey_regs_save(struct thread_struct *thread);
extern void thread_pkey_regs_restore(struct thread_struct *new_thread,