>From 5d417af0c51adc11ed0de6a30aa1ddfb2ccba875 Mon Sep 17 00:00:00 2001 From: Sean Christopherson Date: Thu, 5 Sep 2024 11:36:45 -0700 Subject: [PATCH 2/3] x86/reboot: Open code nmi_shootdown_cpus_on_restart() into its sole user 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 Closes: https://lore.kernel.org/oe-kbuild-all/202409010207.jrH6sNV4-lkp@intel.com Signed-off-by: Sean Christopherson --- 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