From: Paolo Bonzini <pbonzini@redhat.com>
To: Maxim Levitsky <mlevitsk@redhat.com>, qemu-devel@nongnu.org
Cc: "Alex Bennée" <alex.bennee@linaro.org>,
"Marcelo Tosatti" <mtosatti@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>,
kvm@vger.kernel.org
Subject: Re: [PATCH v2 3/3] KVM: SVM: add migration support for nested TSC scaling
Date: Tue, 2 Nov 2021 11:38:53 +0100 [thread overview]
Message-ID: <343745d4-d60b-5f62-fef5-a00004a73f71@redhat.com> (raw)
In-Reply-To: <20211101132300.192584-4-mlevitsk@redhat.com>
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
prev parent reply other threads:[~2021-11-02 10:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-01 13:22 [PATCH v2 0/3] KVM: qemu patches for few KVM features I developed Maxim Levitsky
2021-11-01 13:22 ` [PATCH v2 1/3] KVM: use KVM_{GET|SET}_SREGS2 when supported Maxim Levitsky
2021-11-01 13:22 ` [PATCH v2 2/3] gdbstub: implement NOIRQ support for single step on KVM Maxim Levitsky
2021-11-01 13:23 ` [PATCH v2 3/3] KVM: SVM: add migration support for nested TSC scaling Maxim Levitsky
2021-11-02 10:38 ` Paolo Bonzini [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=343745d4-d60b-5f62-fef5-a00004a73f71@redhat.com \
--to=pbonzini@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=kvm@vger.kernel.org \
--cc=mlevitsk@redhat.com \
--cc=mtosatti@redhat.com \
--cc=philmd@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).