2017-01-10 11:59:55 +01:00
|
|
|
/*
|
|
|
|
* QEMU Hardware accelertors support
|
|
|
|
*
|
|
|
|
* Copyright 2016 Google, Inc.
|
|
|
|
*
|
|
|
|
* This work is licensed under the terms of the GNU GPL, version 2 or later.
|
|
|
|
* See the COPYING file in the top-level directory.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef QEMU_HW_ACCEL_H
|
|
|
|
#define QEMU_HW_ACCEL_H
|
|
|
|
|
|
|
|
#include "qom/cpu.h"
|
|
|
|
#include "sysemu/hax.h"
|
|
|
|
#include "sysemu/kvm.h"
|
2018-01-22 22:07:49 +01:00
|
|
|
#include "sysemu/whpx.h"
|
2017-01-10 11:59:55 +01:00
|
|
|
|
|
|
|
static inline void cpu_synchronize_state(CPUState *cpu)
|
|
|
|
{
|
|
|
|
if (kvm_enabled()) {
|
|
|
|
kvm_cpu_synchronize_state(cpu);
|
|
|
|
}
|
2017-01-10 11:59:57 +01:00
|
|
|
if (hax_enabled()) {
|
|
|
|
hax_cpu_synchronize_state(cpu);
|
|
|
|
}
|
2018-01-22 22:07:49 +01:00
|
|
|
if (whpx_enabled()) {
|
|
|
|
whpx_cpu_synchronize_state(cpu);
|
|
|
|
}
|
2017-01-10 11:59:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static inline void cpu_synchronize_post_reset(CPUState *cpu)
|
|
|
|
{
|
|
|
|
if (kvm_enabled()) {
|
|
|
|
kvm_cpu_synchronize_post_reset(cpu);
|
|
|
|
}
|
2017-01-10 11:59:57 +01:00
|
|
|
if (hax_enabled()) {
|
|
|
|
hax_cpu_synchronize_post_reset(cpu);
|
|
|
|
}
|
2018-01-22 22:07:49 +01:00
|
|
|
if (whpx_enabled()) {
|
|
|
|
whpx_cpu_synchronize_post_reset(cpu);
|
|
|
|
}
|
2017-01-10 11:59:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static inline void cpu_synchronize_post_init(CPUState *cpu)
|
|
|
|
{
|
|
|
|
if (kvm_enabled()) {
|
|
|
|
kvm_cpu_synchronize_post_init(cpu);
|
|
|
|
}
|
2017-01-10 11:59:57 +01:00
|
|
|
if (hax_enabled()) {
|
|
|
|
hax_cpu_synchronize_post_init(cpu);
|
|
|
|
}
|
2018-01-22 22:07:49 +01:00
|
|
|
if (whpx_enabled()) {
|
|
|
|
whpx_cpu_synchronize_post_init(cpu);
|
|
|
|
}
|
2017-01-10 11:59:55 +01:00
|
|
|
}
|
|
|
|
|
2017-05-26 06:46:28 +02:00
|
|
|
static inline void cpu_synchronize_pre_loadvm(CPUState *cpu)
|
|
|
|
{
|
|
|
|
if (kvm_enabled()) {
|
|
|
|
kvm_cpu_synchronize_pre_loadvm(cpu);
|
|
|
|
}
|
|
|
|
if (hax_enabled()) {
|
|
|
|
hax_cpu_synchronize_pre_loadvm(cpu);
|
|
|
|
}
|
2018-01-22 22:07:49 +01:00
|
|
|
if (whpx_enabled()) {
|
|
|
|
whpx_cpu_synchronize_pre_loadvm(cpu);
|
|
|
|
}
|
2017-05-26 06:46:28 +02:00
|
|
|
}
|
|
|
|
|
2017-01-10 11:59:55 +01:00
|
|
|
#endif /* QEMU_HW_ACCEL_H */
|