From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from e8.ny.us.ibm.com (e8.ny.us.ibm.com [32.97.182.138]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 757A51A06C1 for ; Wed, 28 May 2014 14:43:39 +1000 (EST) Received: from /spool/local by e8.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 28 May 2014 00:43:37 -0400 Received: from b01cxnp23033.gho.pok.ibm.com (b01cxnp23033.gho.pok.ibm.com [9.57.198.28]) by d01dlp03.pok.ibm.com (Postfix) with ESMTP id 0F226C9003E for ; Wed, 28 May 2014 00:43:28 -0400 (EDT) Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by b01cxnp23033.gho.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s4S4hXYe65601636 for ; Wed, 28 May 2014 04:43:33 GMT Received: from d01av04.pok.ibm.com (localhost [127.0.0.1]) by d01av04.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s4S4hWAe025621 for ; Wed, 28 May 2014 00:43:33 -0400 Subject: [PATCH 3/6] KVM: PPC: Book3S HV: Enable CPUs to run guest after waking up from fast-sleep 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 From: Preeti U Murthy Date: Wed, 28 May 2014 10:09:04 +0530 Message-ID: <20140528043904.15676.40953.stgit@preeti.in.ibm.com> In-Reply-To: <20140528043703.15676.58580.stgit@preeti.in.ibm.com> References: <20140528043703.15676.58580.stgit@preeti.in.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Srivatsa S. Bhat When guests have to be launched, the secondary threads which are offline are woken up to run the guests. Today these threads wake up from nap and check if they have to run guests. Now that the offline secondary threads can go to fastsleep, add this check in the fastsleep wakeup path as well. Signed-off-by: Srivatsa S. Bhat [ Changelog added by ] Signed-off-by: Preeti U Murthy --- arch/powerpc/kernel/exceptions-64s.S | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index 3afd391..b4bf464 100644 --- a/arch/powerpc/kernel/exceptions-64s.S +++ b/arch/powerpc/kernel/exceptions-64s.S @@ -100,6 +100,19 @@ system_reset_pSeries: SET_SCRATCH0(r13) #ifdef CONFIG_PPC_P7_NAP BEGIN_FTR_SECTION + + GET_PACA(r13) +#ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE + li r0,KVM_HWTHREAD_IN_KERNEL + stb r0,HSTATE_HWTHREAD_STATE(r13) + /* Order setting hwthread_state vs. testing hwthread_req */ + sync + lbz r0,HSTATE_HWTHREAD_REQ(r13) + cmpwi r0,0 + beq 1f + b kvm_start_guest +1: +#endif /* Running native on arch 2.06 or later, check if we are * waking up from nap. We only handle no state loss and * supervisor state loss. We do -not- handle hypervisor @@ -116,28 +129,15 @@ BEGIN_FTR_SECTION * OPAL v3 based powernv platforms have new idle states * which fall in this catagory. */ - bgt cr1,8f GET_PACA(r13) - -#ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE - li r0,KVM_HWTHREAD_IN_KERNEL - stb r0,HSTATE_HWTHREAD_STATE(r13) - /* Order setting hwthread_state vs. testing hwthread_req */ - sync - lbz r0,HSTATE_HWTHREAD_REQ(r13) - cmpwi r0,0 - beq 1f - b kvm_start_guest -1: -#endif + bgt cr1,8f beq cr1,2f b .power7_wakeup_noloss 2: b .power7_wakeup_loss /* Fast Sleep wakeup on PowerNV */ -8: GET_PACA(r13) - b .power7_wakeup_tb_loss +8: b .power7_wakeup_tb_loss 9: END_FTR_SECTION_IFSET(CPU_FTR_HVMODE | CPU_FTR_ARCH_206)