xref: /linux/arch/x86/include/asm/virt.h (revision 0fc8f6200d2313278fbf4539bbab74677c685531)
1a1450a81SSean Christopherson /* SPDX-License-Identifier: GPL-2.0-only */
2a1450a81SSean Christopherson #ifndef _ASM_X86_VIRT_H
3a1450a81SSean Christopherson #define _ASM_X86_VIRT_H
4a1450a81SSean Christopherson 
5405b7c27SSean Christopherson #include <asm/reboot.h>
6a1450a81SSean Christopherson 
7428afac5SSean Christopherson typedef void (cpu_emergency_virt_cb)(void);
8428afac5SSean Christopherson 
9a1450a81SSean Christopherson #if IS_ENABLED(CONFIG_KVM_X86)
10a1450a81SSean Christopherson extern bool virt_rebooting;
11405b7c27SSean Christopherson 
12405b7c27SSean Christopherson void __init x86_virt_init(void);
13405b7c27SSean Christopherson 
14*8528a7f9SSean Christopherson int x86_virt_get_ref(int feat);
15*8528a7f9SSean Christopherson void x86_virt_put_ref(int feat);
1632d76cdfSSean Christopherson 
17428afac5SSean Christopherson int x86_virt_emergency_disable_virtualization_cpu(void);
18428afac5SSean Christopherson 
19428afac5SSean Christopherson void x86_virt_register_emergency_callback(cpu_emergency_virt_cb *callback);
20428afac5SSean Christopherson void x86_virt_unregister_emergency_callback(cpu_emergency_virt_cb *callback);
21405b7c27SSean Christopherson #else
22405b7c27SSean Christopherson static __always_inline void x86_virt_init(void) {}
23428afac5SSean Christopherson static inline int x86_virt_emergency_disable_virtualization_cpu(void) { return -ENOENT; }
24a1450a81SSean Christopherson #endif
25a1450a81SSean Christopherson 
26a1450a81SSean Christopherson #endif /* _ASM_X86_VIRT_H */
27