public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Alistair Popple <alistair@popple•id.au>
To: linuxppc-dev@lists•ozlabs.org
Cc: aneesh.kumar@linux•ibm.com, mikey@neuling•org,
	"Paul A. Clarke" <pc@us•ibm.com>,
	npiggin@gmail•com
Subject: Re: [PATCH v2 6/7] powerpc/dt_cpu_ftrs: Add MMA feature
Date: Wed, 20 May 2020 09:56:23 +1000	[thread overview]
Message-ID: <26076686.W3figiy1un@townsend> (raw)
In-Reply-To: <20200519175153.GE24922@oc3272150783.ibm.com>

Thanks, not sure where I got that name from but it's probably wrong in a few 
places. Will wait a bit in case there are any more comments and then respin 
the series to update the name.

- Alistair

On Wednesday, 20 May 2020 3:51:53 AM AEST Paul A. Clarke wrote:
> On Tue, May 19, 2020 at 10:31:56AM +1000, Alistair Popple wrote:
> > Matrix multiple accumulate (MMA) is a new feature added to ISAv3.1 and
> 
> Conclusion is that this should be "Matrix-Multiply Assist", but then there
> are a couple more below...
> 
> > POWER10. Support on powernv can be selected via a firmware CPU device
> > tree feature which enables it via a PCR bit.
> > 
> > Signed-off-by: Alistair Popple <alistair@popple•id.au>
> > ---
> > 
> >  arch/powerpc/include/asm/reg.h    |  3 ++-
> >  arch/powerpc/kernel/dt_cpu_ftrs.c | 17 ++++++++++++++++-
> >  2 files changed, 18 insertions(+), 2 deletions(-)
> > 
> > diff --git a/arch/powerpc/include/asm/reg.h
> > b/arch/powerpc/include/asm/reg.h index 1931b1142599..c446863a40cf 100644
> > --- a/arch/powerpc/include/asm/reg.h
> > +++ b/arch/powerpc/include/asm/reg.h
> > @@ -479,7 +479,8 @@
> > 
> >  #define   PCR_VEC_DIS	(__MASK(63-0))	/* Vec. disable (bit NA since
> >  POWER8) */ #define   PCR_VSX_DIS	(__MASK(63-1))	/* VSX disable (bit NA
> >  since POWER8) */ #define   PCR_TM_DIS	(__MASK(63-2))	/* Trans. memory
> >  disable (POWER8) */> 
> > -#define   PCR_HIGH_BITS	(PCR_VEC_DIS | PCR_VSX_DIS | PCR_TM_DIS)
> > +#define   PCR_MMA_DIS	(__MASK(63-3)) /* Matrix-Multiply Accelerator */
> 
> also here.
> 
> > +#define   PCR_HIGH_BITS	(PCR_MMA_DIS | PCR_VEC_DIS | PCR_VSX_DIS |
> > PCR_TM_DIS)> 
> >  /*
> >  
> >   * These bits are used in the function kvmppc_set_arch_compat() to
> >   specify and * determine both the compatibility level which we want to
> >   emulate and the> 
> > diff --git a/arch/powerpc/kernel/dt_cpu_ftrs.c
> > b/arch/powerpc/kernel/dt_cpu_ftrs.c index 93c340906aad..e7540ee5cad8
> > 100644
> > --- a/arch/powerpc/kernel/dt_cpu_ftrs.c
> > +++ b/arch/powerpc/kernel/dt_cpu_ftrs.c
> > @@ -75,6 +75,7 @@ static struct {
> > 
> >  	u64	lpcr_clear;
> >  	u64	hfscr;
> >  	u64	fscr;
> > 
> > +	u64	pcr;
> > 
> >  } system_registers;
> >  
> >  static void (*init_pmu_registers)(void);
> > 
> > @@ -102,7 +103,7 @@ static void __restore_cpu_cpufeatures(void)
> > 
> >  	if (hv_mode) {
> >  	
> >  		mtspr(SPRN_LPID, 0);
> >  		mtspr(SPRN_HFSCR, system_registers.hfscr);
> > 
> > -		mtspr(SPRN_PCR, PCR_MASK);
> > +		mtspr(SPRN_PCR, system_registers.pcr);
> > 
> >  	}
> >  	mtspr(SPRN_FSCR, system_registers.fscr);
> > 
> > @@ -555,6 +556,18 @@ static int __init feat_enable_large_ci(struct
> > dt_cpu_feature *f)> 
> >  	return 1;
> >  
> >  }
> > 
> > +static int __init feat_enable_mma(struct dt_cpu_feature *f)
> > +{
> > +	u64 pcr;
> > +
> > +	feat_enable(f);
> > +	pcr = mfspr(SPRN_PCR);
> > +	pcr &= ~PCR_MMA_DIS;
> > +	mtspr(SPRN_PCR, pcr);
> > +
> > +	return 1;
> > +}
> > +
> > 
> >  struct dt_cpu_feature_match {
> >  
> >  	const char *name;
> >  	int (*enable)(struct dt_cpu_feature *f);
> > 
> > @@ -629,6 +642,7 @@ static struct dt_cpu_feature_match __initdata
> > 
> >  	{"vector-binary16", feat_enable, 0},
> >  	{"wait-v3", feat_enable, 0},
> >  	{"prefix-instructions", feat_enable, 0},
> > 
> > +	{"matrix-multiply-accumulate", feat_enable_mma, 0},
> 
> and presumably here as well.
> 
> >  };
> 
> PC





  reply	other threads:[~2020-05-19 23:58 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-19  0:31 [PATCH v2 0/7] Base support for POWER10 Alistair Popple
2020-05-19  0:31 ` [PATCH v2 1/7] powerpc: Add new HWCAP bits Alistair Popple
2020-05-19  3:20   ` Michael Neuling
2020-05-19 17:48   ` Paul A. Clarke
2020-05-20  2:42   ` Michael Ellerman
2020-05-20  3:29     ` Alistair Popple
2020-05-19  0:31 ` [PATCH v2 2/7] powerpc: Add support for ISA v3.1 Alistair Popple
2020-05-19  4:04   ` Jordan Niethe
2020-05-19  5:45     ` Alistair Popple
2020-05-19  0:31 ` [PATCH v2 3/7] powerpc/dt_cpu_ftrs: Advertise support for ISA v3.1 if selected Alistair Popple
2020-05-19  0:31 ` [PATCH v2 4/7] powerpc/dt_cpu_ftrs: Set current thread fscr bits Alistair Popple
2020-05-19  0:31 ` [PATCH v2 5/7] powerpc/dt_cpu_ftrs: Enable Prefixed Instructions Alistair Popple
2020-05-19  0:31 ` [PATCH v2 6/7] powerpc/dt_cpu_ftrs: Add MMA feature Alistair Popple
2020-05-19 14:49   ` Paul A. Clarke
2020-05-19 15:05     ` Segher Boessenkool
2020-05-19 15:22       ` Paul A. Clarke
2020-05-19 15:28         ` Segher Boessenkool
2020-05-19 15:49           ` Paul A. Clarke
2020-05-19 17:51   ` Paul A. Clarke
2020-05-19 23:56     ` Alistair Popple [this message]
2020-05-19  0:31 ` [PATCH v2 7/7] powerpc: Add POWER10 architected mode Alistair Popple
2020-05-19  3:58   ` Jordan Niethe

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=26076686.W3figiy1un@townsend \
    --to=alistair@popple$(echo .)id.au \
    --cc=aneesh.kumar@linux$(echo .)ibm.com \
    --cc=linuxppc-dev@lists$(echo .)ozlabs.org \
    --cc=mikey@neuling$(echo .)org \
    --cc=npiggin@gmail$(echo .)com \
    --cc=pc@us$(echo .)ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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