public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* QEMU/KVM: clear HF_HALTED mask at vcpu startup time
@ 2008-04-17 22:30 Marcelo Tosatti
  2008-04-20  7:45 ` Avi Kivity
  0 siblings, 1 reply; 2+ messages in thread
From: Marcelo Tosatti @ 2008-04-17 22:30 UTC (permalink / raw)
  To: Avi Kivity, kvm-devel


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.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>

diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c
index f7a217a..50589a7 100644
--- a/qemu/qemu-kvm.c
+++ b/qemu/qemu-kvm.c
@@ -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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: QEMU/KVM: clear HF_HALTED mask at vcpu startup time
  2008-04-17 22:30 QEMU/KVM: clear HF_HALTED mask at vcpu startup time Marcelo Tosatti
@ 2008-04-20  7:45 ` Avi Kivity
  0 siblings, 0 replies; 2+ messages in thread
From: Avi Kivity @ 2008-04-20  7:45 UTC (permalink / raw)
  To: Marcelo Tosatti; +Cc: kvm-devel

Marcelo Tosatti wrote:
> 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.

-- 
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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-04-20  7:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-17 22:30 QEMU/KVM: clear HF_HALTED mask at vcpu startup time Marcelo Tosatti
2008-04-20  7:45 ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox