diff options
author | Avi Kivity <avi@redhat.com> | 2009-06-11 15:43:28 +0300 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2009-09-10 08:32:52 +0300 |
commit | 3f5d18a96577fd78277e08c467041573b9a65eaf (patch) | |
tree | 5c9e15a3b48d188729bb77283cf353fd42903155 /arch/x86/kvm/mmu.c | |
parent | 988a2cae6a3c0dea6df59808a935a9a697bfc28c (diff) | |
download | linux-3f5d18a96577fd78277e08c467041573b9a65eaf.tar.bz2 |
KVM: Return to userspace on emulation failure
Instead of mindlessly retrying to execute the instruction, report the
failure to userspace.
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/mmu.c')
-rw-r--r-- | arch/x86/kvm/mmu.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 5f97dbd24291..b6e4cda77047 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @@ -2673,8 +2673,9 @@ int kvm_mmu_page_fault(struct kvm_vcpu *vcpu, gva_t cr2, u32 error_code) ++vcpu->stat.mmio_exits; return 0; case EMULATE_FAIL: - kvm_report_emulation_failure(vcpu, "pagetable"); - return 1; + vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR; + vcpu->run->internal.suberror = KVM_INTERNAL_ERROR_EMULATION; + return 0; default: BUG(); } |