]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
KVM: SVM: always set MSR_AMD64_TSC_RATIO to default value
authorMaxim Levitsky <mlevitsk@redhat.com>
Wed, 23 Feb 2022 11:58:24 +0000 (13:58 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 15 Mar 2022 10:50:50 +0000 (11:50 +0100)
Even when the feature is not supported in guest CPUID,
still set the msr to the default value which will
be the only value KVM will accept in this case

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
Message-Id: <20220223115824.319821-1-mlevitsk@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
target/i386/cpu.c

index 916d3354fe3204331040df71a3d3521d3b9caa73..a88d6554c88ac9442bbe34a0e9202c4a1df67dec 100644 (file)
@@ -5997,9 +5997,7 @@ static void x86_cpu_reset(DeviceState *dev)
 
     x86_cpu_set_sgxlepubkeyhash(env);
 
-    if (env->features[FEAT_SVM] & CPUID_SVM_TSCSCALE) {
-        env->amd_tsc_scale_msr =  MSR_AMD64_TSC_RATIO_DEFAULT;
-    }
+    env->amd_tsc_scale_msr =  MSR_AMD64_TSC_RATIO_DEFAULT;
 
 #endif
 }