kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Vitaly Kuznetsov <vkuznets@redhat.com>, kvm@vger.kernel.org
Cc: Sean Christopherson <seanjc@google.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Jim Mattson <jmattson@google.com>,
	Marcelo Tosatti <mtosatti@redhat.com>
Subject: Re: [PATCH 2/4] KVM: x86: hyper-v: Prevent using not-yet-updated TSC page by secondary CPUs
Date: Mon, 15 Mar 2021 17:23:39 +0100	[thread overview]
Message-ID: <92bccdca-b6bb-5c09-c5a1-5c75e5a3887d@redhat.com> (raw)
In-Reply-To: <87im5s8l9g.fsf@vitty.brq.redhat.com>

On 15/03/21 16:55, Vitaly Kuznetsov wrote:
>> I think we should instead write 0 to the page in kvm_gen_update_masterclock.
>
> We can do that but we will also need to invalidate
> hv->tsc_ref.tsc_sequence to prevent MSR based clocksource
> (HV_X64_MSR_TIME_REF_COUNT -> get_time_ref_counter()) from using stale
> hv->tsc_ref.tsc_scale/tsc_offset values (in case we had them
> calculated).

Yes, we're talking about the same thing (invalidating tsc_sequence is 
done by writing 0 to it).

Paolo

> Also, we can't really disable TSC page for nested scenario when guest
> opted for reenlightenment (PATCH4) but we're not going to update the
> page anyway so there's not much different.
> 


  reply	other threads:[~2021-03-15 16:24 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-15 14:37 [PATCH 0/4] KVM: x86: hyper-v: TSC page fixes Vitaly Kuznetsov
2021-03-15 14:37 ` [PATCH 1/4] KVM: x86: hyper-v: Limit guest to writing zero to HV_X64_MSR_TSC_EMULATION_STATUS Vitaly Kuznetsov
2021-03-15 14:37 ` [PATCH 2/4] KVM: x86: hyper-v: Prevent using not-yet-updated TSC page by secondary CPUs Vitaly Kuznetsov
2021-03-15 15:45   ` Paolo Bonzini
2021-03-15 15:55     ` Vitaly Kuznetsov
2021-03-15 16:23       ` Paolo Bonzini [this message]
2021-03-16 12:29         ` Vitaly Kuznetsov
2021-03-15 14:37 ` [PATCH 3/4] KVM: x86: hyper-v: Track Hyper-V TSC page status Vitaly Kuznetsov
2021-03-15 15:15   ` Sean Christopherson
2021-03-15 15:34     ` Vitaly Kuznetsov
2021-03-16 12:24       ` Vitaly Kuznetsov
2021-03-16 15:20         ` Sean Christopherson
2021-03-15 14:37 ` [PATCH 4/4] KVM: x86: hyper-v: Don't touch TSC page values when guest opted for re-enlightenment 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=92bccdca-b6bb-5c09-c5a1-5c75e5a3887d@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=jmattson@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=seanjc@google.com \
    --cc=vkuznets@redhat.com \
    --cc=wanpengli@tencent.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 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).