@@ -30,6 +30,7 @@ struct AccelCPUState {
struct nvmm_vcpu vcpu;
uint8_t tpr;
bool stop;
+ bool dirty;
/* Window-exiting for INTs/NMIs. */
bool int_window_exit;
@@ -507,7 +508,7 @@ nvmm_io_callback(struct nvmm_io *io)
}
/* Needed, otherwise infinite loop. */
- current_cpu->vcpu_dirty = false;
+ current_cpu->accel->dirty = false;
}
static void
@@ -516,7 +517,7 @@ nvmm_mem_callback(struct nvmm_mem *mem)
cpu_physical_memory_rw(mem->gpa, mem->data, mem->size, mem->write);
/* Needed, otherwise infinite loop. */
- current_cpu->vcpu_dirty = false;
+ current_cpu->accel->dirty = false;
}
static struct nvmm_assist_callbacks nvmm_callbacks = {
@@ -726,9 +727,9 @@ nvmm_vcpu_loop(CPUState *cpu)
* Inner VCPU loop.
*/
do {
- if (cpu->vcpu_dirty) {
+ if (cpu->accel->dirty) {
nvmm_set_registers(cpu);
- cpu->vcpu_dirty = false;
+ cpu->accel->dirty = false;
}
if (qcpu->stop) {
@@ -826,32 +827,32 @@ static void
do_nvmm_cpu_synchronize_state(CPUState *cpu, run_on_cpu_data arg)
{
nvmm_get_registers(cpu);
- cpu->vcpu_dirty = true;
+ cpu->accel->dirty = true;
}
static void
do_nvmm_cpu_synchronize_post_reset(CPUState *cpu, run_on_cpu_data arg)
{
nvmm_set_registers(cpu);
- cpu->vcpu_dirty = false;
+ cpu->accel->dirty = false;
}
static void
do_nvmm_cpu_synchronize_post_init(CPUState *cpu, run_on_cpu_data arg)
{
nvmm_set_registers(cpu);
- cpu->vcpu_dirty = false;
+ cpu->accel->dirty = false;
}
static void
do_nvmm_cpu_synchronize_pre_loadvm(CPUState *cpu, run_on_cpu_data arg)
{
- cpu->vcpu_dirty = true;
+ cpu->accel->dirty = true;
}
void nvmm_cpu_synchronize_state(CPUState *cpu)
{
- if (!cpu->vcpu_dirty) {
+ if (!cpu->accel->dirty) {
run_on_cpu(cpu, do_nvmm_cpu_synchronize_state, RUN_ON_CPU_NULL);
}
}
@@ -981,7 +982,7 @@ nvmm_init_vcpu(CPUState *cpu)
}
}
- cpu->vcpu_dirty = true;
+ cpu->accel->dirty = true;
cpu->accel = qcpu;
return 0;