From patchwork Tue Oct 24 11:41:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 829875 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 3yLrw16BMHz9t2l for ; Tue, 24 Oct 2017 22:41:53 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="jT7iYAJk"; 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 3yLrw14GyCzDqln for ; Tue, 24 Oct 2017 22:41:53 +1100 (AEDT) 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="jT7iYAJk"; dkim-atps=neutral X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:400e:c00::244; helo=mail-pf0-x244.google.com; envelope-from=npiggin@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="jT7iYAJk"; dkim-atps=neutral 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 3yLrvN2Qb9zDqYv for ; Tue, 24 Oct 2017 22:41:19 +1100 (AEDT) Received: by mail-pf0-x244.google.com with SMTP id n89so19460282pfk.11 for ; Tue, 24 Oct 2017 04:41:19 -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=OKe52rq/oBwh0atZ+W2nbXKZWDAaLp+iiwQk71v1LQU=; b=jT7iYAJktMlc3TC62+xlWLgtB2Kr12MKJvTPbiprVLawxKZUvWIJ8mtS/CsOYcZIBJ pgJPkx9K29IY/UvFPZPSjhUUX3qOvTTFsM+7OyVHTZJz20fXAYplw+wDeF59NxrKnFww 9NRgOLUpB9xuxdbUgbxU/IGAkn15JGXcWWZmb1giA+4EPMTdpulhUfjRaGqS0nPbxsY7 vZxPCYHtHFp+BDA776cSviWzAwIjnAmwaW2mS+x+G1pV2K0xcAtDbttIiQIFCAzI3Kye 7yhcVRekgBsYAAhSE9DmQa+Vzd96Wor9ZLLVoeiUTtuow6iCZG7KWBeaRG0I7APY7afp ypBQ== 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=OKe52rq/oBwh0atZ+W2nbXKZWDAaLp+iiwQk71v1LQU=; b=Q7qyUo0VwbODId4xeyXY8/sKxXoEcaUrV3Is28k4oYYaC9muPpl6/pWFSn6mX4jqG6 I4QmpsWUd1gq8tg/KtzAEzYoBH32bUXH/X+ffFPE4MTysi0oWdXIOPxl6SZe+Di+c2GY inTQcO9iNL1JYfKDAZoZXEvb7IVDdkl52KGR7gGUXWESKxizlhu3P1SQ/UZmf6RotuY0 g0FHJI2gOJTrNA1TFJWP98zMepOqDTbWn3+GUAzKpjLZTd9RgGBT3MBZ7tA8Lq+e3Zvz 0YlwJn8QwgZrPefoXuGQXvBq1sLTWpLvCPGu75232Xwzp7JNFi7lAu0NM5BVlUXIvjZ0 b8rg== X-Gm-Message-State: AMCzsaUZlLOxhlR/kLH1utDbQRAv5vofEVMa/bGe0+fNE0dbSdORTLLG +rKN8/sfvcciQPgfHFZHhDXYpQ== X-Google-Smtp-Source: ABhQp+QJm1pOx3x67NrnJ6M4cggMA3blsOI9GmQSz43OeKP2+IPcoRbZRM1MuxVmRiBsNglRd6Tt0A== X-Received: by 10.84.241.129 with SMTP id b1mr13040123pll.103.1508845277518; Tue, 24 Oct 2017 04:41:17 -0700 (PDT) Received: from roar.au.ibm.com (59-102-69-156.tpgi.com.au. [59.102.69.156]) by smtp.gmail.com with ESMTPSA id q77sm286187pfd.84.2017.10.24.04.41.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Oct 2017 04:41:16 -0700 (PDT) From: Nicholas Piggin To: skiboot@lists.ozlabs.org Date: Tue, 24 Oct 2017 21:41:00 +1000 Message-Id: <20171024114100.13714-3-npiggin@gmail.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20171024114100.13714-1-npiggin@gmail.com> References: <20171024114100.13714-1-npiggin@gmail.com> Subject: [Skiboot] [PATCH 2/2] cpu: Unconditionally re-initialise SPRs in opal_reinit_cpus() X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.24 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" opal_reinit_cpus should re-initialise SPRs to their boot state, because it should things according to the boot state. This solves the problem that the hypervisor may change SPRs before kexecing to a new kernel. Signed-off-by: Nicholas Piggin --- core/cpu.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/cpu.c b/core/cpu.c index 27e0d6cf..02f6a613 100644 --- a/core/cpu.c +++ b/core/cpu.c @@ -1246,6 +1246,13 @@ void cpu_set_radix_mode(void) static void cpu_cleanup_one(void *param __unused) { + struct cpu_thread *cpu = this_cpu(); + + /* Bring SPRs back to boot state */ + if (cpu_is_thread0(cpu)) + init_shared_sprs(); + init_replicated_sprs(); + mtspr(SPR_AMR, 0); mtspr(SPR_IAMR, 0); }