diff options
author | Benjamin Gray <bgray@linux.ibm.com> | 2024-04-17 14:23:22 +0300 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2024-05-06 15:05:17 +0300 |
commit | 9930fba02a1c587849aea1e6c5688168013c065f (patch) | |
tree | b0ef06f670a0ba8c11253d6db58cad1ccd7375c0 /tools/testing/selftests/powerpc | |
parent | 5bfa66bf86d792bbcc76bc09cf99a2ae9d6e0eec (diff) | |
download | linux-9930fba02a1c587849aea1e6c5688168013c065f.tar.xz |
selftests/powerpc/dexcr: Attempt to enable NPHIE in hashchk selftest
Now that a process can control its DEXCR to some extent, make the
hashchk tests more reliable by explicitly setting the local and onexec
NPHIE aspect.
Signed-off-by: Benjamin Gray <bgray@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20240417112325.728010-7-bgray@linux.ibm.com
Diffstat (limited to 'tools/testing/selftests/powerpc')
-rw-r--r-- | tools/testing/selftests/powerpc/dexcr/hashchk_test.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/testing/selftests/powerpc/dexcr/hashchk_test.c b/tools/testing/selftests/powerpc/dexcr/hashchk_test.c index 7d5658c9ebe4..645224bdc142 100644 --- a/tools/testing/selftests/powerpc/dexcr/hashchk_test.c +++ b/tools/testing/selftests/powerpc/dexcr/hashchk_test.c @@ -21,8 +21,14 @@ static int require_nphie(void) { SKIP_IF_MSG(!dexcr_exists(), "DEXCR not supported"); + + pr_set_dexcr(PR_PPC_DEXCR_NPHIE, PR_PPC_DEXCR_CTRL_SET | PR_PPC_DEXCR_CTRL_SET_ONEXEC); + + if (get_dexcr(EFFECTIVE) & DEXCR_PR_NPHIE) + return 0; + SKIP_IF_MSG(!(get_dexcr(EFFECTIVE) & DEXCR_PR_NPHIE), - "DEXCR[NPHIE] not enabled"); + "Failed to enable DEXCR[NPHIE]"); return 0; } |