diff options
author | Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com> | 2018-01-18 17:50:43 -0800 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2018-01-20 22:59:06 +1100 |
commit | c5cc1f4df6b16646f8fae7aab523c1820bf916e8 (patch) | |
tree | 83164522643b8dc08f2825b3c7643f88cc74f0b5 /arch/powerpc/include | |
parent | 99cd1302327a2ccaedf905e9f6a8d8fd234bd485 (diff) | |
download | op-kernel-dev-c5cc1f4df6b16646f8fae7aab523c1820bf916e8.zip op-kernel-dev-c5cc1f4df6b16646f8fae7aab523c1820bf916e8.tar.gz |
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')
-rw-r--r-- | arch/powerpc/include/asm/pkeys.h | 5 | ||||
-rw-r--r-- | arch/powerpc/include/uapi/asm/elf.h | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/pkeys.h b/arch/powerpc/include/asm/pkeys.h index 2298771..c3cbad8 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, diff --git a/arch/powerpc/include/uapi/asm/elf.h b/arch/powerpc/include/uapi/asm/elf.h index 5f201d4..860c592 100644 --- a/arch/powerpc/include/uapi/asm/elf.h +++ b/arch/powerpc/include/uapi/asm/elf.h @@ -97,6 +97,7 @@ #define ELF_NTMSPRREG 3 /* include tfhar, tfiar, texasr */ #define ELF_NEBB 3 /* includes ebbrr, ebbhr, bescr */ #define ELF_NPMU 5 /* includes siar, sdar, sier, mmcr2, mmcr0 */ +#define ELF_NPKEY 3 /* includes amr, iamr, uamor */ typedef unsigned long elf_greg_t64; typedef elf_greg_t64 elf_gregset_t64[ELF_NGREG]; |