From: Marcelo Tosatti <mtosatti@redhat.com>
To: Vitaly Kuznetsov <vkuznets@redhat.com>
Cc: qemu-devel@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
Oliver Upton <oupton@google.com>,
Maxim Levitsky <mlevitsk@redhat.com>
Subject: Re: [PATCH] i386: Fix KVM_CAP_ADJUST_CLOCK capability check
Date: Tue, 20 Sep 2022 15:33:55 -0300 [thread overview]
Message-ID: <YyoHkzsHbW93u8GC@fuller.cnet> (raw)
In-Reply-To: <20220920144024.3559708-1-vkuznets@redhat.com>
On Tue, Sep 20, 2022 at 04:40:24PM +0200, Vitaly Kuznetsov wrote:
> KVM commit c68dc1b577ea ("KVM: x86: Report host tsc and realtime values in
> KVM_GET_CLOCK") broke migration of certain workloads, e.g. Win11 + WSL2
> guest reboots immediately after migration. KVM, however, is not to
> blame this time. When KVM_CAP_ADJUST_CLOCK capability is checked, the
> result is all supported flags (which the above mentioned KVM commit
> enhanced) but kvm_has_adjust_clock_stable() wants it to be
> KVM_CLOCK_TSC_STABLE precisely. The result is that 'clock_is_reliable'
> is not set in vmstate and the saved clock reading is discarded in
> kvmclock_vm_state_change().
>
> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
> ---
> target/i386/kvm/kvm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c
> index a1fd1f53791d..c33192a87dcb 100644
> --- a/target/i386/kvm/kvm.c
> +++ b/target/i386/kvm/kvm.c
> @@ -157,7 +157,7 @@ bool kvm_has_adjust_clock_stable(void)
> {
> int ret = kvm_check_extension(kvm_state, KVM_CAP_ADJUST_CLOCK);
>
> - return (ret == KVM_CLOCK_TSC_STABLE);
> + return ret & KVM_CLOCK_TSC_STABLE;
> }
>
> bool kvm_has_adjust_clock(void)
> --
> 2.37.3
>
>
ACK.
next prev parent reply other threads:[~2022-09-20 22:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-20 14:40 [PATCH] i386: Fix KVM_CAP_ADJUST_CLOCK capability check Vitaly Kuznetsov
2022-09-20 18:33 ` Marcelo Tosatti [this message]
2022-09-27 9:45 ` Vitaly Kuznetsov
2022-10-07 9:26 ` Vitaly Kuznetsov
2022-10-07 10:49 ` Paolo Bonzini
2022-10-07 11:53 ` Vitaly Kuznetsov
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=YyoHkzsHbW93u8GC@fuller.cnet \
--to=mtosatti@redhat.com \
--cc=mlevitsk@redhat.com \
--cc=oupton@google.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=vkuznets@redhat.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.