summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/x86/kvm/vmx/nested.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c
index 77b5f75cc2bb..efca276c67f0 100644
--- a/arch/x86/kvm/vmx/nested.c
+++ b/arch/x86/kvm/vmx/nested.c
@@ -2371,6 +2371,13 @@ static void prepare_vmcs02_early_rare(struct vcpu_vmx *vmx,
else
vmcs_write16(VIRTUAL_PROCESSOR_ID, vmx->vpid);
}
+
+ if (kvm_caps.has_tsc_control && nested_early_check) {
+ if (nested_cpu_has2(vmcs12, SECONDARY_EXEC_TSC_SCALING))
+ vmcs_write64(TSC_MULTIPLIER, vmcs12->tsc_multiplier);
+ else
+ vmcs_write64(TSC_MULTIPLIER, 1);
+ }
}
static void prepare_vmcs02_early(struct vcpu_vmx *vmx, struct loaded_vmcs *vmcs01,