LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: Denis Kirjanov <kda@linux-powerpc.org>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [PATCH] selftests/powerpc: run eeb tests only on POWER8
Date: Sun, 18 Oct 2015 20:17:31 +1100	[thread overview]
Message-ID: <1445159851.4271.1.camel@ellerman.id.au> (raw)
In-Reply-To: <1445106671-5028-1-git-send-email-kda@linux-powerpc.org>

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

  reply	other threads:[~2015-10-18  9:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-17 18:31 [PATCH] selftests/powerpc: run eeb tests only on POWER8 Denis Kirjanov
2015-10-18  9:17 ` Michael Ellerman [this message]
2015-10-18  9:21   ` Denis Kirjanov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1445159851.4271.1.camel@ellerman.id.au \
    --to=mpe@ellerman.id.au \
    --cc=kda@linux-powerpc.org \
    --cc=linuxppc-dev@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox