From: Preeti U Murthy <preeti@linux.vnet.ibm.com>
To: benh@kernel.crashing.org, linux-kernel@vger.kernel.org,
svaidyan@in.ibm.com, paulus@samba.org,
srivatsa.bhat@linux.vnet.ibm.com, linuxppc-dev@lists.ozlabs.org
Subject: [PATCH 6/6] ppc, book3s: Go back to same idle state after handling machine check interrupt
Date: Wed, 28 May 2014 10:09:39 +0530 [thread overview]
Message-ID: <20140528043939.15676.57491.stgit@preeti.in.ibm.com> (raw)
In-Reply-To: <20140528043703.15676.58580.stgit@preeti.in.ibm.com>
From: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Now that the support for fast sleep is present, threads could have woken up
from fast sleep on getting a machine check interrupt. Hence add code to allow
threads to go back to the idle state they woke up from after handling the
interrupt. Today they go back to nap by default.
Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
[ Changelog added by <preeti@linux.vnet.ibm.com> ]
Signed-off-by: Preeti U Murthy <preeti@linux.vnet.ibm.com>
---
arch/powerpc/kernel/exceptions-64s.S | 21 +++++++++++++++------
arch/powerpc/kernel/idle_power7.S | 2 +-
2 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
index b4bf464..94cee3c 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -1396,15 +1396,16 @@ machine_check_handle_early:
* of the following is true:
* a. thread wasn't in power saving mode
* b. thread was in power saving mode with no state loss or
- * supervisor state loss
+ * supervisor state loss or hypervisor state loss (fastsleep)
*
- * Go back to nap again if (b) is true.
+ * Go back to nap or fastsleep again if (b) is true.
*/
rlwinm. r11,r12,47-31,30,31 /* Was it in power saving mode? */
beq 4f /* No, it wasn;t */
- /* Thread was in power saving mode. Go back to nap again. */
- cmpwi r11,2
- bne 3f
+ /* Thread was in power saving mode. Go back to the same state again. */
+ cmpwi cr1,r11,2
+ blt cr1,3f
+7:
/* Supervisor state loss */
li r0,1
stb r0,PACA_NAPSTATELOST(r13)
@@ -1412,7 +1413,15 @@ machine_check_handle_early:
MACHINE_CHECK_HANDLER_WINDUP
GET_PACA(r13)
ld r1,PACAR1(r13)
- b .power7_enter_nap_mode
+ /* We need to pass the idle state in r3: 0 -> nap, 1 -> sleep */
+ bgt cr1,8f
+ li r3,0
+ b .power7_enter_idle
+ /* No return */
+
+8: li r3,1 /* Pass 1 in r3 to request sleep in power7_enter_idle */
+ b .power7_enter_idle
+ /* No return */
4:
#endif
/*
diff --git a/arch/powerpc/kernel/idle_power7.S b/arch/powerpc/kernel/idle_power7.S
index c3ab869..e13e21b 100644
--- a/arch/powerpc/kernel/idle_power7.S
+++ b/arch/powerpc/kernel/idle_power7.S
@@ -95,7 +95,7 @@ _GLOBAL(power7_powersave_common)
std r9,_MSR(r1)
std r1,PACAR1(r13)
-_GLOBAL(power7_enter_nap_mode)
+_GLOBAL(power7_enter_idle)
#ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE
/* Tell KVM we're napping */
li r4,KVM_HWTHREAD_IN_NAP
prev parent reply other threads:[~2014-05-28 4:44 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-28 4:38 [PATCH 0/6] ppc, kvm, cpuidle: Allow offline and kvm standby threads to enter fastsleep Preeti U Murthy
2014-05-28 4:38 ` [PATCH 1/6] powernv, cpuidle: Move the flags used for idle state discovery to powernv core Preeti U Murthy
2014-05-28 4:38 ` [PATCH 2/6] powerpc, powernv, CPU hotplug: Put offline CPUs in Fast-Sleep instead of Nap Preeti U Murthy
2014-06-05 4:23 ` Paul Mackerras
2014-05-28 4:39 ` [PATCH 3/6] KVM: PPC: Book3S HV: Enable CPUs to run guest after waking up from fast-sleep Preeti U Murthy
2014-05-28 4:39 ` [PATCH 4/6] KVM: PPC: Book3S HV: Consolidate the idle-state enter sequence in KVM Preeti U Murthy
2014-05-28 4:39 ` [PATCH 5/6] KVM: PPC: Book3S HV: Put KVM standby hwthreads to fast-sleep instead of nap Preeti U Murthy
2014-05-28 4:39 ` Preeti U Murthy [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=20140528043939.15676.57491.stgit@preeti.in.ibm.com \
--to=preeti@linux.vnet.ibm.com \
--cc=benh@kernel.crashing.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=paulus@samba.org \
--cc=srivatsa.bhat@linux.vnet.ibm.com \
--cc=svaidyan@in.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).