Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753291AbdDMLyq (ORCPT ); Thu, 13 Apr 2017 07:54:46 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:39704 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752250AbdDMLyn (ORCPT ); Thu, 13 Apr 2017 07:54:43 -0400 Date: Thu, 13 Apr 2017 17:24:34 +0530 From: Gautham R Shenoy To: Nicholas Piggin Cc: Michael Neuling , Benjamin Herrenschmidt , "Aneesh Kumar K.V" , "Gautham R. Shenoy" , Michael Ellerman , "Shreyas B. Prabhu" , Shilpasri G Bhat , Vaidyanathan Srinivasan , Anton Blanchard , Balbir Singh , Akshay Adiga , Mahesh J Salgaonkar , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/3] powernv:idle: Set LPCR_UPRT on wakeup from deep-stop Reply-To: ego@linux.vnet.ibm.com References: <9be8410e0abe5ae1afa16a6f987c53046ef51757.1491996797.git.ego@linux.vnet.ibm.com> <8737ddq7py.fsf@skywalker.in.ibm.com> <1492056725.7236.95.camel@kernel.crashing.org> <1492064854.4624.48.camel@neuling.org> <20170413171817.2854f597@roar.ozlabs.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20170413171817.2854f597@roar.ozlabs.ibm.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-TM-AS-GCONF: 00 x-cbid: 17041311-0056-0000-0000-0000033B426A X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006928; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000208; SDB=6.00846968; UDB=6.00417827; IPR=6.00625402; BA=6.00005288; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00015031; XFM=3.00000013; UTC=2017-04-13 11:54:40 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17041311-0057-0000-0000-000007714C8E Message-Id: <20170413115434.GC2425@in.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-04-13_11:,, 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-1702020001 definitions=main-1704130100 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1538 Lines: 42 On Thu, Apr 13, 2017 at 05:18:17PM +1000, Nicholas Piggin wrote: > On Thu, 13 Apr 2017 16:27:34 +1000 > Michael Neuling wrote: > > > On Thu, 2017-04-13 at 14:12 +1000, Benjamin Herrenschmidt wrote: > > > On Thu, 2017-04-13 at 09:28 +0530, Aneesh Kumar K.V wrote: > > > > > ? #endif > > > > > ???????mtctr???r12 > > > > > ???????bctrl > > > > > +/* > > > > > + * cur_cpu_spec->cpu_restore would restore LPCR to a > > > > > + * sane value that is set at early boot time, > > > > > + * thereby clearing LPCR_UPRT. > > > > > + * LPCR_UPRT is required if we are running in Radix mode. > > > > > + * Set it here if that be the case. > > > > > + */ > > > > > +BEGIN_MMU_FTR_SECTION > > > > > +?????mfspr???r3, SPRN_LPCR > > > > > +?????LOAD_REG_IMMEDIATE(r4, LPCR_UPRT) > > > > > +?????or??????r3, r3, r4 > > > > > +?????mtspr???SPRN_LPCR, r3 > > > > > +END_MMU_FTR_SECTION_IFSET(MMU_FTR_TYPE_RADIX) > > > > > > We are probably better off saving the value somewhere during boot > > > and just "blasting" it whole back. > > > > We seem to touch LPCR in a bunch of places these days. Not sure when "sometimes > > during boot" should actually be. > > In the short term, what if we just save LPCR and restore it after calling > cpu_restore? As you say there are a lot of things that touch LPCR we're > not catching here. In that case can we skip calling cpu_restore in the idle_exit path altogether and simply restore LPCR to the value that the thread had before executing stop ? > -- Thanks and Regards gautham.