[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a7f58b0d-6145-4f56-8d53-8a90bee84fe9@xen.org>
Date: Fri, 24 May 2024 14:53:05 +0100
From: Paul Durrant <xadimgnik@...il.com>
To: David Woodhouse <dwmw2@...radead.org>, kvm@...r.kernel.org
Cc: Paolo Bonzini <pbonzini@...hat.com>, Jonathan Corbet <corbet@....net>,
Sean Christopherson <seanjc@...gle.com>, Thomas Gleixner
<tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>,
Borislav Petkov <bp@...en8.de>, Dave Hansen <dave.hansen@...ux.intel.com>,
x86@...nel.org, "H. Peter Anvin" <hpa@...or.com>,
Peter Zijlstra <peterz@...radead.org>, Juri Lelli <juri.lelli@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Steven Rostedt <rostedt@...dmis.org>, Ben Segall <bsegall@...gle.com>,
Mel Gorman <mgorman@...e.de>, Daniel Bristot de Oliveira
<bristot@...hat.com>, Valentin Schneider <vschneid@...hat.com>,
Shuah Khan <shuah@...nel.org>, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org, jalliste@...zon.co.uk, sveith@...zon.de,
zide.chen@...el.com, Dongli Zhang <dongli.zhang@...cle.com>,
Chenyi Qiang <chenyi.qiang@...el.com>
Subject: Re: [RFC PATCH v3 11/21] KVM: x86: Simplify and comment
kvm_get_time_scale()
On 22/05/2024 01:17, David Woodhouse wrote:
> From: David Woodhouse <dwmw@...zon.co.uk>
>
> Commit 3ae13faac400 ("KVM: x86: pass kvm_get_time_scale arguments in hertz")
> made this function take 64-bit values in Hz rather than 32-bit kHz. Thus
> making it entrely pointless to shadow its arguments into local 64-bit
> variables. Just use scaled_hz and base_hz directly.
>
> Also rename the 'tps32' variable to 'base32', having utterly failed to
> think of any reason why it might have been called that in the first place.
> This could probably have been eliminated too, but it helps to make the
> code clearer and *might* just help a naïve 32-bit compiler realise that it
> doesn't need to do full 64-bit shifts.
>
> Having taken the time to reverse-engineer the function, add some comments
> explaining it.
>
> No functional change intended.
>
> Signed-off-by: David Woodhouse <dwmw@...zon.co.uk>
> ---
> arch/x86/kvm/x86.c | 60 ++++++++++++++++++++++++++++++++++++----------
> 1 file changed, 47 insertions(+), 13 deletions(-)
>
Reviewed-by: Paul Durrant <paul@....org>
Powered by blists - more mailing lists