lkml.org 
[lkml]   [2015]   [Oct]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH] x86: Kill notsc
On Wed, Oct 21, 2015 at 07:58:03PM +0200, Borislav Petkov wrote:
> > +#ifdef CONFIG_X86_TSC
> > + /* return the value in ns */
> > + return cycles_2_ns(rdtsc());
> > +#else
>
> Ok, we have a problem here:
>
> See the splat below. On the init path
>
> start_kernel
> |-> sched_init
> |-> init_idle
>
> we're calling sched_clock() which does the cycles_2_ns() thing.
>
> However, that cycles_2_ns() thing gets called only in tsc_init() which
> comes later in start_kernel().
>
> Which means, data in this line
>
> ns += mul_u64_u32_shr(cyc, data->cyc2ns_mul, data->cyc2ns_shift);
>
> is NULL.
>
> Now, the question is, can I push only the cyc2ns_init() call up, before
> sched_init()?

I _think_ so, but its late. It would result in sched_clock() being 0
until you hit that other bit, but that should be fine (maybe).


\
 
 \ /
  Last update: 2015-10-21 21:21    [W:0.107 / U:0.772 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site