Skip to content

Commit 9d1ebe9

Browse files
committed
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
1 parent 482b9b3 commit 9d1ebe9

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

‎tools/testing/selftests/powerpc/pmu/per_event_excludes.c‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
#include <string.h>
1313
#include <sys/prctl.h>
1414

15+
#include <asm/cputable.h>
16+
1517
#include "event.h"
1618
#include "lib.h"
1719
#include "utils.h"
@@ -23,12 +25,9 @@
2325
static int per_event_excludes(void)
2426
{
2527
struct event *e, events[4];
26-
char *platform;
2728
int i;
2829

29-
platform = (char *)get_auxv_entry(AT_BASE_PLATFORM);
30-
FAIL_IF(!platform);
31-
SKIP_IF(strcmp(platform, "power8") != 0);
30+
SKIP_IF(!have_hwcap2(PPC_FEATURE2_ARCH_2_07));
3231

3332
/*
3433
* We need to create the events disabled, otherwise the running/enabled

0 commit comments

Comments
 (0)