linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Russell Currey <ruscur@russell.cc>
To: Michael Ellerman <mpe@ellerman.id.au>, linuxppc-dev@lists.ozlabs.org
Cc: mikey@neuling.org
Subject: Re: [PATCH v2] powerpc: Add POWER9 architected mode to cputable
Date: Fri, 17 Feb 2017 23:06:53 +1100	[thread overview]
Message-ID: <1487333213.11368.2.camel@russell.cc> (raw)
In-Reply-To: <87y3x5i04k.fsf@concordia.ellerman.id.au>

On Fri, 2017-02-17 at 21:26 +1100, Michael Ellerman wrote:
> Russell Currey <ruscur@russell.cc> writes:
> 
> > diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
> > index 6a82ef039c50..d23a54b09436 100644
> > --- a/arch/powerpc/kernel/cputable.c
> > +++ b/arch/powerpc/kernel/cputable.c
> > @@ -386,6 +386,25 @@ static struct cpu_spec __initdata cpu_specs[] = {
> >  		.machine_check_early	=
> > __machine_check_early_realmode_p8,
> >  		.platform		= "power8",
> >  	},
> > +	{	/* 3.00-compliant processor, i.e. Power9 "architected"
> > mode */
> > +		.pvr_mask		= 0xffffffff,
> > +		.pvr_value		= 0x0f000005,
> > +		.cpu_name		= "POWER9 (architected)",
> > +		.cpu_features		= CPU_FTRS_POWER9,
> > +		.cpu_user_features	= COMMON_USER_POWER9,
> > +		.cpu_user_features2	= COMMON_USER2_POWER9,
> > +		.mmu_features		= MMU_FTRS_POWER9,
> > +		.icache_bsize		= 128,
> > +		.dcache_bsize		= 128,
> > +		.num_pmcs		= 6,
> 
> It's important *not* to set num_pmcs for the architected PVRs.
> 
> See the comment in setup_cpu_spec():
> 
> 	/*
> 	 * If we are overriding a previous value derived from the real
> 	 * PVR with a new value obtained using a logical PVR value,
> 	 * don't modify the performance monitor fields.
> 	 */
> 	if (old.num_pmcs && !s->num_pmcs) {
> 		t->num_pmcs = old.num_pmcs;
> 		t->pmc_type = old.pmc_type;
> 
> I realise that having that requirement in the code is serious foot gun
> material on our part, but c'est la vie.
> 
> The reason we do that is there's no "compat mode" for the PMU. So if you
> boot on a Power9, and then the logical PVR says "actually pretend you're
> on a Power8", we flip most of the cpu_spec to have the Power8 values,
> but *not* the PMU fields. That way the Power9 PMU code will still detect
> that it's on a Power9 and work correctly.
> 
> Possibly now that oprofile is more or less dead we can rip all that crap
> out, and have perf just look at the PVR directly.

Oh and also, do you want me to respin or are you happy to drop it on your end?

- Russell

> 
> cheers

  parent reply	other threads:[~2017-02-17 12:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-17  2:01 [PATCH v2] powerpc: Add POWER9 architected mode to cputable Russell Currey
2017-02-17  8:05 ` Daniel Axtens
2017-02-17 10:11   ` Michael Ellerman
2017-02-17 10:26 ` Michael Ellerman
2017-02-17 12:05   ` Russell Currey
2017-02-17 12:06   ` Russell Currey [this message]
2017-02-18  7:54     ` Michael Ellerman
2017-02-19 11:33 ` [v2] " Michael Ellerman

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=1487333213.11368.2.camel@russell.cc \
    --to=ruscur@russell.cc \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mikey@neuling.org \
    --cc=mpe@ellerman.id.au \
    /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;
as well as URLs for NNTP newsgroup(s).