mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 06:10:56 +00:00
KVM: arm64: timers: Use a per-vcpu, per-timer accumulator for fractional ns
Instead of accumulating the fractional ns value generated every time we compute a ns delta in a global variable, use a per-vcpu, per-timer variable. This keeps the fractional ns local to the timer instead of contributing to any odd, unrelated timer. Reviewed-by: Colton Lewis <coltonlewis@google.com> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20230330174800.2677007-2-maz@kernel.org
This commit is contained in:
parent
e8d018dd02
commit
0d0ae656b7
2 changed files with 2 additions and 1 deletions
|
@ -212,7 +212,7 @@ static u64 kvm_counter_compute_delta(struct arch_timer_context *timer_ctx,
|
|||
ns = cyclecounter_cyc2ns(timecounter->cc,
|
||||
val - now,
|
||||
timecounter->mask,
|
||||
&timecounter->frac);
|
||||
&timer_ctx->ns_frac);
|
||||
return ns;
|
||||
}
|
||||
|
||||
|
|
|
@ -44,6 +44,7 @@ struct arch_timer_context {
|
|||
|
||||
/* Emulated Timer (may be unused) */
|
||||
struct hrtimer hrtimer;
|
||||
u64 ns_frac;
|
||||
|
||||
/* Offset for this counter/timer */
|
||||
struct arch_timer_offset offset;
|
||||
|
|
Loading…
Reference in a new issue