* [PATCH] async PF event can fail to wakeup vcpu from halt
@ 2012-05-03 8:36 Gleb Natapov
2012-05-06 11:57 ` Avi Kivity
0 siblings, 1 reply; 2+ messages in thread
From: Gleb Natapov @ 2012-05-03 8:36 UTC (permalink / raw)
To: kvm; +Cc: avi, marcelo
If vcpu executes hlt instruction while async PF is waiting to be delivered
vcpu can block and deliver async PF only after another even wakes it
up. This happens because kvm_check_async_pf_completion() will remove
completion event from vcpu->async_pf.done before entering kvm_vcpu_block()
and this will make kvm_arch_vcpu_runnable() return false. The solution
is to make vcpu runnable when processing completion.
Signed-off-by: Gleb Natapov <gleb@redhat.com>
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 4de705c..6d44308 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -6611,6 +6611,7 @@ void kvm_arch_async_page_present(struct kvm_vcpu *vcpu,
kvm_inject_page_fault(vcpu, &fault);
}
vcpu->arch.apf.halted = false;
+ vcpu->arch.mp_state = KVM_MP_STATE_RUNNABLE;
}
bool kvm_arch_can_inject_async_page_present(struct kvm_vcpu *vcpu)
--
Gleb.
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] async PF event can fail to wakeup vcpu from halt
2012-05-03 8:36 [PATCH] async PF event can fail to wakeup vcpu from halt Gleb Natapov
@ 2012-05-06 11:57 ` Avi Kivity
0 siblings, 0 replies; 2+ messages in thread
From: Avi Kivity @ 2012-05-06 11:57 UTC (permalink / raw)
To: Gleb Natapov; +Cc: kvm, marcelo
On 05/03/2012 11:36 AM, Gleb Natapov wrote:
> If vcpu executes hlt instruction while async PF is waiting to be delivered
> vcpu can block and deliver async PF only after another even wakes it
> up. This happens because kvm_check_async_pf_completion() will remove
> completion event from vcpu->async_pf.done before entering kvm_vcpu_block()
> and this will make kvm_arch_vcpu_runnable() return false. The solution
> is to make vcpu runnable when processing completion.
>
>
Thanks, applied to master for 3.4.
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-05-06 11:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-03 8:36 [PATCH] async PF event can fail to wakeup vcpu from halt Gleb Natapov
2012-05-06 11:57 ` Avi Kivity
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).