From patchwork Wed Oct 19 08:31:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 5525 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp337322wrs; Wed, 19 Oct 2022 06:49:00 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6uEkUxgzGSZZZBhbpRDhx2Bx7fZSpWtSGIev0CxGCMlpN3ti06K5ofP7Lzx2fVCST4R8Y9 X-Received: by 2002:a17:902:7598:b0:178:3f96:4ffc with SMTP id j24-20020a170902759800b001783f964ffcmr8879956pll.53.1666187340260; Wed, 19 Oct 2022 06:49:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666187340; cv=none; d=google.com; s=arc-20160816; b=Rw9bK6NeN2EzPb+E+trwBm72Anuqdn4XloJqGUkIdyjWWr3uhty4WQ7VbNSjnRAuaD F/qxJpYb7wiyYLu4FvqUMeCHj/UoAy6NmaJmWUtQ0GG4N3KFgoggTcCq4DFrIUmAhKou Cdn2fOO509A2t5ZH/c2KWNBrmvFMXM1iWHMUvrV1UbnCKVsK7d3ulXAioBmBmxEY9jTp lWsOCkLnBlJr6LXqEqe6zWLgrSVs/0wJZnE/w5d6qEauzpsxMDeNcku0GLYQAU+qB676 WjP+i0FfNtNDj4gsyIIiRGAHJcI2Ce9LmDPYzGyK/GngWBHl9juHD81heMj/6M8PzEfu 6Gag== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c13-20020a655a8d000000b0043c0b4f2b68si18948168pgt.318.2022.10.19.06.48.44; Wed, 19 Oct 2022 06:49:00 -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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747124056304812259?= X-GMAIL-MSGID: =?utf-8?q?1747124056304812259?= 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)