Messages in this thread | | | Date | Wed, 21 Oct 2015 21:01:09 +0200 | From | Peter Zijlstra <> | Subject | Re: [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).
| |