qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 3/3] KVM: SVM: add migration support for nested TSC scalin


From: Paolo Bonzini
Subject: Re: [PATCH v2 3/3] KVM: SVM: add migration support for nested TSC scaling
Date: Tue, 2 Nov 2021 11:38:53 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0

On 01/11/21 14:23, Maxim Levitsky wrote:
Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
---
  target/i386/cpu.c     |  5 +++++
  target/i386/cpu.h     |  4 ++++
  target/i386/kvm/kvm.c | 15 +++++++++++++++
  target/i386/machine.c | 23 +++++++++++++++++++++++
  4 files changed, 47 insertions(+)

It's easier to migrate it unconditionally:

diff --git a/target/i386/machine.c b/target/i386/machine.c
index e1138693f3..83c2b91529 100644
--- a/target/i386/machine.c
+++ b/target/i386/machine.c
@@ -1286,8 +1286,7 @@ static bool amd_tsc_scale_msr_needed(void *opaque)
     X86CPU *cpu = opaque;
     CPUX86State *env = &cpu->env;

-    return env->amd_tsc_scale_msr &&
-           env->amd_tsc_scale_msr != MSR_AMD64_TSC_RATIO_DEFAULT;
+    return (env->features[FEAT_SVM] & CPUID_SVM_TSCSCALE);
 }

 static const VMStateDescription amd_tsc_scale_msr_ctrl = {

+    if (env->features[FEAT_SVM] & CPUID_SVM_TSCSCALE) {
+        env->amd_tsc_scale_msr =  MSR_AMD64_TSC_RATIO_DEFAULT;
+    }

and also set it unconditionally here, so that it's always passed correctly to KVM.

I queued patches 2 and 3, for (1) I need to think more about migration to older QEMU versions.

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]