xref: /openbmc/qemu/include/sysemu/hvf.h (revision 8110fa1d)
1c97d6d2cSSergio Andres Gomez Del Real /*
2c97d6d2cSSergio Andres Gomez Del Real  * QEMU Hypervisor.framework (HVF) support
3c97d6d2cSSergio Andres Gomez Del Real  *
4c97d6d2cSSergio Andres Gomez Del Real  * Copyright Google Inc., 2017
5c97d6d2cSSergio Andres Gomez Del Real  *
6c97d6d2cSSergio Andres Gomez Del Real  * This work is licensed under the terms of the GNU GPL, version 2 or later.
7c97d6d2cSSergio Andres Gomez Del Real  * See the COPYING file in the top-level directory.
8c97d6d2cSSergio Andres Gomez Del Real  *
9c97d6d2cSSergio Andres Gomez Del Real  */
10c97d6d2cSSergio Andres Gomez Del Real 
11c97d6d2cSSergio Andres Gomez Del Real /* header to be included in non-HVF-specific code */
12a8b991b5SMarkus Armbruster 
13a8b991b5SMarkus Armbruster #ifndef HVF_H
14a8b991b5SMarkus Armbruster #define HVF_H
15c97d6d2cSSergio Andres Gomez Del Real 
16d48ad737SEduardo Habkost #include "sysemu/accel.h"
17db1015e9SEduardo Habkost #include "qom/object.h"
18d48ad737SEduardo Habkost 
19c97d6d2cSSergio Andres Gomez Del Real #ifdef CONFIG_HVF
20c97d6d2cSSergio Andres Gomez Del Real uint32_t hvf_get_supported_cpuid(uint32_t func, uint32_t idx,
21c97d6d2cSSergio Andres Gomez Del Real                                  int reg);
22f291cf54SPhilippe Mathieu-Daudé extern bool hvf_allowed;
2392cc3aaaSRoman Bolshakov #define hvf_enabled() (hvf_allowed)
24f291cf54SPhilippe Mathieu-Daudé #else /* !CONFIG_HVF */
25c97d6d2cSSergio Andres Gomez Del Real #define hvf_enabled() 0
26c97d6d2cSSergio Andres Gomez Del Real #define hvf_get_supported_cpuid(func, idx, reg) 0
27f291cf54SPhilippe Mathieu-Daudé #endif /* !CONFIG_HVF */
28c97d6d2cSSergio Andres Gomez Del Real 
29c97d6d2cSSergio Andres Gomez Del Real int hvf_init_vcpu(CPUState *);
30c97d6d2cSSergio Andres Gomez Del Real int hvf_vcpu_exec(CPUState *);
31c97d6d2cSSergio Andres Gomez Del Real void hvf_cpu_synchronize_state(CPUState *);
32c97d6d2cSSergio Andres Gomez Del Real void hvf_cpu_synchronize_post_reset(CPUState *);
33c97d6d2cSSergio Andres Gomez Del Real void hvf_cpu_synchronize_post_init(CPUState *);
345536c98eSRoman Bolshakov void hvf_cpu_synchronize_pre_loadvm(CPUState *);
35c97d6d2cSSergio Andres Gomez Del Real void hvf_vcpu_destroy(CPUState *);
36c97d6d2cSSergio Andres Gomez Del Real 
37c97d6d2cSSergio Andres Gomez Del Real #define TYPE_HVF_ACCEL ACCEL_CLASS_NAME("hvf")
38c97d6d2cSSergio Andres Gomez Del Real 
393932885aSEduardo Habkost typedef struct HVFState HVFState;
40*8110fa1dSEduardo Habkost DECLARE_INSTANCE_CHECKER(HVFState, HVF_STATE,
41*8110fa1dSEduardo Habkost                          TYPE_HVF_ACCEL)
42c97d6d2cSSergio Andres Gomez Del Real 
43c97d6d2cSSergio Andres Gomez Del Real #endif
44