diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kvm/vmx.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index ce13b53d21c4..ed4fe8e72ad0 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/sched.h> | 27 | #include <linux/sched.h> |
28 | #include <linux/moduleparam.h> | 28 | #include <linux/moduleparam.h> |
29 | #include "kvm_cache_regs.h" | 29 | #include "kvm_cache_regs.h" |
30 | #include "x86.h" | ||
30 | 31 | ||
31 | #include <asm/io.h> | 32 | #include <asm/io.h> |
32 | #include <asm/desc.h> | 33 | #include <asm/desc.h> |
@@ -744,9 +745,7 @@ static void vmx_queue_exception(struct kvm_vcpu *vcpu, unsigned nr, | |||
744 | 745 | ||
745 | static bool vmx_exception_injected(struct kvm_vcpu *vcpu) | 746 | static bool vmx_exception_injected(struct kvm_vcpu *vcpu) |
746 | { | 747 | { |
747 | struct vcpu_vmx *vmx = to_vmx(vcpu); | 748 | return false; |
748 | |||
749 | return !(vmx->idt_vectoring_info & VECTORING_INFO_VALID_MASK); | ||
750 | } | 749 | } |
751 | 750 | ||
752 | /* | 751 | /* |
@@ -2824,6 +2823,7 @@ static void vmx_complete_interrupts(struct vcpu_vmx *vmx) | |||
2824 | u8 vector; | 2823 | u8 vector; |
2825 | int type; | 2824 | int type; |
2826 | bool idtv_info_valid; | 2825 | bool idtv_info_valid; |
2826 | u32 error; | ||
2827 | 2827 | ||
2828 | exit_intr_info = vmcs_read32(VM_EXIT_INTR_INFO); | 2828 | exit_intr_info = vmcs_read32(VM_EXIT_INTR_INFO); |
2829 | if (cpu_has_virtual_nmis()) { | 2829 | if (cpu_has_virtual_nmis()) { |
@@ -2855,6 +2855,15 @@ static void vmx_complete_interrupts(struct vcpu_vmx *vmx) | |||
2855 | else | 2855 | else |
2856 | vmx->vcpu.arch.nmi_injected = false; | 2856 | vmx->vcpu.arch.nmi_injected = false; |
2857 | } | 2857 | } |
2858 | kvm_clear_exception_queue(&vmx->vcpu); | ||
2859 | if (idtv_info_valid && type == INTR_TYPE_EXCEPTION) { | ||
2860 | if (idt_vectoring_info & VECTORING_INFO_DELIVER_CODE_MASK) { | ||
2861 | error = vmcs_read32(IDT_VECTORING_ERROR_CODE); | ||
2862 | kvm_queue_exception_e(&vmx->vcpu, vector, error); | ||
2863 | } else | ||
2864 | kvm_queue_exception(&vmx->vcpu, vector); | ||
2865 | vmx->idt_vectoring_info = 0; | ||
2866 | } | ||
2858 | } | 2867 | } |
2859 | 2868 | ||
2860 | static void vmx_intr_assist(struct kvm_vcpu *vcpu) | 2869 | static void vmx_intr_assist(struct kvm_vcpu *vcpu) |