From patchwork Wed Aug 30 06:20:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 807431 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xhwPG2sZMz9t16 for ; Wed, 30 Aug 2017 16:21:06 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="jhpsQHXc"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3xhwPG1cS2zDqLv for ; Wed, 30 Aug 2017 16:21:06 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="jhpsQHXc"; dkim-atps=neutral X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from mail-pf0-x242.google.com (mail-pf0-x242.google.com [IPv6:2607:f8b0:400e:c00::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3xhwNn3J8WzDqGG for ; Wed, 30 Aug 2017 16:20:41 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="jhpsQHXc"; dkim-atps=neutral Received: by mail-pf0-x242.google.com with SMTP id p69so3753408pfk.1 for ; Tue, 29 Aug 2017 23:20:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=jODU76LUB78VQXhiGv9Xw7819GyuPi+UxhrYSW2PHMg=; b=jhpsQHXc1i0NERvxaxaTRmtPewX7dCrBM9jlpLO8tPUoeb8JqdAeOGN86ldlSRw7Vw abo1nexiWnt7zxnUpOVizcGeSwM2xagWAaNM3tmYX7OPb7xE+Zt4kscjXP8/1T6tiSmU YhkCsy6LNV1aMuVOfUoHklEjs4zBpAdvEnkSC5fvxKnWScUxrndjTu+hRLfEWi3XjR9w b+BAHzqzrRyqid0a0tkfBzEz8EPwI3Hbu2qI+5r8w6o4f4EHicklahQf/i7aMDWsLBU6 yzTRSY3tuzey8Rx5T/OgWlq7lAegLX0KbLiwzYdrSVPh0cWcED0ro74J/jpnGqa/xa1a 6IaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=jODU76LUB78VQXhiGv9Xw7819GyuPi+UxhrYSW2PHMg=; b=HA7+qNxS5IJa+U+qEilVppdfoOjYz2lk6Whkgk8EAkvFYGKU0tbodGdf+i4KlmPcjM NMvY96f9AHr2PWVrldPJNGFUyPUqk8A++XbYEYDjx/4HgACIcYkyiTffHTHGE+CrzIu1 OMX6gknJMK0khJ64Vx2Yx9//NOTSoKTY9dnJkDhNfeyv7PDocLRdkpjZAXEZD9FnXp+B lTAVoiLme9lnpT4H2VfPDQg6Jzh9/Jj4tTO3Y/7TWOo6ABykJ3q6Zbxw1B7wvlJMACND +kDvtBj99cSDxPAIFGkteen81s6Vszw8k84dd1VTlJi2FsoS4nBoMe277ZSqG9frksMm CjYw== X-Gm-Message-State: AHYfb5iaDQk2OacshVoH/1SmbNwbO0zEd7u1OtMnkawzIvpj6kPuNsnJ aEoE+qWnOcRDPe3m X-Received: by 10.98.71.14 with SMTP id u14mr510316pfa.315.1504074039542; Tue, 29 Aug 2017 23:20:39 -0700 (PDT) Received: from roar.au.ibm.com (203-219-56-202.tpgi.com.au. [203.219.56.202]) by smtp.gmail.com with ESMTPSA id 82sm8266783pgb.86.2017.08.29.23.20.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Aug 2017 23:20:38 -0700 (PDT) From: Nicholas Piggin To: skiboot@lists.ozlabs.org Date: Wed, 30 Aug 2017 16:20:09 +1000 Message-Id: <20170830062011.15199-2-npiggin@gmail.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20170830062011.15199-1-npiggin@gmail.com> References: <20170830062011.15199-1-npiggin@gmail.com> Subject: [Skiboot] [PATCH 1/3] idle: user context state loss flags fix for stop states X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Gautham R . Shenoy" MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" The "lite" stop variants with PSSCR[ESL]=PSSCR[EC]=1 do not lose user context, while the non-lite variants do (ESL: enable state loss). Some of the POWER9 idle states had these wrong. These are not used by Linux yet. Signed-off-by: Nicholas Piggin Reviewed-by: Akshay Adiga --- hw/slw.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/slw.c b/hw/slw.c index 98040e6e..0720545c 100644 --- a/hw/slw.c +++ b/hw/slw.c @@ -526,7 +526,7 @@ static struct cpu_idle_states power9_cpu_idle_states[] = { .residency_ns = 20000, .flags = 0*OPAL_PM_DEC_STOP \ | 0*OPAL_PM_TIMEBASE_STOP \ - | 0*OPAL_PM_LOSE_USER_CONTEXT \ + | 1*OPAL_PM_LOSE_USER_CONTEXT \ | 0*OPAL_PM_LOSE_HYP_CONTEXT \ | 0*OPAL_PM_LOSE_FULL_CONTEXT \ | 1*OPAL_PM_STOP_INST_FAST, @@ -542,7 +542,7 @@ static struct cpu_idle_states power9_cpu_idle_states[] = { .residency_ns = 49000, .flags = 0*OPAL_PM_DEC_STOP \ | 0*OPAL_PM_TIMEBASE_STOP \ - | 1*OPAL_PM_LOSE_USER_CONTEXT \ + | 0*OPAL_PM_LOSE_USER_CONTEXT \ | 0*OPAL_PM_LOSE_HYP_CONTEXT \ | 0*OPAL_PM_LOSE_FULL_CONTEXT \ | 1*OPAL_PM_STOP_INST_FAST, @@ -572,7 +572,7 @@ static struct cpu_idle_states power9_cpu_idle_states[] = { .residency_ns = 99000, .flags = 0*OPAL_PM_DEC_STOP \ | 0*OPAL_PM_TIMEBASE_STOP \ - | 1*OPAL_PM_LOSE_USER_CONTEXT \ + | 0*OPAL_PM_LOSE_USER_CONTEXT \ | 0*OPAL_PM_LOSE_HYP_CONTEXT \ | 0*OPAL_PM_LOSE_FULL_CONTEXT \ | 1*OPAL_PM_STOP_INST_FAST, @@ -671,7 +671,7 @@ static struct cpu_idle_states power9_ndd1_cpu_idle_states[] = { .residency_ns = 49000, .flags = 0*OPAL_PM_DEC_STOP \ | 0*OPAL_PM_TIMEBASE_STOP \ - | 1*OPAL_PM_LOSE_USER_CONTEXT \ + | 0*OPAL_PM_LOSE_USER_CONTEXT \ | 0*OPAL_PM_LOSE_HYP_CONTEXT \ | 0*OPAL_PM_LOSE_FULL_CONTEXT \ | 1*OPAL_PM_STOP_INST_FAST,