Skip to contentSkip to conversation

QEMU/KVM: clear HF_HALTED mask at vcpu startup time

PATCH Applied Marcelo Tosatti 2 participants 2 messages Apr 17, 2008 – Apr 20, 2008 KVM

lore
Share & tools
lore
#0 lore raw

Now that threads are spinned up before machine->init(), clearing of HF_HALTED_MASK for irqchip in kernel case needs to be moved to actual vcpu startup.

qemu/qemu-kvm.c +2 -2
index f7a217a..50589a7 100644
@@ -325,6 +325,8 @@ static int kvm_main_loop_cpu(CPUState *env)
 
     setup_kernel_sigmask(env);
     pthread_mutex_lock(&qemu_mutex);
+    if (kvm_irqchip_in_kernel(kvm_context))
+	env->hflags &= ~HF_HALTED_MASK;
 
     kvm_qemu_init_env(env);
     env->ready_for_interrupt_injection = 1;
@@ -368,8 +370,6 @@ static void *ap_main_loop(void *_env)
     sigprocmask(SIG_BLOCK, &signals, NULL);
     kvm_create_vcpu(kvm_context, env->cpu_index);
     kvm_qemu_init_env(env);
-    if (kvm_irqchip_in_kernel(kvm_context))
-	env->hflags &= ~HF_HALTED_MASK;
     kvm_main_loop_cpu(env);
     return NULL;
 }

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

Applied
#1 lore raw
Quoted 4 lines · Marcelo Tosatti

Now that threads are spinned up before machine->init(), clearing of HF_HALTED_MASK for irqchip in kernel case needs to be moved to actual vcpu startup.

Applied, thanks.

Signature · 8 lines
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone