Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1332132 > unrolled thread

Re: [PATCH 1/4] KVM: x86: rename argument to kvm_set_tsc_khz

Started byMarcelo Tosatti <mtosatti@redhat.com>
First post2016-02-11 16:10 +0100
Last post2016-02-11 16:10 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 1/4] KVM: x86: rename argument to kvm_set_tsc_khz Marcelo Tosatti <mtosatti@redhat.com> - 2016-02-11 16:10 +0100

#1332132 — Re: [PATCH 1/4] KVM: x86: rename argument to kvm_set_tsc_khz

FromMarcelo Tosatti <mtosatti@redhat.com>
Date2016-02-11 16:10 +0100
SubjectRe: [PATCH 1/4] KVM: x86: rename argument to kvm_set_tsc_khz
Message-ID<r112y-23q-13@gated-at.bofh.it>
On Mon, Feb 08, 2016 at 04:18:28PM +0100, Paolo Bonzini wrote:
> This refers to the desired (scaled) frequency, which is called
> user_tsc_khz in the rest of the file.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  arch/x86/kvm/x86.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index aafbcf9f9776..1ca2b44f70bb 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -1290,23 +1290,23 @@ static int set_tsc_khz(struct kvm_vcpu *vcpu, u32 user_tsc_khz, bool scale)
>  	return 0;
>  }
>  
> -static int kvm_set_tsc_khz(struct kvm_vcpu *vcpu, u32 this_tsc_khz)
> +static int kvm_set_tsc_khz(struct kvm_vcpu *vcpu, u32 user_tsc_khz)
>  {
>  	u32 thresh_lo, thresh_hi;
>  	int use_scaling = 0;
>  
>  	/* tsc_khz can be zero if TSC calibration fails */
> -	if (this_tsc_khz == 0) {
> +	if (user_tsc_khz == 0) {
>  		/* set tsc_scaling_ratio to a safe value */
>  		vcpu->arch.tsc_scaling_ratio = kvm_default_tsc_scaling_ratio;
>  		return -1;
>  	}
>  
>  	/* Compute a scale to convert nanoseconds in TSC cycles */
> -	kvm_get_time_scale(this_tsc_khz, NSEC_PER_SEC / 1000,
> +	kvm_get_time_scale(user_tsc_khz, NSEC_PER_SEC / 1000,
>  			   &vcpu->arch.virtual_tsc_shift,
>  			   &vcpu->arch.virtual_tsc_mult);
> -	vcpu->arch.virtual_tsc_khz = this_tsc_khz;
> +	vcpu->arch.virtual_tsc_khz = user_tsc_khz;
>  
>  	/*
>  	 * Compute the variation in TSC rate which is acceptable
> @@ -1316,11 +1316,11 @@ static int kvm_set_tsc_khz(struct kvm_vcpu *vcpu, u32 this_tsc_khz)
>  	 */
>  	thresh_lo = adjust_tsc_khz(tsc_khz, -tsc_tolerance_ppm);
>  	thresh_hi = adjust_tsc_khz(tsc_khz, tsc_tolerance_ppm);
> -	if (this_tsc_khz < thresh_lo || this_tsc_khz > thresh_hi) {
> -		pr_debug("kvm: requested TSC rate %u falls outside tolerance [%u,%u]\n", this_tsc_khz, thresh_lo, thresh_hi);
> +	if (user_tsc_khz < thresh_lo || user_tsc_khz > thresh_hi) {
> +		pr_debug("kvm: requested TSC rate %u falls outside tolerance [%u,%u]\n", user_tsc_khz, thresh_lo, thresh_hi);
>  		use_scaling = 1;
>  	}
> -	return set_tsc_khz(vcpu, this_tsc_khz, use_scaling);
> +	return set_tsc_khz(vcpu, user_tsc_khz, use_scaling);
>  }
>  
>  static u64 compute_guest_tsc(struct kvm_vcpu *vcpu, s64 kernel_ns)
> -- 
> 1.8.3.1
> 

Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com>

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web