diff options
author | Michael Ellerman <mpe@ellerman.id.au> | 2020-08-19 11:57:24 +1000 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2020-09-08 22:24:05 +1000 |
commit | 3a31518a242dcb262b008d3bb5d4b1cf50cf4026 (patch) | |
tree | d3ae6255ae2d8eb7efa97c0cfb8780f75281889d /tools/testing/selftests/powerpc/security/spectre_v2.c | |
parent | 4c3c3c502575556c4bc1b401235e641863b1bce6 (diff) | |
download | linux-3a31518a242dcb262b008d3bb5d4b1cf50cf4026.tar.gz linux-3a31518a242dcb262b008d3bb5d4b1cf50cf4026.tar.bz2 linux-3a31518a242dcb262b008d3bb5d4b1cf50cf4026.zip |
selftests/powerpc: Skip security tests on older CPUs
Both these tests use PMU events that only work on newer CPUs, so skip
them on older CPUs.
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200819015727.1977134-6-mpe@ellerman.id.au
Diffstat (limited to 'tools/testing/selftests/powerpc/security/spectre_v2.c')
-rw-r--r-- | tools/testing/selftests/powerpc/security/spectre_v2.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/testing/selftests/powerpc/security/spectre_v2.c b/tools/testing/selftests/powerpc/security/spectre_v2.c index c8d82b784102..adc2b7294e5f 100644 --- a/tools/testing/selftests/powerpc/security/spectre_v2.c +++ b/tools/testing/selftests/powerpc/security/spectre_v2.c @@ -134,6 +134,9 @@ int spectre_v2_test(void) s64 miss_percent; bool is_p9; + // The PMU events we use only work on Power8 or later + SKIP_IF(!have_hwcap2(PPC_FEATURE2_ARCH_2_07)); + state = get_sysfs_state(); if (state == UNKNOWN) { printf("Error: couldn't determine spectre_v2 mitigation state?\n"); |