linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Neuling <mikey@neuling.org>
To: will_schmidt@vnet.ibm.com
Cc: linuxppc-dev@ozlabs.org, Paul Mackerras <paulus@samba.org>
Subject: Re: [PATCH] fixes for the SLB shadow buffer
Date: Thu, 02 Aug 2007 15:56:31 +1000	[thread overview]
Message-ID: <24613.1186034191@neuling.org> (raw)
In-Reply-To: <1186004885.22717.50.camel@farscape.rchland.ibm.com>

> > --- linux-2.6-ozlabs.orig/arch/powerpc/kernel/entry_64.S
> > +++ linux-2.6-ozlabs/arch/powerpc/kernel/entry_64.S
> > @@ -389,7 +389,9 @@ BEGIN_FTR_SECTION
> >  	ld	r9,PACA_SLBSHADOWPTR(r13)
> >  	li	r12,0
> >  	std	r12,SLBSHADOW_STACKESID(r9) /* Clear ESID */
> > +	eieio
> >  	std	r7,SLBSHADOW_STACKVSID(r9)  /* Save VSID */
> > +	eieio
> >  	std	r0,SLBSHADOW_STACKESID(r9)  /* Save ESID */
> > 
> Hi Michael, 
> 
> I was going to ask if we really needed both of them, but think I
> convinced myself that we do.
>  
> Do we also want/need an eieio after the /* Save ESID */ statement, or is
> that somehow handled by the slbie following?

Actually, I think we can remove the barriers all together.

The ordering depends on how the buffer is accessed.

If each CPU only access it's own shadow buffer, then we are ok, but this
isn't the case when we take a checkpoint restart, like in POWER6, the
buffer must be read by a separate CPU.  

But even in the case of a checkpoint restart, the ordering will be
preserved as the NIA we get as part of the checkpoint will have all
previous instructions complete and none of the following instructions
started.

So I guess the questions is, does PHYP even need to access the shadow
buffer of another CPU, while that other CPU is in flight.  I'm not sure
that they can as they can't read the entire buffer atomically if the
target CPU is still active.  So PHYP must stop instructions on the
target CPU, before it reads it's shadow buffer.  Hence no ordering
problems.

I should probably talk to some PHYP guys to confirm, but i think we can
remove all the barriers when writing to the shadow buffer

Mikey

  reply	other threads:[~2007-08-02  5:56 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-01  4:56 [PATCH] fixes for the SLB shadow buffer Michael Neuling
2007-08-01  5:28 ` Paul Mackerras
2007-08-01  6:02   ` Michael Neuling
2007-08-01 21:48     ` Will Schmidt
2007-08-02  5:56       ` Michael Neuling [this message]
2007-08-02  7:31         ` Benjamin Herrenschmidt
2007-08-02  8:56           ` Michael Neuling
2007-08-02  8:58             ` Benjamin Herrenschmidt
2007-08-02  9:03               ` Michael Neuling
2007-08-02  9:14                 ` Benjamin Herrenschmidt
2007-08-02  9:28                   ` Michael Neuling
2007-08-03  1:55                     ` Michael Neuling
2007-08-03  2:50                       ` Benjamin Herrenschmidt
2007-08-01 22:33     ` Benjamin Herrenschmidt
2007-08-01 23:32       ` Michael Neuling
2007-08-02  0:05         ` Benjamin Herrenschmidt
2007-08-02  1:04           ` Benjamin Herrenschmidt

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=24613.1186034191@neuling.org \
    --to=mikey@neuling.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.org \
    --cc=will_schmidt@vnet.ibm.com \
    /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).