aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/vmx.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2015-03-09 15:56:43 -0400
committerMarcelo Tosatti <mtosatti@redhat.com>2015-03-13 12:44:43 -0400
commitae1f57670703656cc9f293722c3b8b6782f8ab3f (patch)
treefd4fdfaed468f32cc417fb2b67318dbf7310a23a /arch/x86/kvm/vmx.c
parentb34a80517bfcd917bc59d9670d8f465a564af3b9 (diff)
KVM: nVMX: Do not emulate #UD while in guest mode
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>
Diffstat (limited to 'arch/x86/kvm/vmx.c')
-rw-r--r--arch/x86/kvm/vmx.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index fbd949909628..50c675b46901 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -5065,6 +5065,10 @@ static int handle_exception(struct kvm_vcpu *vcpu)
5065 } 5065 }
5066 5066
5067 if (is_invalid_opcode(intr_info)) { 5067 if (is_invalid_opcode(intr_info)) {
5068 if (is_guest_mode(vcpu)) {
5069 kvm_queue_exception(vcpu, UD_VECTOR);
5070 return 1;
5071 }
5068 er = emulate_instruction(vcpu, EMULTYPE_TRAP_UD); 5072 er = emulate_instruction(vcpu, EMULTYPE_TRAP_UD);
5069 if (er != EMULATE_DONE) 5073 if (er != EMULATE_DONE)
5070 kvm_queue_exception(vcpu, UD_VECTOR); 5074 kvm_queue_exception(vcpu, UD_VECTOR);