Lines Matching refs:info
69 static int child(struct shared_info *info) in child() argument
77 ret = wait_parent(&info->child_sync); in child()
85 CHILD_FAIL_IF(pkey1 < 0, &info->child_sync); in child()
91 CHILD_FAIL_IF(pkey2 < 0, &info->child_sync); in child()
94 CHILD_FAIL_IF(pkey3 < 0, &info->child_sync); in child()
96 info->amr1 |= 3ul << pkeyshift(pkey1); in child()
97 info->amr2 |= 3ul << pkeyshift(pkey2); in child()
102 info->invalid_amr = info->amr2 | (~0x0UL & ~info->expected_uamor); in child()
108 info->expected_iamr |= 1ul << pkeyshift(pkey1); in child()
110 info->expected_iamr &= ~(1ul << pkeyshift(pkey1)); in child()
115 info->expected_iamr &= ~(1ul << pkeyshift(pkey2)); in child()
116 info->expected_iamr &= ~(1ul << pkeyshift(pkey3)); in child()
122 info->invalid_iamr = info->expected_iamr | (1ul << pkeyshift(pkey1) | 1ul << pkeyshift(pkey2)); in child()
123 info->invalid_uamor = info->expected_uamor & ~(0x3ul << pkeyshift(pkey1)); in child()
126 user_write, info->amr1, pkey1, pkey2, pkey3); in child()
128 set_amr(info->amr1); in child()
131 ret = prod_parent(&info->child_sync); in child()
132 CHILD_FAIL_IF(ret, &info->child_sync); in child()
134 ret = wait_parent(&info->child_sync); in child()
142 CHILD_FAIL_IF(reg != info->amr2, &info->child_sync); in child()
147 ret = prod_parent(&info->child_sync); in child()
148 CHILD_FAIL_IF(ret, &info->child_sync); in child()
150 ret = wait_parent(&info->child_sync); in child()
158 CHILD_FAIL_IF(reg != info->amr2, &info->child_sync); in child()
164 ret = prod_parent(&info->child_sync); in child()
165 CHILD_FAIL_IF(ret, &info->child_sync); in child()
167 ret = wait_parent(&info->child_sync); in child()
175 CHILD_FAIL_IF(reg != info->amr2, &info->child_sync); in child()
179 ret = prod_parent(&info->child_sync); in child()
180 CHILD_FAIL_IF(ret, &info->child_sync); in child()
185 static int parent(struct shared_info *info, pid_t pid) in parent() argument
195 PARENT_SKIP_IF_UNSUPPORTED(ret, &info->child_sync, "PKEYs not supported"); in parent()
196 PARENT_FAIL_IF(ret, &info->child_sync); in parent()
198 info->amr1 = info->amr2 = regs[0]; in parent()
199 info->expected_iamr = regs[1]; in parent()
200 info->expected_uamor = regs[2]; in parent()
203 ret = prod_child(&info->child_sync); in parent()
204 PARENT_FAIL_IF(ret, &info->child_sync); in parent()
206 ret = wait_child(&info->child_sync); in parent()
212 PARENT_FAIL_IF(ret, &info->child_sync); in parent()
217 PARENT_FAIL_IF(regs[0] != info->amr1, &info->child_sync); in parent()
218 PARENT_FAIL_IF(regs[1] != info->expected_iamr, &info->child_sync); in parent()
219 PARENT_FAIL_IF(regs[2] != info->expected_uamor, &info->child_sync); in parent()
222 ret = ptrace_write_regs(pid, NT_PPC_PKEY, &info->amr2, 1); in parent()
223 PARENT_FAIL_IF(ret, &info->child_sync); in parent()
225 printf("%-30s AMR: %016lx\n", ptrace_write_running, info->amr2); in parent()
228 ret = prod_child(&info->child_sync); in parent()
229 PARENT_FAIL_IF(ret, &info->child_sync); in parent()
231 ret = wait_child(&info->child_sync); in parent()
236 ret = ptrace_write_regs(pid, NT_PPC_PKEY, &info->invalid_amr, 1); in parent()
237 PARENT_FAIL_IF(ret, &info->child_sync); in parent()
239 printf("%-30s AMR: %016lx\n", ptrace_write_running, info->invalid_amr); in parent()
242 ret = prod_child(&info->child_sync); in parent()
243 PARENT_FAIL_IF(ret, &info->child_sync); in parent()
245 ret = wait_child(&info->child_sync); in parent()
250 regs[0] = info->amr1; in parent()
251 regs[1] = info->invalid_iamr; in parent()
253 PARENT_FAIL_IF(!ret, &info->child_sync); in parent()
259 regs[2] = info->invalid_uamor; in parent()
261 PARENT_FAIL_IF(!ret, &info->child_sync); in parent()
268 PARENT_FAIL_IF(ret, &info->child_sync); in parent()
273 PARENT_FAIL_IF(regs[0] != info->amr2, &info->child_sync); in parent()
274 PARENT_FAIL_IF(regs[1] != info->expected_iamr, &info->child_sync); in parent()
275 PARENT_FAIL_IF(regs[2] != info->expected_uamor, &info->child_sync); in parent()
278 ret = prod_child(&info->child_sync); in parent()
279 PARENT_FAIL_IF(ret, &info->child_sync); in parent()
296 struct shared_info *info; in ptrace_pkey() local
301 shm_id = shmget(IPC_PRIVATE, sizeof(*info), 0777 | IPC_CREAT); in ptrace_pkey()
302 info = shmat(shm_id, NULL, 0); in ptrace_pkey()
304 ret = init_child_sync(&info->child_sync); in ptrace_pkey()
313 ret = child(info); in ptrace_pkey()
315 ret = parent(info, pid); in ptrace_pkey()
317 shmdt(info); in ptrace_pkey()
320 destroy_child_sync(&info->child_sync); in ptrace_pkey()