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, From patchwork Wed Aug 30 06:20:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 807432 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 3xhwPY3CBgz9sNc for ; Wed, 30 Aug 2017 16:21:21 +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="PdUey74v"; 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 3xhwPY20QszDqJ8 for ; Wed, 30 Aug 2017 16:21:21 +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="PdUey74v"; 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 3xhwNw60bCzDqHx for ; Wed, 30 Aug 2017 16:20:48 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="PdUey74v"; dkim-atps=neutral Received: by mail-pf0-x242.google.com with SMTP id k3so3750782pfc.3 for ; Tue, 29 Aug 2017 23:20:48 -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=G1paMLGJDkHa1SY5TfirBB2LXp2Fo/el4ovseAdubq0=; b=PdUey74vjyufQSXiUVXcklSB/xoZMs7XxHwnsrIpvvucYrYoOrq/AAdor376CDor9e ZG01q3CHNP2wgBF/lXVo1Xu01utHnQKOcRU11S2lBoICkaOR4rKKfUjvBzWpXZH9/gNN b2gqo0Efl/plP/3Uyq/GEQT3p/j4CiNB/4YapXvZUWoq5v/WdhdxfrfYvV6CLgW5b25f 8q46T029woBx9bzLD/qmn4L/aBCnif+K5Tzr3ZYCHmajFd8A5F48G8LkcdrZMIOxAOiz TXPXqwknNNcxpiIqP9Gnrr5YaDQ8/gy5w8FE0vBD8K/xFFS+xZQwbAjGFJcxH1h2MUBw aKWg== 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=G1paMLGJDkHa1SY5TfirBB2LXp2Fo/el4ovseAdubq0=; b=MO5FdBDum0kxV0btvYJoOY2+hwwcqZM+UyIxH8dbdaTjXjojnonnigKAmzNdT2u52h /NwQy1YH4IvB09fZ00HBt8WRC7mDsBTmiO2XHfiyZsa9LyV+sCP9OM2ZdV/cvMY5jouX a9dYoUx35sEhqO/Sue+PJ2X+M7ByZywS4nPGxqmGnNqCAUpQ5KDV2GSSEAh9S4LoWfos EUN4n5oLJzjIsSG6PHuBeecmEJOY/3MK0Y57CZY6cqz9boc8jB+JkXBQ5npFOY8lFvbb hfbJvvwS9AHTz0ovQ6xhEj8TaBI0Ik18jHnqpFIZ2FdZ8aGpU1jyc9jsN8ryuDioVo93 e78A== X-Gm-Message-State: AHYfb5jkFNUFNqL4JYdrlTvpxQiwv6Thnbmwp/Txfn5NqAE1jHeUl1O5 74ww+NOWaUP0Nc8p X-Received: by 10.99.140.14 with SMTP id m14mr567848pgd.106.1504074046600; Tue, 29 Aug 2017 23:20:46 -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.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Aug 2017 23:20:45 -0700 (PDT) From: Nicholas Piggin To: skiboot@lists.ozlabs.org Date: Wed, 30 Aug 2017 16:20:10 +1000 Message-Id: <20170830062011.15199-3-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 2/3] idle: disable stop*_lite POWER9 idle states for Mambo platform 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" Mambo prior to Mambo.7.8.21 had a bug where the stop idle instruction with PSSCR[ESL]=PSSCR[EC]=0 would resume with MSR set as though it had taken a system reset interrupt. Linux currently executes this instruction with MSR already set that way, so the problem went unnoticed. A proposed patch to Linux changes that, and causes the idle code to crash. Work around this by disabling lite stop states for the mambo platform for now. Signed-off-by: Nicholas Piggin --- hw/slw.c | 111 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 110 insertions(+), 1 deletion(-) diff --git a/hw/slw.c b/hw/slw.c index 0720545c..d8829a6b 100644 --- a/hw/slw.c +++ b/hw/slw.c @@ -649,6 +649,112 @@ static struct cpu_idle_states power9_cpu_idle_states[] = { }; +/* + * Prior to Mambo.7.8.21, mambo did set the MSR correctly for lite stop + * states, so disable them for now. + */ +static struct cpu_idle_states power9_mambo_cpu_idle_states[] = { + { + .name = "stop0", + .latency_ns = 2000, + .residency_ns = 20000, + .flags = 0*OPAL_PM_DEC_STOP \ + | 0*OPAL_PM_TIMEBASE_STOP \ + | 1*OPAL_PM_LOSE_USER_CONTEXT \ + | 0*OPAL_PM_LOSE_HYP_CONTEXT \ + | 0*OPAL_PM_LOSE_FULL_CONTEXT \ + | 1*OPAL_PM_STOP_INST_FAST, + .pm_ctrl_reg_val = OPAL_PM_PSSCR_RL(0) \ + | OPAL_PM_PSSCR_MTL(3) \ + | OPAL_PM_PSSCR_TR(3) \ + | OPAL_PM_PSSCR_ESL \ + | OPAL_PM_PSSCR_EC, + .pm_ctrl_reg_mask = OPAL_PM_PSSCR_MASK }, + { + .name = "stop1", + .latency_ns = 5000, + .residency_ns = 50000, + .flags = 0*OPAL_PM_DEC_STOP \ + | 0*OPAL_PM_TIMEBASE_STOP \ + | 1*OPAL_PM_LOSE_USER_CONTEXT \ + | 0*OPAL_PM_LOSE_HYP_CONTEXT \ + | 0*OPAL_PM_LOSE_FULL_CONTEXT \ + | 1*OPAL_PM_STOP_INST_FAST, + .pm_ctrl_reg_val = OPAL_PM_PSSCR_RL(1) \ + | OPAL_PM_PSSCR_MTL(3) \ + | OPAL_PM_PSSCR_TR(3) \ + | OPAL_PM_PSSCR_ESL \ + | OPAL_PM_PSSCR_EC, + .pm_ctrl_reg_mask = OPAL_PM_PSSCR_MASK }, + { + .name = "stop2", + .latency_ns = 10000, + .residency_ns = 100000, + .flags = 0*OPAL_PM_DEC_STOP \ + | 0*OPAL_PM_TIMEBASE_STOP \ + | 1*OPAL_PM_LOSE_USER_CONTEXT \ + | 0*OPAL_PM_LOSE_HYP_CONTEXT \ + | 0*OPAL_PM_LOSE_FULL_CONTEXT \ + | 1*OPAL_PM_STOP_INST_FAST, + .pm_ctrl_reg_val = OPAL_PM_PSSCR_RL(2) \ + | OPAL_PM_PSSCR_MTL(3) \ + | OPAL_PM_PSSCR_TR(3) \ + | OPAL_PM_PSSCR_ESL \ + | OPAL_PM_PSSCR_EC, + .pm_ctrl_reg_mask = OPAL_PM_PSSCR_MASK }, + { + .name = "stop4", + .latency_ns = 100000, + .residency_ns = 1000000, + .flags = 1*OPAL_PM_DEC_STOP \ + | 1*OPAL_PM_TIMEBASE_STOP \ + | 1*OPAL_PM_LOSE_USER_CONTEXT \ + | 1*OPAL_PM_LOSE_HYP_CONTEXT \ + | 1*OPAL_PM_LOSE_FULL_CONTEXT \ + | 1*OPAL_PM_STOP_INST_DEEP, + .pm_ctrl_reg_val = OPAL_PM_PSSCR_RL(4) \ + | OPAL_PM_PSSCR_MTL(7) \ + | OPAL_PM_PSSCR_TR(3) \ + | OPAL_PM_PSSCR_ESL \ + | OPAL_PM_PSSCR_EC, + .pm_ctrl_reg_mask = OPAL_PM_PSSCR_MASK }, + + { + .name = "stop8", + .latency_ns = 2000000, + .residency_ns = 20000000, + .flags = 1*OPAL_PM_DEC_STOP \ + | 1*OPAL_PM_TIMEBASE_STOP \ + | 1*OPAL_PM_LOSE_USER_CONTEXT \ + | 1*OPAL_PM_LOSE_HYP_CONTEXT \ + | 1*OPAL_PM_LOSE_FULL_CONTEXT \ + | 1*OPAL_PM_STOP_INST_DEEP, + .pm_ctrl_reg_val = OPAL_PM_PSSCR_RL(8) \ + | OPAL_PM_PSSCR_MTL(11) \ + | OPAL_PM_PSSCR_TR(3) \ + | OPAL_PM_PSSCR_ESL \ + | OPAL_PM_PSSCR_EC, + .pm_ctrl_reg_mask = OPAL_PM_PSSCR_MASK }, + + { + .name = "stop11", + .latency_ns = 10000000, + .residency_ns = 100000000, + .flags = 1*OPAL_PM_DEC_STOP \ + | 1*OPAL_PM_TIMEBASE_STOP \ + | 1*OPAL_PM_LOSE_USER_CONTEXT \ + | 1*OPAL_PM_LOSE_HYP_CONTEXT \ + | 1*OPAL_PM_LOSE_FULL_CONTEXT \ + | 1*OPAL_PM_STOP_INST_DEEP, + .pm_ctrl_reg_val = OPAL_PM_PSSCR_RL(11) \ + | OPAL_PM_PSSCR_MTL(11) \ + | OPAL_PM_PSSCR_TR(3) \ + | OPAL_PM_PSSCR_ESL \ + | OPAL_PM_PSSCR_EC, + .pm_ctrl_reg_mask = OPAL_PM_PSSCR_MASK }, + +}; + /* Idle states supported for P9 DD1 */ static struct cpu_idle_states power9_ndd1_cpu_idle_states[] = { { @@ -750,7 +856,10 @@ void add_cpu_idle_state_properties(void) assert(chip); if (chip->type == PROC_CHIP_P9_NIMBUS || chip->type == PROC_CHIP_P9_CUMULUS) { - if ((chip->ec_level == 0x10) && + if (proc_chip_quirks & QUIRK_MAMBO_CALLOUTS) { + states = power9_mambo_cpu_idle_states; + nr_states = ARRAY_SIZE(power9_mambo_cpu_idle_states); + } else if ((chip->ec_level == 0x10) && (chip->type == PROC_CHIP_P9_NIMBUS)) { states = power9_ndd1_cpu_idle_states; nr_states = ARRAY_SIZE(power9_ndd1_cpu_idle_states); From patchwork Wed Aug 30 06:20:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 807433 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 3xhwPn29tcz9sNc for ; Wed, 30 Aug 2017 16:21:33 +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="d1D/82RG"; 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 3xhwPn12qZzDqHx for ; Wed, 30 Aug 2017 16:21:33 +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="d1D/82RG"; dkim-atps=neutral X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from mail-pf0-x244.google.com (mail-pf0-x244.google.com [IPv6:2607:f8b0:400e:c00::244]) (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 3xhwP108ndzDqJ3 for ; Wed, 30 Aug 2017 16:20:53 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="d1D/82RG"; dkim-atps=neutral Received: by mail-pf0-x244.google.com with SMTP id r187so3742430pfr.5 for ; Tue, 29 Aug 2017 23:20:52 -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=Zrw5B37hH4V6zGRXXvG+GOgRv2wPgWLr6wcCsoJG2d8=; b=d1D/82RGz/vso7ib7nyLCy5J5OfXIre9o57E0ltScE7OQbgbF480sUlq9cvjS+/9Wl Vt4ovocRd3FhCLqmtymKLnp0w80T3RomxBJNR0rHTBzmvmT5AtI2tQqLLolNYjP0k1Tn dEHsc/2MwduN/AYZtLoGtk8nPSKAnPitKogOGYUbKjI/5zdwBwj2uHBNLjnJxqTD80ZW dDvjzN/yfcuJoAQfsTehI3rExgHMl9PyNVVPrU0w8rvMDtrxOmxvkFne/K6SMF8Flf5e 6PnSv871mcsCNq750B16IWUApajWyazG25LRWbedSO7nANqLwBbI/ubadJgH/PnwhUf+ JT/Q== 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=Zrw5B37hH4V6zGRXXvG+GOgRv2wPgWLr6wcCsoJG2d8=; b=RvOTezeoT8PGI7QqNYcZ3oUaAPvk753G5csLfx0Aic77e1KIVQLdPVZqv6IWsoUmRQ TZ7n+otE6BQW3XfsBy8IVLseVro8oq9a3bR6vF/a0Rb4pLl9cqhsvSD+W2bmWkJdUviO 4EZIZwwI+IPDvxXWVdUtDZYonfXlnczF2TPM4XWzA8ryaHITWLH/dRRvtW5Q5efYbcLU XBX6wAGjgf+anmvy32jib4X+grLMpSjL0qgIlRcu31my6xcsH7FESW2MJj5x8SIgus7/ y2IymAfiP4XPyepoxCXsMSucl6Q014OZZoqII4TndAWeK3HK8SrT6mbOcVhWkT2P3z10 tU4A== X-Gm-Message-State: AHYfb5gyYnJ17c96zz206qPn0SBpO6Mhur+rjnC3mA/Cob/qO2PGTe33 bMOOMwZTlRm5Y7fN X-Received: by 10.84.217.150 with SMTP id p22mr642489pli.178.1504074050662; Tue, 29 Aug 2017 23:20:50 -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.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Aug 2017 23:20:49 -0700 (PDT) From: Nicholas Piggin To: skiboot@lists.ozlabs.org Date: Wed, 30 Aug 2017 16:20:11 +1000 Message-Id: <20170830062011.15199-4-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 3/3] init: add missing sync_icache after exception vector patching 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" There are two cases where sync_icache is not called immediately after instructions are modified. Signed-off-by: Nicholas Piggin --- core/init.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/init.c b/core/init.c index a96a69c8..8951e17b 100644 --- a/core/init.c +++ b/core/init.c @@ -384,6 +384,7 @@ static bool load_kernel(void) if (kernel_entry < 0x2000) { cpu_set_pm_enable(false); memcpy(NULL, old_vectors, 0x2000); + sync_icache(); } do_stb = true; stb_container = kh; /* probably incorrect */ @@ -723,6 +724,7 @@ void setup_reset_vector(void) dst = (uint32_t *)0x100; while(src < &reset_patch_end) *(dst++) = *(src++); + sync_icache(); } void copy_exception_vectors(void)