[PATCH 2/3] x86/reboot: Open code nmi_shootdown_cpus_on_restart() into its sole user

From: Sean Christopherson
Date: Thu Sep 05 2024 - 14:36:45 EST


To fix a W=1 warning due to nmi_shootdown_cpus_on_restart() being unused
if KVM support is disabled, fold nmi_shootdown_cpus_on_restart() into its
one and only user, emergency_reboot_disable_virtualization().

No functional change intented.

Reported-by: kernel test robot <lkp@xxxxxxxxx>
Closes: https://lore.kernel.org/oe-kbuild-all/202409010207.jrH6sNV4-lkp@xxxxxxxxx
Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx>
---
arch/x86/kernel/reboot.c | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
index 25f68952af57..8c6f6da6ee8e 100644
--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
@@ -528,8 +528,6 @@ static inline void kb_wait(void)
}
}

-static inline void nmi_shootdown_cpus_on_restart(void);
-
#if IS_ENABLED(CONFIG_KVM_X86)
/* RCU-protected callback to disable virtualization prior to reboot. */
static cpu_emergency_virt_cb __rcu *cpu_emergency_virt_callback;
@@ -595,7 +593,8 @@ static void emergency_reboot_disable_virtualization(void)
cpu_emergency_disable_virtualization();

/* Disable VMX/SVM and halt on other CPUs. */
- nmi_shootdown_cpus_on_restart();
+ if (IS_ENABLED(CONFIG_SMP))
+ nmi_shootdown_cpus(NULL);
}
}
#else
@@ -958,11 +957,6 @@ void nmi_shootdown_cpus(nmi_shootdown_cb callback)
*/
}

-static inline void nmi_shootdown_cpus_on_restart(void)
-{
- nmi_shootdown_cpus(NULL);
-}
-
/*
* Check if the crash dumping IPI got issued and if so, call its callback
* directly. This function is used when we have already been in NMI handler.
@@ -990,8 +984,6 @@ void nmi_shootdown_cpus(nmi_shootdown_cb callback)
/* No other CPUs to shoot down */
}

-static inline void nmi_shootdown_cpus_on_restart(void) { }
-
void run_crash_ipi_callback(struct pt_regs *regs)
{
}
--
2.47.0.rc1.288.g06298d1525-goog


--Osa6c5ZHj6sBiqsE
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="0003-x86-reboot-Delete-CONFIG_SMP-n-stub-for-nmi_shootdow.patch"