Merge remote-tracking branch 'remotes/maxreitz/tags/pull-block-2020-03-26' into staging
[qemu.git] / include / sysemu / hw_accel.h
blob0ec237247729e6108a0c995ed8e5c15bc01e1625
1 /*
2 * QEMU Hardware accelertors support
4 * Copyright 2016 Google, Inc.
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.
9 */
11 #ifndef QEMU_HW_ACCEL_H
12 #define QEMU_HW_ACCEL_H
14 #include "hw/core/cpu.h"
15 #include "sysemu/hax.h"
16 #include "sysemu/kvm.h"
17 #include "sysemu/whpx.h"
19 static inline void cpu_synchronize_state(CPUState *cpu)
21 if (kvm_enabled()) {
22 kvm_cpu_synchronize_state(cpu);
24 if (hax_enabled()) {
25 hax_cpu_synchronize_state(cpu);
27 if (whpx_enabled()) {
28 whpx_cpu_synchronize_state(cpu);
32 static inline void cpu_synchronize_post_reset(CPUState *cpu)
34 if (kvm_enabled()) {
35 kvm_cpu_synchronize_post_reset(cpu);
37 if (hax_enabled()) {
38 hax_cpu_synchronize_post_reset(cpu);
40 if (whpx_enabled()) {
41 whpx_cpu_synchronize_post_reset(cpu);
45 static inline void cpu_synchronize_post_init(CPUState *cpu)
47 if (kvm_enabled()) {
48 kvm_cpu_synchronize_post_init(cpu);
50 if (hax_enabled()) {
51 hax_cpu_synchronize_post_init(cpu);
53 if (whpx_enabled()) {
54 whpx_cpu_synchronize_post_init(cpu);
58 static inline void cpu_synchronize_pre_loadvm(CPUState *cpu)
60 if (kvm_enabled()) {
61 kvm_cpu_synchronize_pre_loadvm(cpu);
63 if (hax_enabled()) {
64 hax_cpu_synchronize_pre_loadvm(cpu);
66 if (whpx_enabled()) {
67 whpx_cpu_synchronize_pre_loadvm(cpu);
71 #endif /* QEMU_HW_ACCEL_H */