Re: [PATCH] selftests/powerpc: run eeb tests only on POWER8
From: Denis Kirjanov <hidden>
Date: 2015-10-18 09:21:11
On 10/18/15, Michael Ellerman [off-list ref] wrote:
On Sat, 2015-10-17 at 21:31 +0300, Denis Kirjanov wrote:quoted
Event Based Branches currenly available on POWER8. so we can skip them on other CPUs.Thanks for the patch, but ..quoted
I've found that at least one test loops forever on 970MP (cycles_with_freeze_test).Ooo interesting. The harness should kill it after a timeout.quoted
diff --git a/tools/testing/selftests/powerpc/pmu/ebb/ebb.cb/tools/testing/selftests/powerpc/pmu/ebb/ebb.c index d7a72ce..a252637 100644--- a/tools/testing/selftests/powerpc/pmu/ebb/ebb.c +++ b/tools/testing/selftests/powerpc/pmu/ebb/ebb.c@@ -319,6 +319,19 @@ void ebb_global_disable(void) mb(); } +#define PVR_VER(pvr) (((pvr) >> 16) & 0xFFFF) +bool ebb_is_supported(void) +{ + unsigned long pvr; + + __asm__ __volatile__("mfpvr %0" : "=b"(pvr)); + /* EBB requires at least POWER8 */ + if (PVR_VER(pvr) >= 0x004D) + return true; + + return false; +}The right way to do this is not to look at the PVR but instead look at AT_HWCAP2, and see if it contains PPC_FEATURE2_EBB. You can see an example in tm-syscall.c Can you please respin with that change?
Sure, no problem! Thanks!
cheers