Skip to content

Commit 9948272

Browse files
vittyvkbonzini
authored andcommitted
KVM: nVMX: Always enable TSC scaling for L2 when it was enabled for L1
Windows 10/11 guests with Hyper-V role (WSL2) enabled are observed to hang upon boot or shortly after when a non-default TSC frequency was set for L1. The issue is observed on a host where TSC scaling is supported. The problem appears to be that Windows doesn't use TSC frequency for its guests even when the feature is advertised and KVM filters SECONDARY_EXEC_TSC_SCALING out when creating L2 controls from L1's. This leads to L2 running with the default frequency (matching host's) while L1 is running with an altered one. Keep SECONDARY_EXEC_TSC_SCALING in secondary exec controls for L2 when it was set for L1. TSC_MULTIPLIER is already correctly computed and written by prepare_vmcs02(). Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com> Message-Id: <20220712135009.952805-1-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
1 parent e0f3f46 commit 9948272

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

arch/x86/kvm/vmx/nested.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2278,7 +2278,6 @@ static void prepare_vmcs02_early(struct vcpu_vmx *vmx, struct loaded_vmcs *vmcs0
22782278
SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY |
22792279
SECONDARY_EXEC_APIC_REGISTER_VIRT |
22802280
SECONDARY_EXEC_ENABLE_VMFUNC |
2281-
SECONDARY_EXEC_TSC_SCALING |
22822281
SECONDARY_EXEC_DESC);
22832282

22842283
if (nested_cpu_has(vmcs12,

0 commit comments

Comments
 (0)