diff options
author | Avi Kivity <avi@qumranet.com> | 2007-06-05 08:53:05 -0400 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2007-07-16 05:05:46 -0400 |
commit | d3bef15f84f91c73a5515ad4c6a1749f8f63afcf (patch) | |
tree | 3349c121f16a5fe0e1c30d4370573c2a9ed88bb9 /drivers/kvm/kvm_main.c | |
parent | ef9254df0b3aeba729e26a062803ee7d90437b5e (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.c | 11 |
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 | } |
1286 | EXPORT_SYMBOL_GPL(emulate_instruction); | 1286 | EXPORT_SYMBOL_GPL(emulate_instruction); |
1287 | 1287 | ||
1288 | int 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 | } | ||
1297 | EXPORT_SYMBOL_GPL(kvm_emulate_halt); | ||
1298 | |||
1288 | int kvm_hypercall(struct kvm_vcpu *vcpu, struct kvm_run *run) | 1299 | int 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; |