Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2192867iof; Tue, 7 Jun 2022 22:45:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgNiUjF8HrH1/495XCPiMlu4B5XH706xqLLRLTfAjqag4G4tMJnwEsMQyZCwYlpDKzpWRx X-Received: by 2002:a65:694a:0:b0:3fb:9d3b:431b with SMTP id w10-20020a65694a000000b003fb9d3b431bmr28995342pgq.276.1654667154544; Tue, 07 Jun 2022 22:45:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654667154; cv=none; d=google.com; s=arc-20160816; b=nh823ZKbljiFOYnN+K1y1cxrUy9E6ukcbSG5oZ9HBH8/AT0kd2Ykln2Ox0omZC8RFu Zfe5SyKSKHFpw5zeGiDor924Xp5pUJ82X+GjfMTqgs3iwXSTCsGzGXPFwLCE0xP5E1ZJ 0BddXMtwQUUeFcrNo2eD9EVfK/zMt4Iw04pBUGX26JoxkwPbyprtrzj5hM2RsSJ4wBVb VVwQMJHNtUL+gfMzvTVL8aB6gHP8UpGobESgTMYraAGG7FzJhjnwca8FDFQHvQZqqL6T KnbLGxoB0x8KLQgtOPDtuKb+EPa7EfgixyU4/Y+migG6IKDOFFOTfPZwneA/M9xjNfQD TYog== 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=L2qs3jCj05NnQhOVfzEaVvil3LG8bLO2qhOOPvxX0sQ=; b=NLXmSLv/oNxA6xJHhDsce8e86Con8KsuwjObLdfpqDijGGuOEut2RdlQOBWSYe6vXl v3PrhgVEM1BQpPyNBaAH+diiVaIgIIfPzzbEW6v/SNNcAgGaTxWeok0768r/U8gbMhXZ 3c9lC9yMHSemm2krItv84Q1MWoYUPtgF5YriEubWJTt+UN40ysBo4V36TRFRqY2IZ+VJ A6hzDqO/1SXOvLKx3B4aC/R9RmK5B90Mw2I/IVnHpEHiNRiSu0GXdST3pElVII9iLdAU 2tWPD560k3kMCH9aVZNLw5qrPDY84qft0KMP+0RrUY2XxcMCY9C82VpaJfSBCg0B4ZeH rgdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hDxBsa2w; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id d188-20020a6368c5000000b003fd8db8b97csi12798869pgc.600.2022.06.07.22.45.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 22:45:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hDxBsa2w; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 18B394158AF; Tue, 7 Jun 2022 22:10:43 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1386945AbiFHAWo (ORCPT + 99 others); Tue, 7 Jun 2022 20:22:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1382203AbiFGVuE (ORCPT ); Tue, 7 Jun 2022 17:50:04 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7469C190D22; Tue, 7 Jun 2022 12:08:38 -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 ams.source.kernel.org (Postfix) with ESMTPS id D39A1B8220B; Tue, 7 Jun 2022 19:08:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4C685C385A5; Tue, 7 Jun 2022 19:08:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654628915; bh=7ADwI4ceJ9tEh1nUpeN96td1EOsOqnWLQPLVG7+l0rw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hDxBsa2wHxHxlkz7O5p3KWa4gLp1OuTUrwpekJYrlNse7Pb70g/TwsUc7Pum/WcoB DZ3NoU1Nh4RxF+hbvXS7l3Jeqoc33AjlWAbUinslWGOpA1iAfk8KsP9WeZcda+iTQf vaKU1TjXi1yMwc+gasCwmes/UyUso43jZqplCWEg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mark Rutland , Marc Zyngier , Thomas Gleixner , Will Deacon , Sasha Levin Subject: [PATCH 5.18 462/879] irqchip/gic-v3: Ensure pseudo-NMIs have an ISB between ack and handling Date: Tue, 7 Jun 2022 18:59:40 +0200 Message-Id: <20220607165016.284240302@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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: Mark Rutland [ Upstream commit adf14453d2c037ab529040c1186ea32e277e783a ] There are cases where a context synchronization event is necessary between an IRQ being raised and being handled, and there are races such that we cannot rely upon the exception entry being subsequent to the interrupt being raised. We identified and fixes this for regular IRQs in commit: 39a06b67c2c1256b ("irqchip/gic: Ensure we have an ISB between ack and ->handle_irq") Unfortunately, we forgot to do the same for psuedo-NMIs when support for those was added in commit: f32c926651dcd168 ("irqchip/gic-v3: Handle pseudo-NMIs") Which means that when pseudo-NMIs are used for PMU support, we'll hit the same problem. Apply the same fix as for regular IRQs. Note that when EOI mode 1 is in use, the call to gic_write_eoir() will provide an ISB. Fixes: f32c926651dcd168 ("irqchip/gic-v3: Handle pseudo-NMIs") Signed-off-by: Mark Rutland Cc: Marc Zyngier Cc: Thomas Gleixner Cc: Will Deacon Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220513133038.226182-2-mark.rutland@arm.com Signed-off-by: Sasha Levin --- drivers/irqchip/irq-gic-v3.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index b252d5534547..7305d84f2df5 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -654,6 +654,9 @@ static inline void gic_handle_nmi(u32 irqnr, struct pt_regs *regs) if (static_branch_likely(&supports_deactivate_key)) gic_write_eoir(irqnr); + else + isb() + /* * Leave the PSR.I bit set to prevent other NMIs to be * received while handling this one. -- 2.35.1