Message ID | 20240201094604.3918141-1-xin@zytor.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-47909-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2719:b0:106:209c:c626 with SMTP id hl25csp35673dyb; Thu, 1 Feb 2024 01:47:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IG+3u6sspUzYf7nTlvBiB9LdqHcKifmIgdez96qoF2YbFN2o9IaFQgKEt9hi2lTdnf1SEsq X-Received: by 2002:a17:906:c43:b0:a35:f2a6:3172 with SMTP id t3-20020a1709060c4300b00a35f2a63172mr2660884ejf.43.1706780833192; Thu, 01 Feb 2024 01:47:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706780833; cv=pass; d=google.com; s=arc-20160816; b=VyBYqUTKzvVOAAxOcXOSQGknaWLwIYQmA9/lLcPr2Lz5Syeq5ElZAdfjb6jki78quW InuaKtdshSOkQmeHF6YNvntY9HU15EPkyDqjt8zNNKVh79lBV1mIoa9WPuAfAE4G8O54 QahyfawZACt40D64Gyu4HLAwVLJuZcnQmQM2oXY5DAa0fBCfyJ01LCaeW5PIezgqbB60 EZYwgzaa6d7Hv1SLJ9iD54GVjO64xwVfw8+Bz7zqhO0lmIWlBPOxTt4sczHKelIy4sfZ Dk8hvn54hfRJVzT3smS+Z3mPmXgoHmOVEnQvg5bwEoAD+JnZmLcvAMqqfLgrBqO+uWrJ rVmQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature:dkim-filter; bh=vjcWBDBUoGUeHxYNPS1IXd9Yqbe6TvxBMc8AURC1JUU=; fh=gPtLqduhEU7hY6QDmDoweDEOdFeb/PGJYbDlZURqUmM=; b=PduzGRzcLunCjbpETpJagc18R53YUWWC+xGEO+A3LP6oPIj6+qNUUm8ZpOrOlSQpG7 WWFEe+6Y0PaMfYMzgc3N4N+WPyxi4+ZpJNh87OGt7lrUdJVKvDonIs820u34R8yhZmtS IAsrTlF3uidEPpn0YoTuKfJ/bH4T3kY6GYZsJL9VMOe0uPasISwRUwVqkZC0a7o0mNR/ +ThcOgQIR4ClZrWxYl2jIohpvZRznI+yX4sOtGEQI6g3zO/BZjFQi4UcpUbO4bz66w4d K/p1upKj2nxZ2W2yx/+d4quM/p7+T4D3xNMIajPRx5rZMBgwoggRC6IoGphzIdOm0dEh y/0g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@zytor.com header.s=2024011201 header.b=TQcDCnUs; arc=pass (i=1 spf=pass spfdomain=zytor.com dkim=pass dkdomain=zytor.com dmarc=pass fromdomain=zytor.com); spf=pass (google.com: domain of linux-kernel+bounces-47909-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47909-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com X-Forwarded-Encrypted: i=1; AJvYcCU91B+hAmJWNj/2LfEn26JViaP+uaE5167Jeyt2WtmRpYn/axtKX2dCLDDnMWdXckLrcS1c53zK6DQ6LSZjICRFClsw0w== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id z1-20020a1709063ac100b00a35b7e6d3ddsi4079165ejd.51.2024.02.01.01.47.13 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 01:47:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47909-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@zytor.com header.s=2024011201 header.b=TQcDCnUs; arc=pass (i=1 spf=pass spfdomain=zytor.com dkim=pass dkdomain=zytor.com dmarc=pass fromdomain=zytor.com); spf=pass (google.com: domain of linux-kernel+bounces-47909-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47909-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 078501F29ED5 for <ouuuleilei@gmail.com>; Thu, 1 Feb 2024 09:46:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 82D4A1586E6; Thu, 1 Feb 2024 09:46:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=zytor.com header.i=@zytor.com header.b="TQcDCnUs" Received: from mail.zytor.com (terminus.zytor.com [198.137.202.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 41A154D9F3 for <linux-kernel@vger.kernel.org>; Thu, 1 Feb 2024 09:46:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.136 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706780800; cv=none; b=GIDH7B2XYeCaJij/iIOOzoqRM647UKqliVQf3qBg1xygzDUkO9uu1aF2LLdBW6S0h33NxVuVOpe1oIv0J0IHPvPt3bCe9VwA6Cm2Qotx/xqojFV9/4Sfa0BHZxl/XwcZJY7c8Fyzr9oKzZpZTjx7udGk0zDHFwaMYvBUtvsG5JU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706780800; c=relaxed/simple; bh=kKYjNvK4oZU2NxCNeQBgkFZ76JqC6AzlS/9Mqhq6mCE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=IYtQCHxSCpHSeWzkvkIi0Jhp6lT5rZpISqITFP2pIK/uHg1XeOaM3VbTxlkWiKjbk/cFRxP9D4Gaq41PK9k/Nw/RcAuu5U7g1tZ0iJeveSah5rEXB4tctBblm/juX7/Q6EQIpZwk5kt86P3qPTIQUWHtje/pylQy4InblZcThWc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zytor.com; spf=pass smtp.mailfrom=zytor.com; dkim=pass (2048-bit key) header.d=zytor.com header.i=@zytor.com header.b=TQcDCnUs; arc=none smtp.client-ip=198.137.202.136 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zytor.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zytor.com Received: from terminus.zytor.com (terminus.zytor.com [IPv6:2607:7c80:54:3:0:0:0:136]) (authenticated bits=0) by mail.zytor.com (8.17.2/8.17.1) with ESMTPSA id 4119k4ts3918155 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 1 Feb 2024 01:46:08 -0800 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 4119k4ts3918155 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2024011201; t=1706780768; bh=vjcWBDBUoGUeHxYNPS1IXd9Yqbe6TvxBMc8AURC1JUU=; h=From:To:Cc:Subject:Date:From; b=TQcDCnUsBgOp7A8Zkl2vhlqR/KfyWh0fS5DNQVf5IFXKEZJKl+wTAIrbPDLKJnRRu MCNm6DZTwPDb6t+8Op2gg5TgKLzZUiOzPGlVrfmuPq2YY+acyrOAmrzVumRvb4x6Ht cQcesLQdNd4aP9NUp/mgcTiLHyruFT5FgGH/MPMTrZ0Mh4qvisn2hAgKHr0RSI3u8E 6eSmTlGlSS+krY51Hl5bCZVaiEPmILxMVDllD6YOiGR7jtmWMMBF3wEZ+ytbz8D8Ww UJVE3a5G+rczOUNJ4NG35Z5vNcFSsFMDeEr/+Q9c3pGrKDdbECHhvXCGwDmgPFxJHy Y4llq46gDffuA== From: "Xin Li (Intel)" <xin@zytor.com> To: linux-kernel@vger.kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com Subject: [PATCH v1 1/1] x86/nmi: Remove an unnecessary IS_ENABLED(CONFIG_SMP) Date: Thu, 1 Feb 2024 01:46:04 -0800 Message-ID: <20240201094604.3918141-1-xin@zytor.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789689418574681559 X-GMAIL-MSGID: 1789689418574681559 |
Series |
[v1,1/1] x86/nmi: Remove an unnecessary IS_ENABLED(CONFIG_SMP)
|
|
Commit Message
Xin Li (Intel)
Feb. 1, 2024, 9:46 a.m. UTC
IS_ENABLED(CONFIG_SMP) is unnecessary here: smp_processor_id() should
always return zero on UP, and arch_cpu_is_offline() reduces to
!(cpu == 0), so this is a statically false condition on UP.
Suggested-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Signed-off-by: Xin Li (Intel) <xin@zytor.com>
---
arch/x86/kernel/nmi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
base-commit: b2803076903a83ea927c7f34deeaddf75ee38679
diff --git a/arch/x86/kernel/nmi.c b/arch/x86/kernel/nmi.c index db1c1848a1e6..6ba713406262 100644 --- a/arch/x86/kernel/nmi.c +++ b/arch/x86/kernel/nmi.c @@ -503,7 +503,7 @@ DEFINE_IDTENTRY_RAW(exc_nmi) if (IS_ENABLED(CONFIG_NMI_CHECK_CPU)) raw_atomic_long_inc(&nsp->idt_calls); - if (IS_ENABLED(CONFIG_SMP) && arch_cpu_is_offline(smp_processor_id())) { + if (arch_cpu_is_offline(smp_processor_id())) { if (microcode_nmi_handler_enabled()) microcode_offline_nmi_handler(); return;