xref: /openbmc/qemu/include/sysemu/hvf.h (revision c5a58398)
1 /*
2  * QEMU Hypervisor.framework (HVF) support
3  *
4  * Copyright Google Inc., 2017
5  *
6  * This work is licensed under the terms of the GNU GPL, version 2 or later.
7  * See the COPYING file in the top-level directory.
8  *
9  */
10 
11 /* header to be included in non-HVF-specific code */
12 
13 #ifndef HVF_H
14 #define HVF_H
15 
16 #ifdef CONFIG_HVF
17 uint32_t hvf_get_supported_cpuid(uint32_t func, uint32_t idx,
18                                  int reg);
19 extern bool hvf_allowed;
20 #define hvf_enabled() (hvf_allowed)
21 #else /* !CONFIG_HVF */
22 #define hvf_enabled() 0
23 #define hvf_get_supported_cpuid(func, idx, reg) 0
24 #endif /* !CONFIG_HVF */
25 
26 int hvf_init_vcpu(CPUState *);
27 int hvf_vcpu_exec(CPUState *);
28 void hvf_cpu_synchronize_state(CPUState *);
29 void hvf_cpu_synchronize_post_reset(CPUState *);
30 void hvf_cpu_synchronize_post_init(CPUState *);
31 void hvf_vcpu_destroy(CPUState *);
32 void hvf_reset_vcpu(CPUState *);
33 
34 #define TYPE_HVF_ACCEL ACCEL_CLASS_NAME("hvf")
35 
36 #define HVF_STATE(obj) \
37     OBJECT_CHECK(HVFState, (obj), TYPE_HVF_ACCEL)
38 
39 #endif
40