]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
accel/whpx: Fix NULL dereference in whpx_init_vcpu()
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Mon, 29 Apr 2024 09:10:53 +0000 (11:10 +0200)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Fri, 3 May 2024 12:37:51 +0000 (14:37 +0200)
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>

target/i386/whpx/whpx-all.c

index b08e644517463efa2f86bfd8a6c3b97329694907..a6674a826d61a0400fe4d9a8baad4a9d9b538d82 100644 (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);