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

selftests/powerpc: Run per_event_excludes test on Power8 or later

The per_event_excludes test wants to run on Power8 or later. But
currently it checks that AT_BASE_PLATFORM *equals* power8, which means
it only runs on Power8.

Fix it to check for the ISA 2.07 feature, which will be set on Power8
and later CPUs.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200716122142.3776261-1-mpe@ellerman.id.au

+3 -4
+3 -4
tools/testing/selftests/powerpc/pmu/per_event_excludes.c
··· 12 12 #include <string.h> 13 13 #include <sys/prctl.h> 14 14 15 + #include <asm/cputable.h> 16 + 15 17 #include "event.h" 16 18 #include "lib.h" 17 19 #include "utils.h" ··· 25 23 static int per_event_excludes(void) 26 24 { 27 25 struct event *e, events[4]; 28 - char *platform; 29 26 int i; 30 27 31 - platform = (char *)get_auxv_entry(AT_BASE_PLATFORM); 32 - FAIL_IF(!platform); 33 - SKIP_IF(strcmp(platform, "power8") != 0); 28 + SKIP_IF(!have_hwcap2(PPC_FEATURE2_ARCH_2_07)); 34 29 35 30 /* 36 31 * We need to create the events disabled, otherwise the running/enabled