lkml.org 
[lkml]   [2018]   [Nov]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v1 1/1] arm64: Early boot time stamps
On Tue, Nov 20, 2018 at 09:40:10AM -0500, Pavel Tatashin wrote:
> > > +static __init void sched_clock_early_init(void)
> > > +{
> > > + u64 freq = arch_timer_get_cntfrq();
> > > + u64 (*read_time)(void) = arch_counter_get_cntvct;
> >
> > We already have arch_timer_read_counter which is exposed from
> > arm_arch_timer.h.
>
> OK
>
> >
> > > +
> > > + /* Early clock is available only on platforms with known freqs */
> >
> > This comment is misleading. It should read something like:
> >
> > /*
> > * The arm64 boot protocol mandates that CNTFRQ_EL0 reflects
> > * the timer frequency. To avoid breakage on misconfigured
> > * systems, do not register the early sched_clock if the
> > * programmed value if zero. Other random values will just
> > * result in random output.
> > */
> >
>
> OK
>
> > > + if (!freq)
> > > + return;
> > > +
> > > + sched_clock_register(read_time, BITS_PER_LONG, freq);
> >
> > This doesn't seem right. The counter has an architected minimum of 56
> > bits, and you can't assume that it is going to be more than that.
>
> Yeah, I saw 56 is used in arm_arch_timer.c, but I could not find where
> this minimum is defined in aarch64 specs. I will change it to 56.

See section G5.1.2 of the ARM ARM for details.

Thanks,

Andrew Murray

>
> I will send v2 soon.
>
> Thank you,
> Pasha

\
 
 \ /
  Last update: 2018-11-20 15:55    [W:0.056 / U:0.368 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site