Home
last modified time | relevance | path

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

/tools/testing/selftests/vm/
Dprotection_keys.c177 static u32 hw_pkey_get(int pkey, unsigned long flags) in hw_pkey_get() argument
182 __func__, pkey, flags, 0, 0); in hw_pkey_get()
185 return (u32) get_pkey_bits(pkey_reg, pkey); in hw_pkey_get()
188 static int hw_pkey_set(int pkey, unsigned long rights, unsigned long flags) in hw_pkey_set() argument
198 new_pkey_reg = set_pkey_bits(old_pkey_reg, pkey, rights); in hw_pkey_set()
204 __func__, pkey, rights, flags, 0, __read_pkey_reg(), in hw_pkey_set()
209 void pkey_disable_set(int pkey, int flags) in pkey_disable_set() argument
217 pkey, flags); in pkey_disable_set()
220 pkey_rights = hw_pkey_get(pkey, syscall_flags); in pkey_disable_set()
223 pkey, pkey, pkey_rights); in pkey_disable_set()
[all …]
Dpkey-powerpc.h37 static inline u32 pkey_bit_position(int pkey) in pkey_bit_position() argument
39 return (NR_PKEYS - pkey - 1) * PKEY_BITS_PER_PKEY; in pkey_bit_position()
94 void expect_fault_on_read_execonly_key(void *p1, int pkey) in expect_fault_on_read_execonly_key() argument
108 void *malloc_pkey_with_mprotect_subpage(long size, int prot, u16 pkey) in malloc_pkey_with_mprotect_subpage() argument
114 size, prot, pkey); in malloc_pkey_with_mprotect_subpage()
115 pkey_assert(pkey < NR_PKEYS); in malloc_pkey_with_mprotect_subpage()
125 ret = mprotect_pkey((void *)ptr, PAGE_SIZE, prot, pkey); in malloc_pkey_with_mprotect_subpage()
129 dprintf1("%s() for pkey %d @ %p\n", __func__, pkey, ptr); in malloc_pkey_with_mprotect_subpage()
Dpkey-helpers.h81 void expected_pkey_fault(int pkey);
83 int sys_pkey_free(unsigned long pkey);
85 unsigned long pkey);
98 static inline u64 set_pkey_bits(u64 reg, int pkey, u64 flags) in set_pkey_bits() argument
100 u32 shift = pkey_bit_position(pkey); in set_pkey_bits()
108 static inline u64 get_pkey_bits(u64 reg, int pkey) in get_pkey_bits() argument
110 u32 shift = pkey_bit_position(pkey); in get_pkey_bits()
150 static inline void __pkey_access_allow(int pkey, int do_allow) in __pkey_access_allow() argument
153 int bit = pkey * 2; in __pkey_access_allow()
164 static inline void __pkey_write_allow(int pkey, int do_allow_write) in __pkey_write_allow() argument
[all …]
Dpkey-x86.h122 static inline u32 pkey_bit_position(int pkey) in pkey_bit_position() argument
124 return pkey * PKEY_BITS_PER_PKEY; in pkey_bit_position()
167 void expect_fault_on_read_execonly_key(void *p1, int pkey) in expect_fault_on_read_execonly_key() argument
173 expected_pkey_fault(pkey); in expect_fault_on_read_execonly_key()
176 void *malloc_pkey_with_mprotect_subpage(long size, int prot, u16 pkey) in malloc_pkey_with_mprotect_subpage() argument
/tools/testing/selftests/powerpc/include/
Dpkeys.h52 void pkey_set_rights(int pkey, unsigned long rights) in pkey_set_rights() argument
56 shift = (NR_PKEYS - pkey - 1) * PKEY_BITS_PER_PKEY; in pkey_set_rights()
63 int sys_pkey_mprotect(void *addr, size_t len, int prot, int pkey) in sys_pkey_mprotect() argument
65 return syscall(__NR_pkey_mprotect, addr, len, prot, pkey); in sys_pkey_mprotect()
73 int sys_pkey_free(int pkey) in sys_pkey_free() argument
75 return syscall(__NR_pkey_free, pkey); in sys_pkey_free()
81 int pkey; in pkeys_unsupported() local
88 pkey = sys_pkey_alloc(0, 0); in pkeys_unsupported()
89 SKIP_IF(pkey < 0); in pkeys_unsupported()
90 sys_pkey_free(pkey); in pkeys_unsupported()
/tools/testing/selftests/powerpc/mm/
Dpkey_exec_prot.c106 int pkey, ret, i; in test() local
155 pkey = sys_pkey_alloc(0, rights); in test()
156 FAIL_IF(pkey < 0); in test()
179 FAIL_IF(sys_pkey_mprotect(insns, pgsize, PROT_EXEC, pkey) != 0); in test()
196 FAIL_IF(sys_pkey_mprotect(insns, pgsize, PROT_EXEC, pkey) != 0); in test()
205 fault_pkey = pkey; in test()
216 FAIL_IF(sys_pkey_mprotect(insns, pgsize, PROT_EXEC, pkey) != 0); in test()
217 pkey_set_rights(pkey, rights); in test()
233 FAIL_IF(sys_pkey_mprotect(insns, pgsize, PROT_EXEC, pkey) != 0); in test()
234 pkey_set_rights(pkey, rights); in test()
[all …]
Dpkey_siginfo.c39 int pkey; in segv_handler() local
41 pkey = siginfo_pkey(sinfo); in segv_handler()
56 if (pkey != rest_pkey) { in segv_handler()
86 pkey_set_rights(pkey, 0); in segv_handler()
/tools/testing/selftests/powerpc/ptrace/
DMakefile4 ptrace-tm-spd-vsx ptrace-tm-spr ptrace-hwbreak ptrace-pkey core-pkey \
12 $(OUTPUT)/ptrace-pkey $(OUTPUT)/core-pkey: child.h
13 $(OUTPUT)/ptrace-pkey $(OUTPUT)/core-pkey: LDLIBS += -pthread
D.gitignore14 core-pkey
15 ptrace-pkey
Dcore-pkey.c38 #define pkeyshift(pkey) (PKEY_REG_BITS - ((pkey + 1) * AMR_BITS_PER_PKEY)) argument
69 static int sys_pkey_free(int pkey) in sys_pkey_free() argument
71 return syscall(__NR_pkey_free, pkey); in sys_pkey_free()
Dptrace-pkey.c29 #define pkeyshift(pkey) (PKEY_REG_BITS - ((pkey + 1) * AMR_BITS_PER_PKEY)) argument
/tools/perf/util/
Dbpf-loader.c1252 void *pkey, void *arg);
1364 apply_config_value_for_key(int map_fd, void *pkey, in apply_config_value_for_key() argument
1372 err = bpf_map_update_elem(map_fd, pkey, &_val, BPF_ANY); in apply_config_value_for_key()
1377 err = bpf_map_update_elem(map_fd, pkey, &_val, BPF_ANY); in apply_config_value_for_key()
1382 err = bpf_map_update_elem(map_fd, pkey, &_val, BPF_ANY); in apply_config_value_for_key()
1386 err = bpf_map_update_elem(map_fd, pkey, &val, BPF_ANY); in apply_config_value_for_key()
1399 apply_config_evsel_for_key(const char *name, int map_fd, void *pkey, in apply_config_evsel_for_key() argument
1438 key = *((unsigned int *)pkey); in apply_config_evsel_for_key()
1445 err = bpf_map_update_elem(map_fd, pkey, evt_fd, BPF_ANY); in apply_config_evsel_for_key()
1455 void *pkey, void *arg __maybe_unused) in apply_obj_config_map_for_key() argument
[all …]
/tools/testing/selftests/filesystems/incfs/
Dincfs_test.c3733 EVP_PKEY *pkey = NULL; in create_key() local
3737 pkey = EVP_PKEY_new(); in create_key()
3738 if (!pkey) in create_key()
3749 EVP_PKEY_assign_RSA(pkey, rsa); in create_key()
3752 return pkey; in create_key()
3756 EVP_PKEY_free(pkey); in create_key()
/tools/lib/traceevent/
Devent-parse.c3576 struct tep_event *pkey = &key; in tep_find_event() local
3584 eventptr = bsearch(&pkey, tep->events, tep->nr_events, in tep_find_event()