From: Nicholas Piggin Date: Fri, 25 Aug 2017 04:30:35 +0000 (+1000) Subject: powerpc/64s: idle POWER9 can execute stop in virtual mode X-Git-Tag: v4.14-rc1~119^2~103 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=72b0d51d973beab5a06c97279b61a0a58ccf33c8;p=platform%2Fkernel%2Flinux-exynos.git powerpc/64s: idle POWER9 can execute stop in virtual mode The hardware can execute stop in any context, and KVM does not require real mode because siblings do not share MMU state. This saves a switch to real-mode when going idle. Acked-by: Gautham R. Shenoy Signed-off-by: Nicholas Piggin Reviewed-by: Paul Mackerras Signed-off-by: Michael Ellerman --- diff --git a/arch/powerpc/kernel/idle_book3s.S b/arch/powerpc/kernel/idle_book3s.S index 596b6ba..1125c9b 100644 --- a/arch/powerpc/kernel/idle_book3s.S +++ b/arch/powerpc/kernel/idle_book3s.S @@ -195,7 +195,16 @@ pnv_powersave_common: std r5,_CCR(r1) std r1,PACAR1(r13) +BEGIN_FTR_SECTION + /* + * POWER9 does not require real mode to stop, and presently does not + * set hwthread_state for KVM (threads don't share MMU context), so + * we can remain in virtual mode for this. + */ + bctr +END_FTR_SECTION_IFSET(CPU_FTR_ARCH_300) /* + * POWER8 * Go to real mode to do the nap, as required by the architecture. * Also, we need to be in real mode before setting hwthread_state, * because as soon as we do that, another thread can switch