projects/linux·blob master · refs

26 lines · 719 B

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
7typedef void (cpu_emergency_virt_cb)(void);
8
9#if IS_ENABLED(CONFIG_KVM_X86)
10extern bool virt_rebooting;
11
12void __init x86_virt_init(void);
13
14int x86_virt_get_ref(int feat);
15void x86_virt_put_ref(int feat);
16
17int x86_virt_emergency_disable_virtualization_cpu(void);
18
19void x86_virt_register_emergency_callback(cpu_emergency_virt_cb *callback);
20void x86_virt_unregister_emergency_callback(cpu_emergency_virt_cb *callback);
21#else
22static __always_inline void x86_virt_init(void) {}
23static inline int x86_virt_emergency_disable_virtualization_cpu(void) { return -ENOENT; }
24#endif
25
26#endif /* _ASM_X86_VIRT_H */