From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 96B79606A31A for ; Wed, 2 Dec 2026 06:12:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=piOsx0l+; dkim=pass (1024-bit key, unprotected) header.d=huawei.com header.i=@huawei.com header.a=rsa-sha256 header.s=dkim header.b=W+DylC7A DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:CC:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Unsubscribe-Post: List-Owner; bh=2qiyereuiJEvsVZzJw6d+aTfpj3uAXkZRss3YGnzh0A=; b=piOsx0l+rZBDxW e7vtncfBeuAagWZ/tJOj36ARF9pZ4Y72crpmmR8o/AH1m0by8+rDYte3kcgs9mzUhpHS0Rs3eTuis p7wj0g4UmYUfHHlHkFveNBToJ/Z4Sm95tMw3mn46e0rpel2hHFLkj2QrHnjBIfoUjBC9oBTX/cJw7 XpA6SZqx7QJdrL1aV7qnRoLbEnuo3VpLcUTx4FP4twQqyWJ4DWI6CYU5hw8TIEZYMzrIoZkJCfnYA dVpSQwAzZXoZRY0TkDwJ49KHd5BgPCqxPryebnMyzkAyMEir27+hOj35hULEU+zqRlyOsWtyWSxsk TtEOwW+fWM6oM5ADP/dw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYdZU-0000000ANCY-3EzF; Wed, 02 Dec 2026 06:12:04 +0000 Received: from canpmsgout12.his.huawei.com ([113.46.200.227]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYdZQ-0000000ANCB-0u6o for linux-arm-kernel@lists.infradead.org; Wed, 02 Dec 2026 06:12:02 +0000 dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=2qiyereuiJEvsVZzJw6d+aTfpj3uAXkZRss3YGnzh0A=; b=W+DylC7Az5cE7iwZinRyY7W1/Rv2DIzVTdKIvJm2be53pTHaBVaiQMD15UfYSABTefIa/kuSr aGSY/wUpKxbb+8PeGu/kWnmmUXolnyXH+iH0FKCLnvdglvR8rHTPXPJ+SXzZ4XFF41YNVGiHIRD jCg16XqiSXhDnjn5E7ny+eQ= Received: from mail.maildlp.com (unknown [172.19.163.15]) by canpmsgout12.his.huawei.com (SkyGuard) with ESMTPS id 4jfS7H4Px4znTVd; Wed, 2 Dec 2026 14:11:07 +0800 (CST) Received: from kwepemk200008.china.huawei.com (unknown [7.202.194.74]) by mail.maildlp.com (Postfix) with ESMTPS id A25D84058E; Wed, 2 Dec 2026 14:11:52 +0800 (CST) Received: from [10.67.110.68] (10.67.110.68) by kwepemk200008.china.huawei.com (7.202.194.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.45; Wed, 2 Dec 2026 14:11:51 +0800 Message-ID: <98742f45-9079-402d-8e22-51639b8af7ec@huawei.com> Date: Wed, 2 Dec 2026 14:11:51 +0800 X-Archived-By: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 06/44] arm64: smp: Prefer hardware NMI over SDEI NMI To: Vladimir Murzin , CC: , , , , , , , References: <20261130155506.118408-1-vladimir.murzin@arm.com> <20261130155506.118408-7-vladimir.murzin@arm.com> From: Jinjie Ruan In-Reply-To: <20261130155506.118408-7-vladimir.murzin@arm.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-ClientProxiedBy: kwepems100001.china.huawei.com (7.221.188.238) To kwepemk200008.china.huawei.com (7.202.194.74) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261201_221200_860090_E4844DD2 X-CRM114-Status: GOOD ( 19.23 ) X-Spam-Score: -2.8 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 在 2026/11/30 23:54, Vladimir Murzin 写道: > SDEI NMI is expected to be used when hardware-based NMI is either > unavailable or disabled. However, when both are available, > arch_trigger_cpumask_backtrace() still prefers SDEI NMI. > > Historically, we could not guarantee that an IPI was backed by a > hardware NMI, as the interrupt controller could lack NMI support or > refuse to configure the IPI as an NMI. > > Now that we can check whether an IPI is backed by a hardware NMI, > prefer it over SDEI NMI in arch_trigger_cpumask_backtrace(). > > Signed-off-by: Vladimir Murzin > --- > arch/arm64/kernel/smp.c | 19 +++++++++++++++++-- > 1 file changed, 17 insertions(+), 2 deletions(-) > > diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c > index 7d4a31ee9a4c..9e5b4bcc6316 100644 > --- a/arch/arm64/kernel/smp.c > +++ b/arch/arm64/kernel/smp.c > @@ -955,14 +955,29 @@ static void arm64_backtrace_ipi(cpumask_t *mask) > arm64_send_ipi(mask, IPI_CPU_BACKTRACE); > } > > +static bool arm64_nmi_trigger_cpumask_backtrace(const cpumask_t *mask, int exclude_cpu) > +{ > + if (!ipi_is_nmi(raw_smp_processor_id(), IPI_CPU_BACKTRACE)) > + return false; If ipi_is_nmi is true, it can be either a FEAT_NMI or a pseudo NMI, does what you call hardware NMI include pseudo-NMI? > + > + nmi_trigger_cpumask_backtrace(mask, exclude_cpu, arm64_backtrace_ipi); > + > + return true; > +} > + > void arch_trigger_cpumask_backtrace(const cpumask_t *mask, int exclude_cpu) > { > + /* > + * Backtrace IPI is NMI, use that. > + */ > + if (arm64_nmi_trigger_cpumask_backtrace(mask, exclude_cpu)) > + return; > + > /* > * Prefer the SDEI cross-CPU NMI provider when active: firmware > * dispatches the event out of EL3 and reaches CPUs that have > * interrupts locally masked, without the per-IRQ-mask cost that > - * pseudo-NMI pays for the same reach. The plain IPI path below > - * can't reach such a CPU unless pseudo-NMI is enabled. > + * pseudo-NMI pays for the same reach. > */ > if (sdei_nmi_trigger_cpumask_backtrace(mask, exclude_cpu)) > return;