QEMU/KVM: set cpu_single_env before flushing work
PATCH 1/1 QEMU/KVM: set cpu_single_env before flushing work
As Jerone pointed out, current kvm_invoke_guest_debug may segfault. The reason is lacking re-initialization of cpu_single_env before flush_queued_work is called. Here is the fix.
Signed-off-by Jan Kiszka <[email protected]>
--- qemu/qemu-kvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
qemu/qemu-kvm.c +1 -1
@@ -268,7 +268,7 @@ static void kvm_main_loop_wait(CPUStateexit (1 ); } - + cpu_single_env = env;flush_queued_work (env);if (vcpu_info[env->cpu_index].stop) {
Avi Kivity
AppliedQuoted 5 lines · Jan Kiszka
As Jerone pointed out, current
kvm_invoke_guest_debugmay segfault. The reason is lacking re-initialization ofcpu_single_envbeforeflush_queued_workis called. Here is the fix.
Applied, thanks. I also removed the same assignment a few lines later.
Signature · 1 line
Do not meddle in the internals of kernels, for they are subtle and quick to panic.