Re: [PATCH] kvm: vmx: Properly handle machine check during VM-entry

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <jmattson@xxxxxxxxxx>
> ---
>  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.



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux