Skip to content

Commit 2a5fe5a

Browse files
committed
x86/reboot: emergency callbacks are now registered by common KVM code
Guard them with CONFIG_KVM_X86_COMMON rather than the two vendor modules. In practice this has no functional change, because CONFIG_KVM_X86_COMMON is set if and only if at least one vendor-specific module is being built. However, it is cleaner to specify CONFIG_KVM_X86_COMMON for functions that are used in kvm.ko. Reported-by: Linus Torvalds <[email protected]> Fixes: 590b09b ("KVM: x86: Register "emergency disable" callbacks when virt is enabled") Fixes: 6d55a94 ("x86/reboot: Unconditionally define cpu_emergency_virt_cb typedef") Signed-off-by: Paolo Bonzini <[email protected]>
1 parent ea4290d commit 2a5fe5a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

arch/x86/include/asm/reboot.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ void __noreturn machine_real_restart(unsigned int type);
2626
#define MRR_APM 1
2727

2828
typedef void (cpu_emergency_virt_cb)(void);
29-
#if IS_ENABLED(CONFIG_KVM_INTEL) || IS_ENABLED(CONFIG_KVM_AMD)
29+
#if IS_ENABLED(CONFIG_KVM_X86)
3030
void cpu_emergency_register_virt_callback(cpu_emergency_virt_cb *callback);
3131
void cpu_emergency_unregister_virt_callback(cpu_emergency_virt_cb *callback);
3232
void cpu_emergency_disable_virtualization(void);
3333
#else
3434
static inline void cpu_emergency_disable_virtualization(void) {}
35-
#endif /* CONFIG_KVM_INTEL || CONFIG_KVM_AMD */
35+
#endif /* CONFIG_KVM_X86 */
3636

3737
typedef void (*nmi_shootdown_cb)(int, struct pt_regs*);
3838
void nmi_shootdown_cpus(nmi_shootdown_cb callback);

arch/x86/kernel/reboot.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ static inline void kb_wait(void)
530530

531531
static inline void nmi_shootdown_cpus_on_restart(void);
532532

533-
#if IS_ENABLED(CONFIG_KVM_INTEL) || IS_ENABLED(CONFIG_KVM_AMD)
533+
#if IS_ENABLED(CONFIG_KVM_X86)
534534
/* RCU-protected callback to disable virtualization prior to reboot. */
535535
static cpu_emergency_virt_cb __rcu *cpu_emergency_virt_callback;
536536

@@ -600,7 +600,7 @@ static void emergency_reboot_disable_virtualization(void)
600600
}
601601
#else
602602
static void emergency_reboot_disable_virtualization(void) { }
603-
#endif /* CONFIG_KVM_INTEL || CONFIG_KVM_AMD */
603+
#endif /* CONFIG_KVM_X86 */
604604

605605
void __attribute__((weak)) mach_reboot_fixups(void)
606606
{

0 commit comments

Comments
 (0)