1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 #ifndef _ASM_X86_VIRT_H 3 #define _ASM_X86_VIRT_H 4 5 #include <asm/reboot.h> 6 7 typedef void (cpu_emergency_virt_cb)(void); 8 9 #if IS_ENABLED(CONFIG_KVM_X86) 10 extern bool virt_rebooting; 11 12 void __init x86_virt_init(void); 13 14 int x86_virt_get_ref(int feat); 15 void x86_virt_put_ref(int feat); 16 17 int x86_virt_emergency_disable_virtualization_cpu(void); 18 19 void x86_virt_register_emergency_callback(cpu_emergency_virt_cb *callback); 20 void x86_virt_unregister_emergency_callback(cpu_emergency_virt_cb *callback); 21 #else 22 static __always_inline void x86_virt_init(void) {} 23 static inline int x86_virt_emergency_disable_virtualization_cpu(void) { return -ENOENT; } 24 #endif 25 26 #endif /* _ASM_X86_VIRT_H */ 27