public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] kvm: nVMX: Remove nested_vmx_succeed after successful VM-entry
@ 2017-09-14 23:31 Jim Mattson
  2017-09-14 23:31 ` Jim Mattson
                   ` (8 more replies)
  0 siblings, 9 replies; 13+ messages in thread
From: Jim Mattson @ 2017-09-14 23:31 UTC (permalink / raw)
  To: kvm; +Cc: Jim Mattson

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.

Signed-off-by: Jim Mattson <jmattson@google.com>
---
 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

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2017-09-17 12:28 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-14 23:31 [PATCH 1/3] kvm: nVMX: Remove nested_vmx_succeed after successful VM-entry Jim Mattson
2017-09-14 23:31 ` Jim Mattson
2017-09-14 23:31 ` [PATCH 2/3] kvm: vmx: Handle VMLAUNCH/VMRESUME failure properly Jim Mattson
2017-09-14 23:31 ` Jim Mattson
2017-09-14 23:31 ` [PATCH 3/3] kvm: nVMX: Handle deferred early " Jim Mattson
2017-09-14 23:31 ` Jim Mattson
2017-09-14 23:31 ` [kvm-unit-tests PATCH 1/2] x86: Skip some VMX control field tests Jim Mattson
2017-09-14 23:31 ` Jim Mattson
2017-09-15 16:40   ` Paolo Bonzini
2017-09-15 17:49     ` Jim Mattson
2017-09-17 12:28     ` Andrew Jones
2017-09-14 23:31 ` [kvm-unit-tests PATCH 2/2] x86: Add test for TPR threshold check on VM-entry Jim Mattson
2017-09-14 23:31 ` Jim Mattson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox