[PATCH] selftests/powerpc: run eeb tests only on POWER8

Michael Ellerman mpe at ellerman.id.au
Sun Oct 18 20:17:31 AEDT 2015


On Sat, 2015-10-17 at 21:31 +0300, Denis Kirjanov wrote:

> Event Based Branches currenly available on POWER8.
> so we can skip them on other CPUs.

Thanks for the patch, but ..

> 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.

> diff --git a/tools/testing/selftests/powerpc/pmu/ebb/ebb.c b/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?

cheers



More information about the Linuxppc-dev mailing list