[PATCH v6 01/25] KVM: arm64: Generalize trace clock

Vincent Donnefort vdonnefort at google.com
Fri Jul 10 07:24:36 PDT 2026


[...]

> > diff --git a/arch/arm64/kvm/hyp/nvhe/trace.c b/arch/arm64/kvm/hyp/nvhe/trace.c
> > index a6ca27b18e15..e30de840e6c2 100644
> > --- a/arch/arm64/kvm/hyp/nvhe/trace.c
> > +++ b/arch/arm64/kvm/hyp/nvhe/trace.c
> > @@ -35,7 +35,7 @@ static bool hyp_trace_buffer_loaded(struct hyp_trace_buffer *trace_buffer)
> >  void *tracing_reserve_entry(unsigned long length)
> >  {
> >  	return simple_ring_buffer_reserve(this_cpu_ptr(trace_buffer.simple_rbs), length,
> > -					  trace_clock());
> > +					  hyp_clock_ns());
> >  }
> >  
> >  void tracing_commit_entry(void)
> > @@ -285,7 +285,7 @@ void __tracing_update_clock(u32 mult, u32 shift, u64 epoch_ns, u64 epoch_cyc)
> >  	}
> >  
> >  	/* ...we can now override the old one and swap. */
> > -	trace_clock_update(mult, shift, epoch_ns, epoch_cyc);
> > +	hyp_clock_update(mult, shift, epoch_ns, epoch_cyc);

And also in any case we have two behaviours: one when tracing is running
(sync'ed hyp_clock) and one when it is not (floating hyp_clock)

So we might well do floating all the time.

> >  }
> >  
> >  int __tracing_reset(unsigned int cpu)
> > -- 
> > 2.54.0.545.g6539524ca2-goog
> > 



More information about the linux-arm-kernel mailing list