public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] don't call adjust_vmx_controls() second time
@ 2009-08-27 15:41 Gleb Natapov
  2009-08-27 16:21 ` Avi Kivity
  0 siblings, 1 reply; 6+ messages in thread
From: Gleb Natapov @ 2009-08-27 15:41 UTC (permalink / raw)
  To: avi; +Cc: kvm

Don't call adjust_vmx_controls() two times for the same control.
It restores options that was dropped earlier.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 6b57eed..78101dd 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -1262,12 +1262,9 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf)
 	if (_cpu_based_2nd_exec_control & SECONDARY_EXEC_ENABLE_EPT) {
 		/* CR3 accesses and invlpg don't need to cause VM Exits when EPT
 		   enabled */
-		min &= ~(CPU_BASED_CR3_LOAD_EXITING |
-			 CPU_BASED_CR3_STORE_EXITING |
-			 CPU_BASED_INVLPG_EXITING);
-		if (adjust_vmx_controls(min, opt, MSR_IA32_VMX_PROCBASED_CTLS,
-					&_cpu_based_exec_control) < 0)
-			return -EIO;
+		_cpu_based_exec_control &= ~(CPU_BASED_CR3_LOAD_EXITING |
+					     CPU_BASED_CR3_STORE_EXITING |
+					     CPU_BASED_INVLPG_EXITING);
 		rdmsr(MSR_IA32_VMX_EPT_VPID_CAP,
 		      vmx_capability.ept, vmx_capability.vpid);
 	}
--
			Gleb.

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

end of thread, other threads:[~2009-08-31 13:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-27 15:41 [PATCH] don't call adjust_vmx_controls() second time Gleb Natapov
2009-08-27 16:21 ` Avi Kivity
2009-08-27 20:42   ` Andrew Theurer
2009-08-30  8:59     ` Avi Kivity
2009-08-31 13:05       ` Andrew Theurer
2009-08-31 13:52         ` Avi Kivity

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