Skip to contentSkip to conversation

KVM: SVM: always set MSR_AMD64_TSC_RATIO to default value

PATCH New Maxim Levitsky 1 participant 1 message Feb 23, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 KVM: SVM: always set MSR_AMD64_TSC_RATIO to default value

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

---
 target/i386/cpu.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
target/i386/cpu.c +1 -3
index 6c7ef1099b..3475e9fa46 100644
@@ -5930,9 +5930,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
 }
Signature · 1 line
2.26.3