aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm/irq.c
diff options
context:
space:
mode:
authorEddie Dong <eddie.dong@intel.com>2007-07-18 05:15:21 -0400
committerAvi Kivity <avi@qumranet.com>2007-10-13 04:18:25 -0400
commitb6958ce44a11a9e9425d2b67a653b1ca2a27796f (patch)
tree503478ef27254df9b6ea21d2a6a279a7dfe2ef04 /drivers/kvm/irq.c
parent1fd4f2a5ed8f80cf6e23d2bdf78554f6a1ac7997 (diff)
KVM: Emulate hlt in the kernel
By sleeping in the kernel when hlt is executed, we simplify the in-kernel guest interrupt path considerably. Signed-off-by: Gregory Haskins <ghaskins@novell.com> Signed-off-by: Yaozu (Eddie) Dong <eddie.dong@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/irq.c')
-rw-r--r--drivers/kvm/irq.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/kvm/irq.c b/drivers/kvm/irq.c
index 5265f8267b3b..e09cd65925d6 100644
--- a/drivers/kvm/irq.c
+++ b/drivers/kvm/irq.c
@@ -70,6 +70,10 @@ void kvm_vcpu_kick(struct kvm_vcpu *vcpu)
70{ 70{
71 int ipi_pcpu = vcpu->cpu; 71 int ipi_pcpu = vcpu->cpu;
72 72
73 if (waitqueue_active(&vcpu->wq)) {
74 wake_up_interruptible(&vcpu->wq);
75 ++vcpu->stat.halt_wakeup;
76 }
73 if (vcpu->guest_mode) 77 if (vcpu->guest_mode)
74 smp_call_function_single(ipi_pcpu, vcpu_kick_intr, vcpu, 0, 0); 78 smp_call_function_single(ipi_pcpu, vcpu_kick_intr, vcpu, 0, 0);
75} 79}