From mboxrd@z Thu Jan 1 00:00:00 1970 From: Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: [PATCH] kvm: vmx: Properly handle machine check during VM-entry Date: Fri, 19 May 2017 15:39:16 +0200 Message-ID: <20170519133916.GB9960@potion> References: <20170518230239.86518-1-jmattson@google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org To: Jim Mattson Return-path: Received: from mx1.redhat.com ([209.132.183.28]:42640 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755289AbdESNjT (ORCPT ); Fri, 19 May 2017 09:39:19 -0400 Content-Disposition: inline In-Reply-To: <20170518230239.86518-1-jmattson@google.com> Sender: kvm-owner@vger.kernel.org List-ID: 2017-05-18 16:02-0700, Jim Mattson: > 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(); Don't we need a 'return;' afterwards? (i.e. will kvm_machine_check() always kill us?) > /* We need to handle NMIs before interrupts are enabled */ If kvm_machine_check() managed to return, then we could double-inject NMI, because exit_intr_info was not updated. > if (is_nmi(exit_intr_info)) { Thanks.