From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jim Mattson Subject: [PATCH 1/3] kvm: nVMX: Remove nested_vmx_succeed after successful VM-entry Date: Thu, 14 Sep 2017 16:31:41 -0700 Message-ID: <20170914233149.113141-2-jmattson@google.com> References: <20170914233149.113141-1-jmattson@google.com> Cc: Jim Mattson To: kvm@vger.kernel.org Return-path: Received: from mail-pg0-f52.google.com ([74.125.83.52]:45087 "EHLO mail-pg0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751380AbdINXc6 (ORCPT ); Thu, 14 Sep 2017 19:32:58 -0400 Received: by mail-pg0-f52.google.com with SMTP id 188so514758pgb.2 for ; Thu, 14 Sep 2017 16:32:57 -0700 (PDT) In-Reply-To: <20170914233149.113141-1-jmattson@google.com> Sender: kvm-owner@vger.kernel.org List-ID: After a successful VM-entry, RFLAGS is cleared, with the exception of bit 1, which is always set. This is handled by load_vmcs12_host_state. Change-Id: I43796013022cdedcbb0628fb97a54912a6b23fa1 Signed-off-by: Jim Mattson --- arch/x86/kvm/vmx.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 09204993a739..84af1268860c 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -11486,16 +11486,18 @@ static void nested_vmx_vmexit(struct kvm_vcpu *vcpu, u32 exit_reason, */ kvm_make_request(KVM_REQ_APIC_PAGE_RELOAD, vcpu); - /* - * Exiting from L2 to L1, we're now back to L1 which thinks it just - * finished a VMLAUNCH or VMRESUME instruction, so we need to set the - * success or failure flag accordingly. - */ if (unlikely(vmx->fail)) { + /* + * After an early L2 VM-entry failure, we're now back + * in L1 which thinks it just finished a VMLAUNCH or + * VMRESUME instruction, so we need to set the failure + * flag and the VM-instruction error field of the VMCS + * accordingly. + */ vmx->fail = 0; nested_vmx_failValid(vcpu, vm_inst_error); - } else - nested_vmx_succeed(vcpu); + } + if (enable_shadow_vmcs) vmx->nested.sync_shadow_vmcs = true; -- 2.14.1.690.gbb1197296e-goog