Skip to contentSkip to conversation

x86/nmi: Remove an unnecessary IS_ENABLED(CONFIG_SMP)

PATCH Applied Xin Li (Intel) 2 participants 2 messages Feb 1, 2024 – Feb 27, 2024 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/nmi: Remove an unnecessary IS_ENABLED(CONFIG_SMP)

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.

---
 arch/x86/kernel/nmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/nmi.c +1 -1
index db1c1848a1e6..6ba713406262 100644
@@ -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

Signature · 1 line
2.43.0
merge bot Applied
#1 lore raw
The following commit has been merged into the x86/cleanups branch of tip:

The following commit has been merged into the x86/cleanups branch of tip:

Commit-ID:     47403a4b49767f1d533e4dc5f5cf5cc957f22a5e
Gitweb:        https://git.kernel.org/tip/47403a4b49767f1d533e4dc5f5cf5cc957f22a5e
Author:        Xin Li (Intel) <[email protected]>
AuthorDate:    Thu, 01 Feb 2024 01:46:04 -08:00
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Tue, 27 Feb 2024 22:00:50 +01:00

x86/nmi: Remove an unnecessary IS_ENABLED(CONFIG_SMP)

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.

---
 arch/x86/kernel/nmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/nmi.c +1 -1
index 17e955a..44fe569 100644
@@ -502,7 +502,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;