linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Nicholas Piggin <npiggin@gmail.com>
To: "Shreyas B. Prabhu" <shreyasbp@gmail.com>
Cc: Gautham R Shenoy <ego@linux.vnet.ibm.com>,
	Mahesh J Salgaonkar <mahesh@linux.vnet.ibm.com>,
	linuxppc-dev@lists.ozlabs.org,
	"Shreyas B . Prabhu" <shreyas@linux.vnet.ibm.com>
Subject: Re: [PATCH] powerpc/64s: relocation, register save fixes for system reset interrupt
Date: Thu, 3 Nov 2016 17:17:51 +1100	[thread overview]
Message-ID: <20161103171751.44798270@roar.ozlabs.ibm.com> (raw)
In-Reply-To: <CAAVMmb5Zj4oKVF6f3Ag0mEHOUrAYro65JyuULMO7+abRs4D=OQ@mail.gmail.com>

On Thu, 3 Nov 2016 01:56:46 -0400
"Shreyas B. Prabhu" <shreyasbp@gmail.com> wrote:

> On Thu, Nov 3, 2016 at 1:21 AM, Nicholas Piggin <npiggin@gmail.com> wrote:
> > On Wed, 2 Nov 2016 14:15:48 +0530
> > Gautham R Shenoy <ego@linux.vnet.ibm.com> wrote:
> >  
> >> Hi Nick,
> >>
> >> On Wed, Nov 02, 2016 at 07:36:24PM +1100, Nicholas Piggin wrote:  
> >> >
> >> > Okay, I'll work with that. What's the best way to make a P8 do
> >> > winkle sleeps?  
> >>
> >> From the userspace, offlining the CPUs of the core will put them to
> >> winkle.  
> >
> > Thanks for this. Hum, that r13 manipulation throughout the idle
> > and exception code is a bit interesting. I'll do the minimal patch
> > for 4.9, but what's the reason not to just use the winkle state
> > in the PACA rather than storing it into HSPRG0 bit, can you (or
> > Shreyas) explain?
> >  
> Hi Nick,
> 
> Before deep winkle, checking SRR1's wakeup bits (Bits 46:47) was enough to
> figure out which idle state we are waking up from. But in P8, SRR1's wakeup
> bits aren't enough since bits 46:47 are 0b11 for both fast sleep and
> deep winkle.
> So to distinguish bw fastsleep and deep winkle, we use the current HSPRG0/PORE
> trick. We program the PORE engine (which is used for state restore when waking
> up from deep winkle) to restore HSPRG0 with the last bit set (we do this in
> pnv_save_sprs_for_winkle()). R13 bit manipulation in pnv_restore_hyp_resource
> is related to this.

Right, I didn't realize how that exactly worked until I had to go read
the code just now. It's a neat little trick. I'm wondering can we use PACA_THREAD_IDLE_STATE==PNV_THREAD_WINKLE for this instead? It would just
make the early PACA usage in the exception handlers able to use more common
code.

Thanks,
Nick

  reply	other threads:[~2016-11-03  6:18 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-13  2:17 [PATCH] powerpc/64s: relocation, register save fixes for system reset interrupt Nicholas Piggin
2016-10-13 11:02 ` Gautham R Shenoy
2016-10-13 11:54 ` Balbir Singh
2016-10-14  3:16   ` Nicholas Piggin
2016-10-14  5:45     ` Balbir Singh
2016-10-27 11:38 ` Michael Ellerman
2016-10-28 12:01   ` Balbir Singh
2016-11-02  6:04 ` [PATCH] " Mahesh Jagannath Salgaonkar
2016-11-02  6:57   ` Nicholas Piggin
2016-11-02  8:24     ` Mahesh J Salgaonkar
2016-11-02  8:36       ` Nicholas Piggin
2016-11-02  8:45         ` Gautham R Shenoy
2016-11-03  5:21           ` Nicholas Piggin
2016-11-03  5:56             ` Shreyas B. Prabhu
2016-11-03  6:17               ` Nicholas Piggin [this message]
2016-11-03  6:32                 ` Shreyas B. Prabhu
2016-11-03  7:02                   ` Nicholas Piggin
2016-11-04  9:04                     ` Gautham R Shenoy
2016-11-04 11:47                       ` Nicholas Piggin

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=20161103171751.44798270@roar.ozlabs.ibm.com \
    --to=npiggin@gmail.com \
    --cc=ego@linux.vnet.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mahesh@linux.vnet.ibm.com \
    --cc=shreyas@linux.vnet.ibm.com \
    --cc=shreyasbp@gmail.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).