diff options
author | Eddie Dong <eddie.dong@intel.com> | 2007-07-18 05:15:21 -0400 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2007-10-13 04:18:25 -0400 |
commit | b6958ce44a11a9e9425d2b67a653b1ca2a27796f (patch) | |
tree | 503478ef27254df9b6ea21d2a6a279a7dfe2ef04 /drivers/kvm/irq.c | |
parent | 1fd4f2a5ed8f80cf6e23d2bdf78554f6a1ac7997 (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.c | 4 |
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 | } |