Skip to contentSkip to conversation

QEMU/KVM: set cpu_single_env before flushing work

PATCH Applied Jan Kiszka 2 participants 2 messages May 30, 2008 – Jun 4, 2008 KVM

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

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.

---
 qemu/qemu-kvm.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
qemu/qemu-kvm.c +1 -1
Index: b/qemu/qemu-kvm.c
===================================================================
@@ -268,7 +268,7 @@ static void kvm_main_loop_wait(CPUState 
 	exit(1);
     }
 
-
+    cpu_single_env = env;
     flush_queued_work(env);
 
     if (vcpu_info[env->cpu_index].stop) {
Applied
#1 lore raw
Quoted 5 lines · Jan Kiszka

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.

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.