aboutsummaryrefslogtreecommitdiffstats
path: root/virt/kvm/kvm_main.c
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2009-03-23 09:11:44 -0400
committerAvi Kivity <avi@redhat.com>2009-06-10 04:48:33 -0400
commit09cec754885f900f6aab23801878c0cd217ee1d6 (patch)
tree3f634b6993af33914b031421e23db67744b84a9f /virt/kvm/kvm_main.c
parent089d034e0c4538d2436512fa64782b91008d4a7c (diff)
KVM: Timer event should not unconditionally unhalt vcpu.
Currently timer events are processed before entering guest mode. Move it to main vcpu event loop since timer events should be processed even while vcpu is halted. Timer may cause interrupt/nmi to be injected and only then vcpu will be unhalted. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'virt/kvm/kvm_main.c')
-rw-r--r--virt/kvm/kvm_main.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 934dd1c9487e..a1a4272fa57c 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -1611,11 +1611,12 @@ void kvm_vcpu_block(struct kvm_vcpu *vcpu)
1611 prepare_to_wait(&vcpu->wq, &wait, TASK_INTERRUPTIBLE); 1611 prepare_to_wait(&vcpu->wq, &wait, TASK_INTERRUPTIBLE);
1612 1612
1613 if (kvm_cpu_has_interrupt(vcpu) || 1613 if (kvm_cpu_has_interrupt(vcpu) ||
1614 kvm_cpu_has_pending_timer(vcpu) || 1614 kvm_arch_vcpu_runnable(vcpu)) {
1615 kvm_arch_vcpu_runnable(vcpu)) {
1616 set_bit(KVM_REQ_UNHALT, &vcpu->requests); 1615 set_bit(KVM_REQ_UNHALT, &vcpu->requests);
1617 break; 1616 break;
1618 } 1617 }
1618 if (kvm_cpu_has_pending_timer(vcpu))
1619 break;
1619 if (signal_pending(current)) 1620 if (signal_pending(current))
1620 break; 1621 break;
1621 1622