Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/system/hvf_int.h | 4 ++++
accel/hvf/hvf-accel-ops.c | 3 +++
target/arm/hvf/hvf.c | 8 ++++++++
target/i386/hvf/hvf.c | 8 ++++++++
4 files changed, 23 insertions(+)
diff --git a/include/system/hvf_int.h b/include/system/hvf_int.h
index c8e407a1463..eab443aa91f 100644
--- a/include/system/hvf_int.h
+++ b/include/system/hvf_int.h
@@ -71,6 +71,10 @@ int hvf_arch_put_registers(CPUState *);
int hvf_arch_get_registers(CPUState *);
/* Must be called by the owning thread */
void hvf_arch_update_guest_debug(CPUState *cpu);
+/* Must be called by the owning thread */
+void hvf_arch_cpu_synchronize_pre_exec(CPUState *cpu);
+/* Must be called by the owning thread */
+void hvf_arch_cpu_synchronize_post_exec(CPUState *cpu);
void hvf_protect_clean_range(hwaddr addr, size_t size);
void hvf_unprotect_dirty_range(hwaddr addr, size_t size);
diff --git a/accel/hvf/hvf-accel-ops.c b/accel/hvf/hvf-accel-ops.c
index e9dd2d24745..744a5288298 100644
--- a/accel/hvf/hvf-accel-ops.c
+++ b/accel/hvf/hvf-accel-ops.c
@@ -181,10 +181,13 @@ static void *hvf_cpu_thread_fn(void *arg)
do {
qemu_process_cpu_events(cpu);
if (cpu_can_run(cpu)) {
+
+ hvf_arch_cpu_synchronize_pre_exec(cpu);
r = hvf_arch_vcpu_exec(cpu);
if (r == EXCP_DEBUG) {
cpu_handle_guest_debug(cpu);
}
+ hvf_arch_cpu_synchronize_post_exec(cpu);
}
} while (!cpu->unplug || cpu_can_run(cpu));
diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c
index b0918de5f92..c83bffe46ad 100644
--- a/target/arm/hvf/hvf.c
+++ b/target/arm/hvf/hvf.c
@@ -2009,6 +2009,14 @@ static int hvf_handle_vmexit(CPUState *cpu, hv_vcpu_exit_t *exit)
return ret;
}
+void hvf_arch_cpu_synchronize_pre_exec(CPUState *cpu)
+{
+}
+
+void hvf_arch_cpu_synchronize_post_exec(CPUState *cpu)
+{
+}
+
int hvf_arch_vcpu_exec(CPUState *cpu)
{
int ret;
diff --git a/target/i386/hvf/hvf.c b/target/i386/hvf/hvf.c
index 4597d191f9d..de5e8b45d19 100644
--- a/target/i386/hvf/hvf.c
+++ b/target/i386/hvf/hvf.c
@@ -722,6 +722,14 @@ void hvf_simulate_wrmsr(CPUState *cs)
printf("write msr %llx\n", RCX(cs));*/
}
+void hvf_arch_cpu_synchronize_pre_exec(CPUState *cpu)
+{
+}
+
+void hvf_arch_cpu_synchronize_post_exec(CPUState *cpu)
+{
+}
+
static int hvf_handle_vmexit(CPUState *cpu)
{
X86CPU *x86_cpu = env_archcpu(cpu_env(cpu));
--
2.51.0