diff options
author | Andre Przywara <andre.przywara@amd.com> | 2010-12-21 05:12:01 -0500 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-01-12 04:30:59 -0500 |
commit | db8fcefaa704ccb40b6dcd24e3b75bad3ce7dde3 (patch) | |
tree | 7915835b4ebe513bbb9ad08388db5a45fa0355f0 /arch/x86/kvm/x86.c | |
parent | eea1cff9ab732ea56358ff5e1bd8b99db2e8402d (diff) |
KVM: move complete_insn_gp() into x86.c
move the complete_insn_gp() helper function out of the VMX part
into the generic x86 part to make it usable by SVM.
Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r-- | arch/x86/kvm/x86.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 2dbf68cd46e3..1d54cb7f3358 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -334,6 +334,15 @@ void kvm_requeue_exception(struct kvm_vcpu *vcpu, unsigned nr) | |||
334 | } | 334 | } |
335 | EXPORT_SYMBOL_GPL(kvm_requeue_exception); | 335 | EXPORT_SYMBOL_GPL(kvm_requeue_exception); |
336 | 336 | ||
337 | void kvm_complete_insn_gp(struct kvm_vcpu *vcpu, int err) | ||
338 | { | ||
339 | if (err) | ||
340 | kvm_inject_gp(vcpu, 0); | ||
341 | else | ||
342 | kvm_x86_ops->skip_emulated_instruction(vcpu); | ||
343 | } | ||
344 | EXPORT_SYMBOL_GPL(kvm_complete_insn_gp); | ||
345 | |||
337 | void kvm_inject_page_fault(struct kvm_vcpu *vcpu, struct x86_exception *fault) | 346 | void kvm_inject_page_fault(struct kvm_vcpu *vcpu, struct x86_exception *fault) |
338 | { | 347 | { |
339 | ++vcpu->stat.pf_guest; | 348 | ++vcpu->stat.pf_guest; |