Home
last modified time | relevance | path

Searched refs:pkey (Results 1 – 13 of 13) sorted by relevance

/arch/powerpc/include/asm/
Dpkeys.h33 static inline u64 pkey_to_vmflag_bits(u16 pkey) in pkey_to_vmflag_bits() argument
35 return (((u64)pkey << VM_PKEY_SHIFT) & ARCH_VM_PKEY_FLAGS); in pkey_to_vmflag_bits()
50 #define pkey_alloc_mask(pkey) (0x1 << pkey) argument
54 #define __mm_pkey_allocated(mm, pkey) { \ argument
55 mm_pkey_allocation_map(mm) |= pkey_alloc_mask(pkey); \
58 #define __mm_pkey_free(mm, pkey) { \ argument
59 mm_pkey_allocation_map(mm) &= ~pkey_alloc_mask(pkey); \
62 #define __mm_pkey_is_allocated(mm, pkey) \ argument
63 (mm_pkey_allocation_map(mm) & pkey_alloc_mask(pkey))
65 #define __mm_pkey_is_reserved(pkey) (reserved_allocation_mask & \ argument
[all …]
Dmman.h17 unsigned long pkey) in arch_calc_vm_prot_bits() argument
20 return (((prot & PROT_SAO) ? VM_SAO : 0) | pkey_to_vmflag_bits(pkey)); in arch_calc_vm_prot_bits()
25 #define arch_calc_vm_prot_bits(prot, pkey) arch_calc_vm_prot_bits(prot, pkey) argument
/arch/x86/include/asm/
Dpkeys.h14 extern int arch_set_user_pkey_access(struct task_struct *tsk, int pkey,
36 int prot, int pkey);
38 int prot, int pkey) in arch_override_mprotect_pkey() argument
43 return __arch_override_mprotect_pkey(vma, prot, pkey); in arch_override_mprotect_pkey()
46 extern int __arch_set_user_pkey_access(struct task_struct *tsk, int pkey,
52 #define mm_set_pkey_allocated(mm, pkey) do { \ argument
53 mm_pkey_allocation_map(mm) |= (1U << pkey); \
55 #define mm_set_pkey_free(mm, pkey) do { \ argument
56 mm_pkey_allocation_map(mm) &= ~(1U << pkey); \
60 bool mm_pkey_is_allocated(struct mm_struct *mm, int pkey) in mm_pkey_is_allocated() argument
[all …]
Dpgtable.h1373 static inline bool __pkru_allows_read(u32 pkru, u16 pkey) in __pkru_allows_read() argument
1375 int pkru_pkey_bits = pkey * PKRU_BITS_PER_PKEY; in __pkru_allows_read()
1379 static inline bool __pkru_allows_write(u32 pkru, u16 pkey) in __pkru_allows_write() argument
1381 int pkru_pkey_bits = pkey * PKRU_BITS_PER_PKEY; in __pkru_allows_write()
1399 static inline bool __pkru_allows_pkey(u16 pkey, bool write) in __pkru_allows_pkey() argument
1403 if (!__pkru_allows_read(pkru, pkey)) in __pkru_allows_pkey()
1405 if (write && !__pkru_allows_write(pkru, pkey)) in __pkru_allows_pkey()
/arch/powerpc/mm/book3s64/
Dpkeys.c44 #define pkeyshift(pkey) (PKEY_REG_BITS - ((pkey+1) * AMR_BITS_PER_PKEY)) argument
260 static inline void init_amr(int pkey, u8 init_bits) in init_amr() argument
262 u64 new_amr_bits = (((u64)init_bits & 0x3UL) << pkeyshift(pkey)); in init_amr()
263 u64 old_amr = read_amr() & ~((u64)(0x3ul) << pkeyshift(pkey)); in init_amr()
268 static inline void init_iamr(int pkey, u8 init_bits) in init_iamr() argument
270 u64 new_iamr_bits = (((u64)init_bits & 0x1UL) << pkeyshift(pkey)); in init_iamr()
271 u64 old_iamr = read_iamr() & ~((u64)(0x1ul) << pkeyshift(pkey)); in init_iamr()
280 int __arch_set_user_pkey_access(struct task_struct *tsk, int pkey, in __arch_set_user_pkey_access() argument
290 pkey_bits = 0x3ul << pkeyshift(pkey); in __arch_set_user_pkey_access()
304 init_iamr(pkey, new_iamr_bits); in __arch_set_user_pkey_access()
[all …]
/arch/x86/mm/
Dpkeys.c76 int __arch_override_mprotect_pkey(struct vm_area_struct *vma, int prot, int pkey) in __arch_override_mprotect_pkey() argument
82 if (pkey != -1) in __arch_override_mprotect_pkey()
83 return pkey; in __arch_override_mprotect_pkey()
92 pkey = execute_only_pkey(vma->vm_mm); in __arch_override_mprotect_pkey()
93 if (pkey > 0) in __arch_override_mprotect_pkey()
94 return pkey; in __arch_override_mprotect_pkey()
113 #define PKRU_AD_KEY(pkey) (PKRU_AD_BIT << ((pkey) * PKRU_BITS_PER_PKEY)) argument
Dfault.c801 unsigned long address, u32 pkey, int si_code) in __bad_area_nosemaphore() argument
836 force_sig_pkuerr((void __user *)address, pkey); in __bad_area_nosemaphore()
860 unsigned long address, u32 pkey, int si_code) in __bad_area() argument
869 __bad_area_nosemaphore(regs, error_code, address, pkey, si_code); in __bad_area()
925 u32 pkey = vma_pkey(vma); in bad_area_access_error() local
927 __bad_area(regs, error_code, address, pkey, SEGV_PKUERR); in bad_area_access_error()
/arch/arm64/include/asm/
Dmman.h10 unsigned long pkey __always_unused) in arch_calc_vm_prot_bits()
22 #define arch_calc_vm_prot_bits(prot, pkey) arch_calc_vm_prot_bits(prot, pkey) argument
/arch/powerpc/mm/
Dfault.c94 int pkey; in bad_access_pkey() local
113 pkey = vma_pkey(vma); in bad_access_pkey()
125 _exception_pkey(regs, address, pkey); in bad_access_pkey()
/arch/sparc/include/asm/
Dmman.h30 #define arch_calc_vm_prot_bits(prot, pkey) sparc_calc_vm_prot_bits(prot) argument
/arch/s390/crypto/
Dpaes_s390.c141 struct pkey_protkey pkey; in __paes_convert_key() local
143 if (__paes_keyblob2pkey(&ctx->kb, &pkey)) in __paes_convert_key()
147 memcpy(&ctx->pk, &pkey, sizeof(pkey)); in __paes_convert_key()
/arch/s390/include/uapi/asm/
Dpkey.h443 __u8 __user *pkey; /* in: pkey blob buffer space ptr */ member
/arch/x86/kernel/fpu/
Dxstate.c1037 int arch_set_user_pkey_access(struct task_struct *tsk, int pkey, in arch_set_user_pkey_access() argument
1041 int pkey_shift = (pkey * PKRU_BITS_PER_PKEY); in arch_set_user_pkey_access()
1056 WARN_ON_ONCE(pkey >= arch_max_pkey()); in arch_set_user_pkey_access()