Skip to content

Commit

Permalink
KVM: nVMX: Do not emulate #UD while in guest mode
Browse files Browse the repository at this point in the history
While in L2, leave all #UD to L2 and do not try to emulate it. If L1 is
interested in doing this, it reports its interest via the exception
bitmap, and we never get into handle_exception of L0 anyway.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
  • Loading branch information
Jan Kiszka authored and Marcelo Tosatti committed Mar 13, 2015
1 parent b34a805 commit ae1f576
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arch/x86/kvm/vmx.c
Original file line number Diff line number Diff line change
Expand Up @@ -5065,6 +5065,10 @@ static int handle_exception(struct kvm_vcpu *vcpu)
}

if (is_invalid_opcode(intr_info)) {
if (is_guest_mode(vcpu)) {
kvm_queue_exception(vcpu, UD_VECTOR);
return 1;
}
er = emulate_instruction(vcpu, EMULTYPE_TRAP_UD);
if (er != EMULATE_DONE)
kvm_queue_exception(vcpu, UD_VECTOR);
Expand Down

0 comments on commit ae1f576

Please sign in to comment.