Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp56824rdb; Thu, 1 Feb 2024 01:47:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IGpgXVc074Y93Cox8CJzRIFZ971NWUX789psvqPt9ZzOA9Ch8AT9XbAdnVbYOVgI8HzYrrG X-Received: by 2002:a17:906:4714:b0:a36:14e8:290d with SMTP id y20-20020a170906471400b00a3614e8290dmr2696635ejq.46.1706780829190; Thu, 01 Feb 2024 01:47:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706780829; cv=pass; d=google.com; s=arc-20160816; b=DRqnb5QUXc99r54lRlDtMlK77JkSvIG03crHrSFZUS+uM3iAqjwXlj95flCl2e18ae W7RQWMRwaEA88KpCGK1s/pGM1f8UJxr7KAX2sPViysujeNpInznspb2NEEPvJFmjaegn SuplMw/lqCWdCWZi8lbannBCJAgxzJoCKuixgwpNbj198vq1C97w6nMPpKjsvgWLV3+l auYcssDcoaRkTxICXYoJleZqSagB9z/7gMtKd+a+HS0JcLgy9DkUPL9hCQBrgugDHFSQ Coeg71XTXZIZI9sGJUcIqIdruMqfxBi2EApYvGmdvbrUk2bUmkvjiBQyH+6s9pmY/GOb jwXA== 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=f2HyYhej4JeZab8SVVrz9E9D6K8siCihYlmuoipoYDQ=; b=ZDz5hrYk64ocKEhWm64jusCzP23+RkJ4eu/56zMlWQXbz1BiDjsyhenyc0Fvojd5n1 C7nwidw0/svKyh3UfVKnhjC+3EK8s2K8g2ZJ3tsssE3+Jnc8Jeap9hbPpRB9qxGsZKUw /WIRgxmyrFluoP+hJ9p/pCc/cPg+yd6IpLiamuKCtrUVGWw8sFgQifVWuhvY3HnCSm4L aqBNNrTWXeegxfKtnesas2kSXaTLYdu1GRuze5WqXiIYwhzsEjrWcfz57ZGElhCa2w/N hUC18N9IK95IoOvQjWWzPTYPn+q/TetQSAHKxxwJA12M0OKgwMFw4/lIu31NZE6J2Iws K+YQ==; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47909-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com X-Forwarded-Encrypted: i=1; AJvYcCUmcAeo6HbxMdUKm3hNXF8ruGBwEujWkRKwKS7R7iSlIyhu8O3XHIZxhxsZ/P6U7fmutjrsSme5Be0+YbOmqd3E0Uoob5W7xuhC1NmMXg== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id b24-20020a170906039800b00a35da54db3csi3487999eja.979.2024.02.01.01.47.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 01:47:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47909-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47909-linux.lists.archive=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 B27E01F28F87 for ; Thu, 1 Feb 2024 09:46:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A1D414DA13; Thu, 1 Feb 2024 09:46:41 +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 ; 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)" 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: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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) Signed-off-by: Xin Li (Intel) --- arch/x86/kernel/nmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; base-commit: b2803076903a83ea927c7f34deeaddf75ee38679 -- 2.43.0