aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm/kvm_main.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@qumranet.com>2007-06-05 08:53:05 -0400
committerAvi Kivity <avi@qumranet.com>2007-07-16 05:05:46 -0400
commitd3bef15f84f91c73a5515ad4c6a1749f8f63afcf (patch)
tree3349c121f16a5fe0e1c30d4370573c2a9ed88bb9 /drivers/kvm/kvm_main.c
parentef9254df0b3aeba729e26a062803ee7d90437b5e (diff)
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,
1285} 1285}
1286EXPORT_SYMBOL_GPL(emulate_instruction); 1286EXPORT_SYMBOL_GPL(emulate_instruction);
1287 1287
1288int kvm_emulate_halt(struct kvm_vcpu *vcpu)
1289{
1290 if (vcpu->irq_summary)
1291 return 1;
1292
1293 vcpu->run->exit_reason = KVM_EXIT_HLT;
1294 ++vcpu->stat.halt_exits;
1295 return 0;
1296}
1297EXPORT_SYMBOL_GPL(kvm_emulate_halt);
1298
1288int kvm_hypercall(struct kvm_vcpu *vcpu, struct kvm_run *run) 1299int kvm_hypercall(struct kvm_vcpu *vcpu, struct kvm_run *run)
1289{ 1300{
1290 unsigned long nr, a0, a1, a2, a3, a4, a5, ret; 1301 unsigned long nr, a0, a1, a2, a3, a4, a5, ret;