From: Nicholas Piggin <npiggin@gmail.com>
To: Akshay Adiga <akshay.adiga@linux.vnet.ibm.com>
Cc: "Gautham R . Shenoy" <ego@linux.vnet.ibm.com>,
linuxppc-dev@lists.ozlabs.org,
"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>,
kvm-ppc@vger.kernel.org,
Mahesh Jagannath Salgaonkar <mahesh@linux.vnet.ibm.com>
Subject: Re: [PATCH v4] powerpc/64s: reimplement book3s idle code in C
Date: Fri, 28 Sep 2018 10:16:14 +1000 [thread overview]
Message-ID: <20180928101614.2ae641e8@roar.ozlabs.ibm.com> (raw)
In-Reply-To: <20180926140914.GA2442@aks.ibm>
On Wed, 26 Sep 2018 19:39:14 +0530
Akshay Adiga <akshay.adiga@linux.vnet.ibm.com> wrote:
> On Fri, Sep 14, 2018 at 11:52:40AM +1000, Nicholas Piggin wrote:
> > +
> > + /*
> > + * On POWER9, SRR1 bits do not match exactly as expected.
> > + * SRR1_WS_GPRLOSS (10b) can also result in SPR loss, so
> > + * always test PSSCR if there is any state loss.
> > + */
> > + if (likely((psscr & PSSCR_RL_MASK) < pnv_first_hv_loss_level)) {
>
> Shouldn't we check PLS field to see if the cpu/core woke up from hv loss ?
>
> Currently, a cpu requested stop4 (RL=4) and exited from a shallower state
> (PLS=2), SPR's are unecessarily restored.
>
> We can do something like :
>
> #define PSSCR_PLS_SHIFT 60
> if (likely((psscr & PSSCR_PLS) >> PSSCR_PLS_SHIFT) < pnv_first_hv_loss_level)
Ah, that corresponds with the following existing code?
/*
* POWER ISA 3. Use PSSCR to determine if we
* are waking up from deep idle state
*/
LOAD_REG_ADDRBASE(r5,pnv_first_deep_stop_state)
ld r4,ADDROFF(pnv_first_deep_stop_state)(r5)
/*
* 0-3 bits correspond to Power-Saving Level Status
* which indicates the idle state we are waking up from
*/
mfspr r5, SPRN_PSSCR
rldicl r5,r5,4,60
li r0, 0 /* clear requested_psscr to say we're awake */
std r0, PACA_REQ_PSSCR(r13)
cmpd cr4,r5,r4
bge cr4,pnv_wakeup_tb_loss /* returns to caller */
Yes I didn't get that right, good catch.
Thanks,
Nick
prev parent reply other threads:[~2018-09-28 0:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-14 1:52 [PATCH v4] powerpc/64s: reimplement book3s idle code in C Nicholas Piggin
2018-09-26 14:09 ` Akshay Adiga
2018-09-28 0:16 ` Nicholas Piggin [this message]
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=20180928101614.2ae641e8@roar.ozlabs.ibm.com \
--to=npiggin@gmail.com \
--cc=akshay.adiga@linux.vnet.ibm.com \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=ego@linux.vnet.ibm.com \
--cc=kvm-ppc@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mahesh@linux.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).