From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jim Mattson Subject: [PATCH] kvm: vmx: Properly handle machine check during VM-entry Date: Thu, 18 May 2017 16:02:39 -0700 Message-ID: <20170518230239.86518-1-jmattson@google.com> Cc: Jim Mattson To: kvm@vger.kernel.org Return-path: Received: from mail-pg0-f44.google.com ([74.125.83.44]:33555 "EHLO mail-pg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753375AbdERXEY (ORCPT ); Thu, 18 May 2017 19:04:24 -0400 Received: by mail-pg0-f44.google.com with SMTP id u187so29353484pgb.0 for ; Thu, 18 May 2017 16:04:23 -0700 (PDT) Sender: kvm-owner@vger.kernel.org List-ID: When bit 31 of the exit reason is set to indicate a VM-entry failure, only the exit reason and exit qualification fields are set. All other VM-exit information fields, including "VM-exit interruption information," are unmodified. Fixes: 00eba012d53e6 ("KVM: VMX: Refactor vmx_complete_atomic_exit()") Signed-off-by: Jim Mattson --- arch/x86/kvm/vmx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index c6f4ad44aa95..e73977ec15df 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -8624,7 +8624,8 @@ static void vmx_complete_atomic_exit(struct vcpu_vmx *vmx) exit_intr_info = vmx->exit_intr_info; /* Handle machine checks before interrupts are enabled */ - if (is_machine_check(exit_intr_info)) + if (vmx->exit_reason == EXIT_REASON_MCE_DURING_VMENTRY || + is_machine_check(exit_intr_info)) kvm_machine_check(); /* We need to handle NMIs before interrupts are enabled */ -- 2.13.0.303.g4ebf302169-goog