accel/whpx: Fix NULL dereference in whpx_init_vcpu()

When mechanically moving the @dirty field to AccelCPUState
in commit 9ad49538c7, we neglected cpu->accel is still NULL
when we want to dereference it.

Fixes: 9ad49538c7 ("accel/whpx: Use accel-specific per-vcpu @dirty field")
Reported-by: Volker Rümelin <vr_qemu@t-online.de>
Suggested-by: Volker Rümelin <vr_qemu@t-online.de>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20240429091918.27429-2-philmd@linaro.org>
master
Philippe Mathieu-Daudé 2024-04-29 11:10:53 +02:00
parent 61653b4a97
commit 083367dbbf
1 changed files with 1 additions and 1 deletions

View File

@ -2236,7 +2236,7 @@ int whpx_init_vcpu(CPUState *cpu)
}
vcpu->interruptable = true;
cpu->accel->dirty = true;
vcpu->dirty = true;
cpu->accel = vcpu;
max_vcpu_index = max(max_vcpu_index, cpu->cpu_index);
qemu_add_vm_change_state_handler(whpx_cpu_update_state, env);