summaryrefslogtreecommitdiffstats
path: root/drivers/kvm/kvm_main.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@qumranet.com>2007-06-05 14:53:05 +0200
committerAvi Kivity <avi@qumranet.com>2007-07-16 11:05:46 +0200
commitd3bef15f84f91c73a5515ad4c6a1749f8f63afcf (patch)
tree3349c121f16a5fe0e1c30d4370573c2a9ed88bb9 /drivers/kvm/kvm_main.c
parentKVM: Enable guest smp (diff)
downloadlinux-d3bef15f84f91c73a5515ad4c6a1749f8f63afcf.tar.xz
linux-d3bef15f84f91c73a5515ad4c6a1749f8f63afcf.zip
KVM: Move duplicate halt handling code into kvm_main.c
Will soon have a thid user. Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/kvm_main.c')
-rw-r--r--drivers/kvm/kvm_main.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
index 230b25aa469c..556416962541 100644
--- a/drivers/kvm/kvm_main.c
+++ b/drivers/kvm/kvm_main.c
@@ -1285,6 +1285,17 @@ int emulate_instruction(struct kvm_vcpu *vcpu,
}
EXPORT_SYMBOL_GPL(emulate_instruction);
+int kvm_emulate_halt(struct kvm_vcpu *vcpu)
+{
+ if (vcpu->irq_summary)
+ return 1;
+
+ vcpu->run->exit_reason = KVM_EXIT_HLT;
+ ++vcpu->stat.halt_exits;
+ return 0;
+}
+EXPORT_SYMBOL_GPL(kvm_emulate_halt);
+
int kvm_hypercall(struct kvm_vcpu *vcpu, struct kvm_run *run)
{
unsigned long nr, a0, a1, a2, a3, a4, a5, ret;