Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp18936pxb; Fri, 15 Jan 2021 04:50:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJwohfE0qU0BbbDzM0mfP24V55aIrjM+TGvcHlD2sgSSvQ4tOYkzlU9ALdogTygeRJAXrmvc X-Received: by 2002:a17:906:6a8a:: with SMTP id p10mr8413533ejr.169.1610715043233; Fri, 15 Jan 2021 04:50:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610715043; cv=none; d=google.com; s=arc-20160816; b=T3oX7T/4kkW2ESl3l8rSZN42MM0uh3VNV0KGoy0xG8tfRA9gniSHu2PIpQm+ilc9Pq W9zKal8c/40zIzk5tcstbe/eJ6kq9qM/3FyufrmH7UzBsjndFe4o9JBZnTewz3xp0Zoh UepbfQD6QmXiQeFcpCAqxLGFC3b5RxD752gmElpZrwFpkyrY4BdmDPT9wHqLSOiSKwI7 37yHhn6iJQsgTqgPgoPr9ZH+xALIafxa5xLZje+GV5ocljpDqr/rUrotMPiBB5/HQFq6 wBTvmyHBYic9ldQH8DhehJAgdx1F6acnFIunH0korr4Aki42lb0foOPP4MWlfN74VOrh v7Kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=g+gjObfeNpIGrBEB9DS7cQIto1K34N5gNQ02+MJ/5PY=; b=o2PsyuBI3uRbTV1JeN/KrBKokaxAEv5Nvlpvk/YlPw4GKn8f4Br2l/u+en84HvMCGT HLPm6zrVhASPVbHjujx94ESyacX+UTV2bddbw+O2iTVTaCR1FUGyMnO6qEM1dSzx4zfZ xerny3DEk16yUxQ3Bqjau7y9Ateda2oXCLm7nxHghovfcuTK9/bKqnbqOoxjGjgauMKR MU4Gn02UNm39qZR/6d/ToS4NClidZfk/ksVett8oJ3zHzrfNSlwW64w8s9Xze9lAp3Ur 1YHeWGXTK3JPdtNQ1NxQyYmUaNW/7FdqeJTQ4F6NLpDlm33z8G7nFW/U3P4DoTR23fx6 bhag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nSLO9JL6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c23si2574903edj.524.2021.01.15.04.50.19; Fri, 15 Jan 2021 04:50:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nSLO9JL6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732906AbhAOMgk (ORCPT + 99 others); Fri, 15 Jan 2021 07:36:40 -0500 Received: from mail.kernel.org ([198.145.29.99]:43778 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732844AbhAOMgg (ORCPT ); Fri, 15 Jan 2021 07:36:36 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id B4BF523136; Fri, 15 Jan 2021 12:35:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610714156; bh=+z3tkAt1O8PXv7548J5zbfZy4EYIjOYAoO9nih98JEE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nSLO9JL6GjLMDeVSCC8K1ISvAKuZj/qcwmuvPq4u5w+ulmDw9ql9mFrp1fE6TKi8f tBjXuNGvEcUJ6agIYU8MlCXst2MRDU5YQn9rM2l20TyOwpgYB2+ttA5078I8RvyhCC 7De8ieCFfEVhECQUvaLupXP5OTq7ciQu0Q2nnppM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe Leroy , Michael Ellerman , Sasha Levin Subject: [PATCH 5.10 001/103] powerpc/32s: Fix RTAS machine check with VMAP stack Date: Fri, 15 Jan 2021 13:26:54 +0100 Message-Id: <20210115122006.122859786@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210115122006.047132306@linuxfoundation.org> References: <20210115122006.047132306@linuxfoundation.org> User-Agent: quilt/0.66 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christophe Leroy [ Upstream commit 98bf2d3f4970179c702ef64db658e0553bc6ef3a ] When we have VMAP stack, exception prolog 1 sets r1, not r11. When it is not an RTAS machine check, don't trash r1 because it is needed by prolog 1. Fixes: da7bb43ab9da ("powerpc/32: Fix vmap stack - Properly set r1 before activating MMU") Fixes: d2e006036082 ("powerpc/32: Use SPRN_SPRG_SCRATCH2 in exception prologs") Cc: stable@vger.kernel.org # v5.10+ Signed-off-by: Christophe Leroy [mpe: Squash in fixup for RTAS machine check from Christophe] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/bc77d61d1c18940e456a2dee464f1e2eda65a3f0.1608621048.git.christophe.leroy@csgroup.eu Signed-off-by: Sasha Levin --- arch/powerpc/kernel/head_book3s_32.S | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch/powerpc/kernel/head_book3s_32.S b/arch/powerpc/kernel/head_book3s_32.S index a0dda2a1f2df0..d66da35f2e8d3 100644 --- a/arch/powerpc/kernel/head_book3s_32.S +++ b/arch/powerpc/kernel/head_book3s_32.S @@ -262,10 +262,19 @@ __secondary_hold_acknowledge: MachineCheck: EXCEPTION_PROLOG_0 #ifdef CONFIG_PPC_CHRP +#ifdef CONFIG_VMAP_STACK + mr r11, r1 + mfspr r1, SPRN_SPRG_THREAD + lwz r1, RTAS_SP(r1) + cmpwi cr1, r1, 0 + bne cr1, 7f + mr r1, r11 +#else mfspr r11, SPRN_SPRG_THREAD lwz r11, RTAS_SP(r11) cmpwi cr1, r11, 0 bne cr1, 7f +#endif #endif /* CONFIG_PPC_CHRP */ EXCEPTION_PROLOG_1 for_rtas=1 7: EXCEPTION_PROLOG_2 -- 2.27.0