From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760139AbdCVQGw (ORCPT ); Wed, 22 Mar 2017 12:06:52 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:35833 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759019AbdCVQGo (ORCPT ); Wed, 22 Mar 2017 12:06:44 -0400 Date: Thu, 23 Mar 2017 02:06:28 +1000 From: Nicholas Piggin To: "Gautham R. Shenoy" Cc: Michael Ellerman , Michael Neuling , Benjamin Herrenschmidt , "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: [v3 PATCH 4/4] powernv: Recover correct PACA on wakeup from a stop on P9 DD1 Message-ID: <20170323020628.56b40eed@roar.ozlabs.ibm.com> In-Reply-To: <2387240280c6445bd22ee9be621997b6f951ef3d.1490194710.git.ego@linux.vnet.ibm.com> References: <2387240280c6445bd22ee9be621997b6f951ef3d.1490194710.git.ego@linux.vnet.ibm.com> Organization: IBM X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 22 Mar 2017 20:34:17 +0530 "Gautham R. Shenoy" wrote: > From: "Gautham R. Shenoy" > > POWER9 DD1.0 hardware has an issue due to which the SPRs of a thread > waking up from stop 0,1,2 with ESL=1 can endup being misplaced in the > core. Thus the HSPRG0 of a thread waking up from can contain the paca > pointer of its sibling. > > This patch implements a context recovery framework within threads of a > core, by provisioning space in paca_struct for saving every sibling > threads's paca pointers. Basically, we should be able to arrive at the > right paca pointer from any of the thread's existing paca pointer. > > At bootup, during powernv idle-init, we save the paca address of every > CPU in each one its siblings paca_struct in the slot corresponding to > this CPU's index in the core. > > On wakeup from a stop, the thread will determine its index in the core > from the TIR register and recover its PACA pointer by indexing into > the correct slot in the provisioned space in the current PACA. > > Furthermore, ensure that the NVGPRs are restored from the stack on the > way out by setting the NAPSTATELOST in paca. > > [Changelog written with inputs from svaidy@linux.vnet.ibm.com] Looks good. Reviewed-by: Nicholas Piggin