aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2009-06-11 08:43:28 -0400
committerAvi Kivity <avi@redhat.com>2009-09-10 01:32:52 -0400
commit3f5d18a96577fd78277e08c467041573b9a65eaf (patch)
tree5c9e15a3b48d188729bb77283cf353fd42903155 /arch
parent988a2cae6a3c0dea6df59808a935a9a697bfc28c (diff)
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')
-rw-r--r--arch/x86/kvm/mmu.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 5f97dbd2429..b6e4cda7704 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)
2673 ++vcpu->stat.mmio_exits; 2673 ++vcpu->stat.mmio_exits;
2674 return 0; 2674 return 0;
2675 case EMULATE_FAIL: 2675 case EMULATE_FAIL:
2676 kvm_report_emulation_failure(vcpu, "pagetable"); 2676 vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR;
2677 return 1; 2677 vcpu->run->internal.suberror = KVM_INTERNAL_ERROR_EMULATION;
2678 return 0;
2678 default: 2679 default:
2679 BUG(); 2680 BUG();
2680 } 2681 }