Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+6
+3
tools/testing/selftests/powerpc/security/rfi_flush.c
··· 89 89 90 90 SKIP_IF(geteuid() != 0); 91 91 92 + // The PMU event we use only works on Power7 or later 93 + SKIP_IF(!have_hwcap(PPC_FEATURE_ARCH_2_06)); 94 + 92 95 if (read_debugfs_file("powerpc/rfi_flush", &rfi_flush_org)) { 93 96 perror("Unable to read powerpc/rfi_flush debugfs file"); 94 97 SKIP_IF(1);
+3
tools/testing/selftests/powerpc/security/spectre_v2.c
··· 134 134 s64 miss_percent; 135 135 bool is_p9; 136 136 137 + // The PMU events we use only work on Power8 or later 138 + SKIP_IF(!have_hwcap2(PPC_FEATURE2_ARCH_2_07)); 139 + 137 140 state = get_sysfs_state(); 138 141 if (state == UNKNOWN) { 139 142 printf("Error: couldn't determine spectre_v2 mitigation state?\n");