From nobody Fri Dec 19 20:12:26 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1332DC04A95 for ; Sat, 22 Oct 2022 08:25:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233538AbiJVIZg (ORCPT ); Sat, 22 Oct 2022 04:25:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233768AbiJVIXE (ORCPT ); Sat, 22 Oct 2022 04:23:04 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C280B169CD6; Sat, 22 Oct 2022 00:59:14 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E9A2360AFA; Sat, 22 Oct 2022 07:57:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EE065C433D6; Sat, 22 Oct 2022 07:57:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666425438; bh=+7vq+AHutYpGIBBik1KRpBUm4rIJ77U6/TMEBYvCzxg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mmMnhZSOTHy5ozqUrDd7fGFUa6MeQh6SVsw11FEAOThC3r2yKzb5APmPE+nW+Azyx l5HBpJMrGiC2x5iXHH+6maHbwh4HZi56ObXd0Fn64kg7Q7no/RAxjzGkm2l/itPDeY zkzhn3UqXql6aQ1BMam57CkZhazcd95NfmPnYK/c= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nicholas Piggin , Michael Ellerman , Sasha Levin Subject: [PATCH 5.19 502/717] powerpc/64: mark irqs hard disabled in boot paca Date: Sat, 22 Oct 2022 09:26:21 +0200 Message-Id: <20221022072520.473745835@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Nicholas Piggin [ Upstream commit 799f7063c7645f9a751d17f5dfd73b952f962cd2 ] This prevents interrupts in early boot (e.g., program check) from enabling MSR[EE], potentially causing endian mismatch or other crashes when reporting early boot traps. Fixes: 4423eb5ae32ec ("powerpc/64/interrupt: make normal synchronous interr= upts enable MSR[EE] if possible") Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220926054305.2671436-3-npiggin@gmail.com Signed-off-by: Sasha Levin --- arch/powerpc/kernel/setup_64.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index 5761f08dae95..6562517bcb3b 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c @@ -183,8 +183,10 @@ static void __init fixup_boot_paca(void) get_paca()->cpu_start =3D 1; /* Allow percpu accesses to work until we setup percpu data */ get_paca()->data_offset =3D 0; - /* Mark interrupts disabled in PACA */ + /* Mark interrupts soft and hard disabled in PACA */ irq_soft_mask_set(IRQS_DISABLED); + get_paca()->irq_happened =3D PACA_IRQ_HARD_DIS; + WARN_ON(mfmsr() & MSR_EE); } =20 static void __init configure_exceptions(void) --=20 2.35.1