[PATCH v2 22/36] KVM: VMX: Enable APIC timer virtualization

isaku.yamahata@intel.com posted 36 patches 3 weeks, 6 days ago
[PATCH v2 22/36] KVM: VMX: Enable APIC timer virtualization
Posted by isaku.yamahata@intel.com 3 weeks, 6 days ago
From: Isaku Yamahata <isaku.yamahata@intel.com>

Don't clear TERTIARY_EXEC_GUEST_APIC_TIMER bit unconditionally from
KVM_OPTIONAL_VMX_TERTIARY_VM_EXEC_CONTROL when calculating supported bit.

Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>
---
Changes:
v1 -> v2:
- Move the bit disable to the caller of adjust_vmx_controls64() to avoid
  compile time error because KVM_OPTIONAL_VMX_TERTIARY_VM_EXEC_CONTROL is
  used for compile time check.
---
 arch/x86/kvm/vmx/vmx.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
index e665fc7f3377..b3974125a902 100644
--- a/arch/x86/kvm/vmx/vmx.c
+++ b/arch/x86/kvm/vmx/vmx.c
@@ -2801,15 +2801,7 @@ static int setup_vmcs_config(struct vmcs_config *vmcs_conf,
 
 	if (_cpu_based_exec_control & CPU_BASED_ACTIVATE_TERTIARY_CONTROLS)
 		_cpu_based_3rd_exec_control =
-			adjust_vmx_controls64(KVM_OPTIONAL_VMX_TERTIARY_VM_EXEC_CONTROL
-					      /*
-					       * Disable apic timer
-					       * virtualization until the logic
-					       * is imlemented.
-					       * Once it's supported, add
-					       * TERTIARY_EXEC_GUEST_APIC_TIMER.
-					       */
-					      & ~TERTIARY_EXEC_GUEST_APIC_TIMER,
+			adjust_vmx_controls64(KVM_OPTIONAL_VMX_TERTIARY_VM_EXEC_CONTROL,
 					      MSR_IA32_VMX_PROCBASED_CTLS3);
 
 	if (!IS_ENABLED(CONFIG_X86_64) ||
-- 
2.45.2