lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20151021190109.GC2508@worktop.programming.kicks-ass.net>
Date:	Wed, 21 Oct 2015 21:01:09 +0200
From:	Peter Zijlstra <peterz@...radead.org>
To:	Borislav Petkov <bp@...en8.de>
Cc:	x86-ml <x86@...nel.org>, Andy Lutomirski <luto@...capital.net>,
	Steven Rostedt <rostedt@...dmis.org>,
	lkml <linux-kernel@...r.kernel.org>
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).
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ