public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: kvm-devel <kvm@vger.kernel.org>, Vitaly Kuznetsov <vkuznets@redhat.com>
Subject: Re: [PATCH v2] KVM: x86: allow TSC to differ by NTP correction bounds without TSC scaling
Date: Tue, 23 Jun 2020 11:56:43 +0200	[thread overview]
Message-ID: <86cdffd8-a894-7e14-70f7-e5b0b3aceeda@redhat.com> (raw)
In-Reply-To: <20200616114741.GA298183@fuller.cnet>

On 16/06/20 13:47, Marcelo Tosatti wrote:
> v2: improve changelog (Paolo Bonzini)
> 
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index 3156e25..39a6664 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -1772,6 +1772,8 @@ static int set_tsc_khz(struct kvm_vcpu *vcpu, u32 user_tsc_khz, bool scale)
>  
>  	/* TSC scaling supported? */
>  	if (!kvm_has_tsc_control) {
> +		if (!scale)
> +			return 0;

This cannot happen, there is an "if (!scale) right above.

>  		if (user_tsc_khz > tsc_khz) {
>  			vcpu->arch.tsc_catchup = 1;
>  			vcpu->arch.tsc_always_catchup = 1;
> @@ -4473,7 +4475,8 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
>  		r = -EINVAL;
>  		user_tsc_khz = (u32)arg;
>  
> -		if (user_tsc_khz >= kvm_max_guest_tsc_khz)
> +		if (kvm_has_tsc_control &&
> +		    user_tsc_khz >= kvm_max_guest_tsc_khz)
>  			goto out;
>  
>  		if (user_tsc_khz == 0)
> 

Queued this second hunk.

Paolo


      reply	other threads:[~2020-06-23  9:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-15 11:59 [PATCH] KVM: x86: allow TSC to differ by NTP correction bounds without TSC scaling Marcelo Tosatti
2020-06-15 12:20 ` Paolo Bonzini
2020-06-16 11:47   ` [PATCH v2] " Marcelo Tosatti
2020-06-23  9:56     ` 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=86cdffd8-a894-7e14-70f7-e5b0b3aceeda@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox