From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751492AbdE3KgN (ORCPT ); Tue, 30 May 2017 06:36:13 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:54063 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750902AbdE3KgH (ORCPT ); Tue, 30 May 2017 06:36:07 -0400 Date: Tue, 30 May 2017 16:05:58 +0530 From: Gautham R Shenoy To: Nicholas Piggin Cc: "Gautham R. Shenoy" , Michael Ellerman , Michael Neuling , Vaidyanathan Srinivasan , Shilpasri G Bhat , Akshay Adiga , Benjamin Herrenschmidt , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/6] powernv:idle: Restore LPCR on wakeup from deep-stop Reply-To: ego@linux.vnet.ibm.com References: <147a42823bae78b98b76b91f736c620b886213ae.1494585671.git.ego@linux.vnet.ibm.com> <20170530161731.33fec50d@roar.ozlabs.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170530161731.33fec50d@roar.ozlabs.ibm.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-TM-AS-GCONF: 00 x-cbid: 17053010-8235-0000-0000-00000B9925F8 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007143; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000212; SDB=6.00867672; UDB=6.00431122; IPR=6.00647552; BA=6.00005384; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00015642; XFM=3.00000015; UTC=2017-05-30 10:36:04 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17053010-8236-0000-0000-00003C08B90B Message-Id: <20170530103558.GC8563@in.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-05-30_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1705300201 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 30, 2017 at 04:17:31PM +1000, Nicholas Piggin wrote: > On Tue, 16 May 2017 14:19:45 +0530 > "Gautham R. Shenoy" wrote: > > > From: "Gautham R. Shenoy" > > > > On wakeup from a deep stop state which is supposed to lose the > > hypervisor state, we don't restore the LPCR to the old value but set > > it to a "sane" value via cur_cpu_spec->cpu_restore(). > > > > The problem is that the "sane" value doesn't include UPRT and the HR > > bits which are required to run correctly in Radix mode. > > > > Fix this on POWER9 onwards by restoring the LPCR value whatever it was > > before executing the stop instruction. > > > > Signed-off-by: Gautham R. Shenoy > > Yes I think we need this. I have a plan to rework some of > that cpu_restore and early CPU init stuff, but for now we > need this. > > Does the OCC restore LPCR properly then we just trash it > with ->cpu_restore(), or is it always junk? The microcode restores LPCR to the value that the kernel asks it to set to in pnv_save_sprs_for_deep_states() via the opal_slw_set_reg. So it would be some sane state. However when we return from stop to either the cpuidle or cpuhotplug, we want LPCR to be restored to the value it hand when it entered stop. > > Reviewed-by: Nicholas Piggin > > Thanks for the review. -- Thanks and Regards gautham.