From patchwork Sat Oct 22 07:26:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7533 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1105836wrr; Sat, 22 Oct 2022 01:36:17 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6mwoKRIS04cKI+FPNiJ+rsUvcz7eaxzw2KzgK698+NvOiUoTgIqr6tgV9N55Wvz1Tbmdcb X-Received: by 2002:a17:90a:e10:b0:211:9e6a:a099 with SMTP id v16-20020a17090a0e1000b002119e6aa099mr15665460pje.27.1666427776822; Sat, 22 Oct 2022 01:36:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666427776; cv=none; d=google.com; s=arc-20160816; b=n7zozHxOIDGS0YCs3D5GebTPaIthoUWQF8jZPk71vxxK7JFRx1KPgm3TwL6vY68kZm BEjeSk27jtr7IqSRViNrbtkZeiB0SHvHpd5f+F1oCh73aYtHiEXsW+xnbxCoUfC6NaaI +RIKJ9HiTduiNhl/oWMYBCXe4XHRbGM97v6YslVJZv6axpiActbsWCf0hxAX+8uRzAZO sofwIAassZK+3QKoJ2P4KF3x690Rgq95/zVz2oZgYZLBs7oZ+LFqcsUSopyDZkB54Hen Ba7zC+B7eLIqeCf8kKU8ELuVKJSHkFQnBqEvE6w6eyqyva5hs1dwKygcboyyQ1H9fHli z66A== 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=9R6fYnDo9S9LmZvSen/lNRxgBS5WiRoJUKkUQDFaQJg=; b=pdupqu6z8EIVqHufFe0qLLhcUsgVq/R84qk3SILnJxHAehFOnUHzBfK2i9o+JzZ67c Qdhqy3OUhjB/0xRmNkzG8m/NQ2JmpPBDxEl5fkmEKn5RrJNBpmEomBFPGXu3jvmcdg+P 51oSD+vRmH/373lqbzU5GUlLm8oBtOcsItp6MySNAzv0Z7j2uGGK02XSoLf7IDWY/1+N VFnhk9eU+ltWOgs7ooVMo00x6/5WZkr6xNgsn9Zupprt5zWsMAEoIlWDxwekIZSemLJt 607NBOy3IRiq0QB/keOglNv4doIWkNDVTrNb2v5zoZCNnQTQwr+h24DbWsfvjG0YFzNo OClA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mmMnhZSO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n15-20020a170903110f00b00178b88d40ebsi32805993plh.51.2022.10.22.01.35.59; Sat, 22 Oct 2022 01:36:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mmMnhZSO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S229973AbiJVIZe (ORCPT + 99 others); Sat, 22 Oct 2022 04:25:34 -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 X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747376172271495973?= X-GMAIL-MSGID: =?utf-8?q?1747376172271495973?= 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 interrupts 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 = 1; /* Allow percpu accesses to work until we setup percpu data */ get_paca()->data_offset = 0; - /* Mark interrupts disabled in PACA */ + /* Mark interrupts soft and hard disabled in PACA */ irq_soft_mask_set(IRQS_DISABLED); + get_paca()->irq_happened = PACA_IRQ_HARD_DIS; + WARN_ON(mfmsr() & MSR_EE); } static void __init configure_exceptions(void)