diff options
author | Gleb Natapov <gleb@redhat.com> | 2010-05-10 11:16:56 +0300 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2010-08-01 10:35:40 +0300 |
commit | 6d77dbfc88e37c9efd5c5dd18445cfe819ae17ea (patch) | |
tree | 96a3afb750d254a99dd43fa4730fd6ff187eb2a0 /arch/x86/kvm/mmu.c | |
parent | 57bc24cfd655c912498983130326b312e0404db1 (diff) | |
download | lwn-6d77dbfc88e37c9efd5c5dd18445cfe819ae17ea.tar.gz lwn-6d77dbfc88e37c9efd5c5dd18445cfe819ae17ea.zip |
KVM: inject #UD if instruction emulation fails and exit to userspace
Do not kill VM when instruction emulation fails. Inject #UD and report
failure to userspace instead. Userspace may choose to reenter guest if
vcpu is in userspace (cpl == 3) in which case guest OS will kill
offending process and continue running.
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/kvm/mmu.c')
-rw-r--r-- | arch/x86/kvm/mmu.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index be981b1f1881..4a02dee1f2b5 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @@ -2814,11 +2814,8 @@ int kvm_mmu_page_fault(struct kvm_vcpu *vcpu, gva_t cr2, u32 error_code) return 1; case EMULATE_DO_MMIO: ++vcpu->stat.mmio_exits; - return 0; + /* fall through */ case EMULATE_FAIL: - vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR; - vcpu->run->internal.suberror = KVM_INTERNAL_ERROR_EMULATION; - vcpu->run->internal.ndata = 0; return 0; default: BUG(); |