* [PATCH] powerpc/powernv: Fix SMT4 forcing idle code
@ 2018-04-01 5:38 Nicholas Piggin
2018-04-04 14:39 ` Michael Ellerman
0 siblings, 1 reply; 2+ messages in thread
From: Nicholas Piggin @ 2018-04-01 5:38 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Nicholas Piggin, Paul Mackerras
PSSCR value is not stored to PACA_REQ_PSSCR in case the CPU does
not have the XER[SO] bug.
Fix this by storing up-front, outside the workaround code. The
initial test is not required because it is a slow path.
The workaround is made to depend on CONFIG_KVM_BOOK3S_HV_POSSIBLE, to
match pnv_power9_force_smt4_catch() where it is used.
Fixes: 7672691a08 ("powerpc/powernv: Provide a way to force a core into SMT4 mode")
Cc: Paul Mackerras <paulus@ozlabs.org>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
arch/powerpc/kernel/idle_book3s.S | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/kernel/idle_book3s.S b/arch/powerpc/kernel/idle_book3s.S
index 89157cf452e3..d503203842b0 100644
--- a/arch/powerpc/kernel/idle_book3s.S
+++ b/arch/powerpc/kernel/idle_book3s.S
@@ -430,20 +430,20 @@ ALT_FTR_SECTION_END_NESTED_IFSET(CPU_FTR_ARCH_207S, 66); \
* r3 contains desired PSSCR register value.
*/
_GLOBAL(power9_idle_stop)
-BEGIN_FTR_SECTION
- lwz r5, PACA_DONT_STOP(r13)
- cmpwi r5, 0
- bne 1f
std r3, PACA_REQ_PSSCR(r13)
+#ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE
+BEGIN_FTR_SECTION
sync
lwz r5, PACA_DONT_STOP(r13)
cmpwi r5, 0
bne 1f
END_FTR_SECTION_IFSET(CPU_FTR_P9_TM_XER_SO_BUG)
+#endif
mtspr SPRN_PSSCR,r3
LOAD_REG_ADDR(r4,power_enter_stop)
b pnv_powersave_common
/* No return */
+#ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE
1:
/*
* We get here when TM / thread reconfiguration bug workaround
@@ -453,6 +453,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_P9_TM_XER_SO_BUG)
li r3, 0
std r3, PACA_REQ_PSSCR(r13)
blr /* return 0 for wakeup cause / SRR1 value */
+#endif
/*
* On waking up from stop 0,1,2 with ESL=1 on POWER9 DD1,
--
2.16.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: powerpc/powernv: Fix SMT4 forcing idle code
2018-04-01 5:38 [PATCH] powerpc/powernv: Fix SMT4 forcing idle code Nicholas Piggin
@ 2018-04-04 14:39 ` Michael Ellerman
0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2018-04-04 14:39 UTC (permalink / raw)
To: Nicholas Piggin, linuxppc-dev; +Cc: Nicholas Piggin
On Sun, 2018-04-01 at 05:38:13 UTC, Nicholas Piggin wrote:
> PSSCR value is not stored to PACA_REQ_PSSCR in case the CPU does
> not have the XER[SO] bug.
>
> Fix this by storing up-front, outside the workaround code. The
> initial test is not required because it is a slow path.
>
> The workaround is made to depend on CONFIG_KVM_BOOK3S_HV_POSSIBLE, to
> match pnv_power9_force_smt4_catch() where it is used.
>
> Fixes: 7672691a08 ("powerpc/powernv: Provide a way to force a core into SMT4 mode")
> Cc: Paul Mackerras <paulus@ozlabs.org>
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/a2b5e056b75ee6ef0777817644a456
cheers
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-04-04 14:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-01 5:38 [PATCH] powerpc/powernv: Fix SMT4 forcing idle code Nicholas Piggin
2018-04-04 14:39 ` Michael Ellerman
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).