aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm/irq.c
diff options
context:
space:
mode:
authorEddie Dong <eddie.dong@intel.com>2007-07-18 12:15:21 +0300
committerAvi Kivity <avi@qumranet.com>2007-10-13 10:18:25 +0200
commitb6958ce44a11a9e9425d2b67a653b1ca2a27796f (patch)
tree503478ef27254df9b6ea21d2a6a279a7dfe2ef04 /drivers/kvm/irq.c
parentKVM: In-kernel I/O APIC model (diff)
downloadlinux-dev-b6958ce44a11a9e9425d2b67a653b1ca2a27796f.tar.xz
linux-dev-b6958ce44a11a9e9425d2b67a653b1ca2a27796f.zip
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)
{
int ipi_pcpu = vcpu->cpu;
+ if (waitqueue_active(&vcpu->wq)) {
+ wake_up_interruptible(&vcpu->wq);
+ ++vcpu->stat.halt_wakeup;
+ }
if (vcpu->guest_mode)
smp_call_function_single(ipi_pcpu, vcpu_kick_intr, vcpu, 0, 0);
}