[Skiboot] [PATCH] core/cpu.c: Add OPAL call to setup Nest MMU

Alistair Popple alistair at popple.id.au
Sat Aug 6 05:47:13 AEST 2016


On Wed, 3 Aug 2016 11:21:01 Balbir Singh wrote:
> On Wed, 2016-08-03 at 03:17 +1000, Alistair Popple wrote:
> > On Tue, 2 Aug 2016 11:15:43 Balbir Singh wrote:
> > > 
> > > On Tue, 2016-08-02 at 06:50 +1000, Alistair Popple wrote:
> > > > 
> > > > POWER9 has an off core MMU called the Nest MMU which allows other
> > > > units within a chip to perform address translations. The context and
> > > > setup for translations is handled by the requesting agents, however
> > > > the Nest MMU does need to know where in system memory the page tables
> > > > are located.
> > > > 
> > > > This patch adds a call to setup the Nest MMU page table pointer on a
> > > > per-chip basis.
> > > > 
> > > > Signed-off-by: Alistair Popple <alistair at popple.id.au>
> > > > ---
> > > >  core/cpu.c                              | 25 ++++++++++++++++++++++++-
> > > >  doc/opal-api/opal-nmmu-set-ptcr-127.txt | 19 +++++++++++++++++++
> > > >  include/opal-api.h                      |  3 ++-
> > > >  3 files changed, 45 insertions(+), 2 deletions(-)
> > > >  create mode 100644 doc/opal-api/opal-nmmu-set-ptcr-127.txt
> > > > 
> > > > diff --git a/core/cpu.c b/core/cpu.c
> > > > index f33ac48..072f6ce 100644
> > > > --- a/core/cpu.c
> > > > +++ b/core/cpu.c
> > > > @@ -30,6 +30,7 @@
> > > >  #include <timebase.h>
> > > >  #include <ccan/str/str.h>
> > > >  #include <ccan/container_of/container_of.h>
> > > > +#include <xscom.h>
> > > >  
> > > >  /* The cpu_threads array is static and indexed by PIR in
> > > >   * order to speed up lookup from asm entry points
> > > > @@ -667,7 +668,7 @@ void cpu_bringup(void)
> > > >  
> > > >  	op_display(OP_LOG, OP_MOD_CPU, 0x0000);
> > > >  
> > > > -	/* Tell everybody to chime in ! */	
> > > > +	/* Tell everybody to chime in ! */
> > > Whitespace cleanups -- split into another patch?
> > Doh. Missed that.
> > 
> > > 
> > > > 
> > > >  	prlog(PR_INFO, "CPU: Calling in all processors...\n");
> > > >  	cpu_secondary_start = 1;
> > > >  	sync();
> > > > @@ -894,3 +895,25 @@ static int64_t opal_reinit_cpus(uint64_t flags)
> > > >  	return rc;
> > > >  }
> > > >  opal_call(OPAL_REINIT_CPUS, opal_reinit_cpus, 1);
> > > > +
> > > > +/*
> > > > + * Setup the the Nest MMU PTCR register for the specified chip id.
> > > -1ULL is special, so the comment needs to mention it?
> > Right, I meant to add that to the documentation but forgot. I will do that.
> > 
> > > 
> > > > 
> > > > + */
> > > > +#define NMMU_CFG_XLAT_CTL_PTCR 0x5012c4b
> > > > +static int64_t opal_nmmu_set_ptcr(uint64_t chip_id, uint64_t ptcr)
> > > Can this API be used to clear the PTCR as well? If a PTCR of 0 is sent?
> > > 
> > > Do we want to check if the intention is to clear/set and do additional
> > > error checks? Overwriting a set PTCR? I presume a valid write sequence
> > > would be
> > > 
> > > 1. set PTCR
> > > 2. clear PTCR
> > > 3. set..
> > > 4. clear..
> > > ...
> > > 
> > > Or can we have
> > > 
> > > 1. set PTCR
> > > 2. set PTCR
> > > ..
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/skiboot/attachments/20160806/a7f3a9fd/attachment-0001.html>


More information about the Skiboot mailing list