aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/powerpc/ptrace/ptrace-pkey.c
diff options
context:
space:
mode:
authorSandipan Das <sandipan@linux.ibm.com>2020-06-04 18:26:08 +0530
committerMichael Ellerman <mpe@ellerman.id.au>2020-06-30 14:37:47 +1000
commit828ca4320d130bbe1d12866152600c49ff6a9f79 (patch)
tree19669711fd35c984590e4e6cb434cdbf11474ff8 /tools/testing/selftests/powerpc/ptrace/ptrace-pkey.c
parentpowerpc/8xx: Modify ptep_get() (diff)
downloadlinux-dev-828ca4320d130bbe1d12866152600c49ff6a9f79.tar.xz
linux-dev-828ca4320d130bbe1d12866152600c49ff6a9f79.zip
selftests/powerpc: Fix pkey access right updates
The Power ISA mandates that all writes to the Authority Mask Register (AMR) must always be preceded as well as succeeded by a context synchronizing instruction. This makes sure that the tests follow this requirement when attempting to update a pkey's access rights. Signed-off-by: Sandipan Das <sandipan@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20200604125610.649668-2-sandipan@linux.ibm.com
Diffstat (limited to '')
-rw-r--r--tools/testing/selftests/powerpc/ptrace/ptrace-pkey.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/powerpc/ptrace/ptrace-pkey.c b/tools/testing/selftests/powerpc/ptrace/ptrace-pkey.c
index bdbbbe8431e0..904c04f8c919 100644
--- a/tools/testing/selftests/powerpc/ptrace/ptrace-pkey.c
+++ b/tools/testing/selftests/powerpc/ptrace/ptrace-pkey.c
@@ -126,7 +126,7 @@ static int child(struct shared_info *info)
printf("%-30s AMR: %016lx pkey1: %d pkey2: %d pkey3: %d\n",
user_write, info->amr1, pkey1, pkey2, pkey3);
- mtspr(SPRN_AMR, info->amr1);
+ set_amr(info->amr1);
/* Wait for parent to read our AMR value and write a new one. */
ret = prod_parent(&info->child_sync);