Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1135228rwi; Wed, 19 Oct 2022 07:08:36 -0700 (PDT) X-Google-Smtp-Source: AMsMyM71j9Ol6xXvpecU69WWbGkuQuqJKGCoCucbd6vTp4h7EuHZiTD+t29qFf3MKojBhf9Aouup X-Received: by 2002:a50:c31b:0:b0:458:cc93:8000 with SMTP id a27-20020a50c31b000000b00458cc938000mr7963082edb.264.1666188516033; Wed, 19 Oct 2022 07:08:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666188516; cv=none; d=google.com; s=arc-20160816; b=JH/ftzTMhFJYRAgsD7YWe/sKqo+lZ/OkZA50dnh3lc6B7MNjrVqfqbiBj/fsehTmjV 7JWI8eClUqJetjZ/qJ792OWZFRNo4hSt6HBp/NU1yctKKI0lpW7dnYGD9pUzMKfjzRoU ygbS0kQWGIPtNT7CoXrRzNd7IvVw2FzVNklyFWiCpCnTmCParKId/44kaANv4L3BUjvf lrqz1lTDw3yFVjGSwJsKzrp/tMEpKEc/FGd2s20fXiJV6Nx///mTRriataHk3THtcefW v9yxyQfMd29as8fIo+ohT9bEfwLXXrc33fMQMXRfmQwUQzi1R4PFJ49EG2iINePV213P 4W8g== 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=J49ljuCd4+/EN5zBi3AjLqEz06q39O0p5lXY+cqbf60=; b=ntz8mx0NZ3pfUEIODJYDVtx9KK5Xn6XNVgHsIFNUaQHdj+VdHTkjC+gwB9YDXjEWRj Tdlj6lt1uyWzYPp5ee/bedCbN/A5tECcwbuKsdirLNMsTg4CAGwC2G9yO4CXmpCiGgf0 Glg6pbYRqTbLK3Tmls1ql5ZX40jfVEI6QolZgaK4g8XgActexHxoHZAB1bzDq2seQfY+ l2FWidCJJdCqWH0faUaN28RT9MxNyR6sV3iXjhd88OGvN1XZjpRdzUPLD6Ziw2ugOFDd g79CGUbpjatdR1bEXmUqxyq+v5Y9e22cfUqYlH+74tFXZbXKGOP+OpbF+ia+AkT83qG3 jkZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="nDlQE/Ni"; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hr41-20020a1709073fa900b0078debc9d30esi14011243ejc.29.2022.10.19.07.08.10; Wed, 19 Oct 2022 07:08:36 -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="nDlQE/Ni"; 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 S233251AbiJSNsX (ORCPT + 99 others); Wed, 19 Oct 2022 09:48:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233441AbiJSNq6 (ORCPT ); Wed, 19 Oct 2022 09:46:58 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 551A74F64C; Wed, 19 Oct 2022 06:32:23 -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 sin.source.kernel.org (Postfix) with ESMTPS id 577EBCE217D; Wed, 19 Oct 2022 09:05:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2F279C433B5; Wed, 19 Oct 2022 09:05:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666170343; bh=7iUnay9kotKl5KdpScGWZwxW0SDdUw4cc9DqQlkzRvc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nDlQE/NijiG0/iOTfLRd9IRxFpnzmtD6DXaBmMcPYWkf/lFTr4fBtw8NmUAfaJACD EihexMG8S6/63n2nMMa0ycJbSO4QS1ZYzJr7/C9AQyX1xC4WwmVeijKlK0cStq2mSx b5Li1+UEKyX+a45GwOy+6N0M6a/9RiDjtk0/XnbI= 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 6.0 619/862] powerpc/64: mark irqs hard disabled in boot paca Date: Wed, 19 Oct 2022 10:31:46 +0200 Message-Id: <20221019083317.283134398@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.4 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 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 2b2d0b0fbb30..ce8fc6575eaa 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c @@ -182,8 +182,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) -- 2.35.1