lkml.org 
[lkml]   [2021]   [May]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v3 04/12] KVM: X86: Add a ratio parameter to kvm_scale_tsc()
From
Date
On Mon, 2021-05-24 at 16:23 +0200, Paolo Bonzini wrote:
> On 21/05/21 12:24, Ilias Stamatis wrote:
> > @@ -3537,10 +3539,14 @@ int kvm_get_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
> > * return L1's TSC value to ensure backwards-compatible
> > * behavior for migration.
> > */
> > - u64 tsc_offset = msr_info->host_initiated ? vcpu->arch.l1_tsc_offset :
> > - vcpu->arch.tsc_offset;
> > -
> > - msr_info->data = kvm_scale_tsc(vcpu, rdtsc()) + tsc_offset;
> > + if (msr_info->host_initiated)
> > + msr_info->data = kvm_scale_tsc(
> > + vcpu, rdtsc(), vcpu->arch.l1_tsc_scaling_ratio
> > + ) + vcpu->arch.l1_tsc_offset;
>
> Better indentation:
>
> msr_info->data = vcpu->arch.l1_tsc_offset +
> kvm_scale_tsc(vcpu, rdtsc(),
> vcpu->arch.tsc_scaling_ratio);

Good idea IMHO.
Other than that:

Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>



>
> Same below.
>
> Paolo
>
> > + else
> > + msr_info->data = kvm_scale_tsc(
> > + vcpu, rdtsc(), vcpu->arch.tsc_scaling_ratio
> > + ) + vcpu->arch.tsc_offset;
> > break;
> > }
> > case MSR_MTRRcap:
> >


\
 
 \ /
  Last update: 2021-05-24 19:52    [W:0.098 / U:0.716 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site