From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757254AbcILWJE (ORCPT ); Mon, 12 Sep 2016 18:09:04 -0400 Received: from ozlabs.org ([103.22.144.67]:52713 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752632AbcILWJC (ORCPT ); Mon, 12 Sep 2016 18:09:02 -0400 X-powerpc-patch-notification: thanks X-powerpc-patch-commit: bd00a240dc52e28706fbbe3aceda63e6c291b433 In-Reply-To: <1473225390-4281-1-git-send-email-ego@linux.vnet.ibm.com> To: "Gautham R. Shenoy" , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org From: Michael Ellerman Cc: "Shreyas B. Prabhu" , "Gautham R. Shenoy" , Michael Neuling Subject: Re: powernv: Restore SPRs correctly upon wake up from hypervisor state loss Message-Id: <3sY25S6bdKz9sdn@ozlabs.org> Date: Tue, 13 Sep 2016 08:09:00 +1000 (AEST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2016-07-09 at 05:16:30 UTC, "Gautham R. Shenoy" wrote: > From: "Gautham R. Shenoy" > > pnv_wakeup_tb_loss function currently expects the cr4 to be "eq" if > the CPU is waking up from a complete hypervisor state loss. Hence, it > currently restores the SPR contents only if cr4 is "eq". > > However, after the commit bcef83a00dc4 ("powerpc/powernv: Add platform > support for stop instruction"), on ISA_V300 CPUs, the function > pnv_restore_hyp_resource sets cr4 to contain the result of the > comparison between state the CPU has woken up and the first deepest > stop state before calling pnv_wakeup_tb_loss. > > Thus if the CPU woke up from a state that is deeper than the first > deepest stop state, cr4 have "gt" set and hence, pnv_wakeup_tb_loss > will fail to restore the SPRs on waking up from such a state. > > Fix the code in pnv_wakeup_tb_loss to restore the SPR states when cr4 is > "eq" or "gt". > > Fixes: Commit bcef83a00dc4 ("powerpc/powernv: Add platform support for stop instruction") > Signed-off-by: Gautham R. Shenoy > Reviewed-by: Shreyas B. Prabhu Applied to powerpc fixes, thanks. https://git.kernel.org/powerpc/c/bd00a240dc52e28706fbbe3ace cheers