diff options
author | Avi Kivity <avi@qumranet.com> | 2007-06-05 15:53:05 +0300 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2007-07-16 12:05:46 +0300 |
commit | d3bef15f84f91c73a5515ad4c6a1749f8f63afcf (patch) | |
tree | 3349c121f16a5fe0e1c30d4370573c2a9ed88bb9 /drivers/kvm/kvm_main.c | |
parent | ef9254df0b3aeba729e26a062803ee7d90437b5e (diff) | |
download | blackbird-op-linux-d3bef15f84f91c73a5515ad4c6a1749f8f63afcf.tar.gz blackbird-op-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.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, } 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; |