linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Nicholas Piggin <npiggin@gmail.com>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: Michael Neuling <mikey@neuling.org>,
	linuxppc-dev@lists.ozlabs.org, benh@kernel.crashing.org,
	Paul Mackerras <paulus@ozlabs.org>
Subject: Re: [PATCH] powerpc: Invalidate ERAT on powersave wakeup for POWER9
Date: Fri, 23 Jun 2017 20:24:51 +1000	[thread overview]
Message-ID: <20170623202451.15871d00@roar.ozlabs.ibm.com> (raw)
In-Reply-To: <87mv8zoxp8.fsf@concordia.ellerman.id.au>

On Fri, 23 Jun 2017 19:33:23 +1000
Michael Ellerman <mpe@ellerman.id.au> wrote:

> Michael Neuling <mikey@neuling.org> writes:
> 
> > On POWER9 the ERAT may be incorrect on wakeup from some stop states
> > that lose state. This causes random segvs and illegal instructions
> > when these stop states are enabled.  
> 
> Incorrect how?

It can have stale ERAT entries from another idle thread.

> 
> Because with the ERAT flush where you've put it, there's still a good
> amount of code executed prior to the flush isn't there?
> 
> ie. we come in at 0x100, do some of the prolog, do IDLE_TEST which takes
> us to pnv_powersave_wakeup, which then restores state from the paca
> (memory), that returns and then we check KVM ... and then finally we end
> up at pnv_wakeup_loss.

In the case of an HMI, we could call into OPAL as well.

> Or is there some other path? Or is the ERAT incorrect in some specific
> way which means we only need to flush there?

I think we're in real mode until returning from pnv_wakeup_loss so those
ERATs should be the same.

Except KVM, which can go to guest and switch on the MMU. My bad, I
suggested putting it into pnv_wakeup_loss.

Flushing at the start of pnv_powersave_wakeup should be safest. I guess
we can avoid it for non-state-loss wakeups if cr3 is lt.

Thanks,
Nick

  reply	other threads:[~2017-06-23 10:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-22 17:26 [PATCH] powerpc: Invalidate ERAT on powersave wakeup for POWER9 Michael Neuling
2017-06-23  0:50 ` Stewart Smith
2017-06-23  2:12   ` Michael Neuling
2017-06-23  3:09   ` Michael Neuling
2017-06-23  9:33 ` Michael Ellerman
2017-06-23 10:24   ` Nicholas Piggin [this message]
2017-06-23 10:45   ` Benjamin Herrenschmidt
2017-06-23 10:22 ` Anshuman Khandual
2017-06-24 17:29 ` [PATCH v2] " Benjamin Herrenschmidt
2017-06-25  5:18   ` Nicholas Piggin
2017-06-29 12:21   ` [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=20170623202451.15871d00@roar.ozlabs.ibm.com \
    --to=npiggin@gmail.com \
    --cc=benh@kernel.crashing.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mikey@neuling.org \
    --cc=mpe@ellerman.id.au \
    --cc=paulus@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;
as well as URLs for NNTP newsgroup(s).