From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752965AbbKQJMI (ORCPT ); Tue, 17 Nov 2015 04:12:08 -0500 Received: from www.linutronix.de ([62.245.132.108]:45564 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751606AbbKQJMB (ORCPT ); Tue, 17 Nov 2015 04:12:01 -0500 Date: Tue, 17 Nov 2015 10:11:03 +0100 (CET) From: Thomas Gleixner To: Borislav Petkov cc: "H. Peter Anvin" , Peter Zijlstra , x86-ml , Andy Lutomirski , Steven Rostedt , lkml Subject: Re: [RFC PATCH -v2.1] x86: Kill notsc In-Reply-To: <20151117085345.GB8819@pd.tnic> Message-ID: References: <20151018142007.GA11294@pd.tnic> <20151021175803.GF3575@pd.tnic> <20151021190109.GC2508@worktop.programming.kicks-ass.net> <20151022185122.GC3442@pd.tnic> <20151104102941.GA1235@pd.tnic> <20151116184548.GA20137@pd.tnic> <564AB4D7.20606@zytor.com> <20151117085345.GB8819@pd.tnic> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 17 Nov 2015, Borislav Petkov wrote: > On Mon, Nov 16, 2015 at 09:02:15PM -0800, H. Peter Anvin wrote: > > On 11/16/15 13:25, Thomas Gleixner wrote: > > > On Mon, 16 Nov 2015, Borislav Petkov wrote: > > >> -/* > > >> - * disable flag for tsc. Takes effect by clearing the TSC cpu flag > > >> - * in cpu/common.c > > >> - */ > > >> -int __init notsc_setup(char *str) > > >> +/* Disable the TSC feature flag to avoid further TSC use. */ > > >> +int __init notsc_setup(void) > > >> { > > >> +#ifndef CONFIG_X86_TSC > > >> setup_clear_cpu_cap(X86_FEATURE_TSC); > > > > > > This is silly, really. > > > > > > If CONFIG_X86_TSC is disabled then we should just not compile tsc.c at > > > all and map cpu_has_tsc and stuff depending on it to false. > > > > > > > CONFIG_X86_TSC means TSC is obligatory, not that it is supported. > > Hmm, I'd still need to untangle tsc.c though for people who want to > disable it for whatever reason. There is an interesting problem: tsc_init() { tsc_khz = x86_platform.calibrate_tsc(); if (!tsc_khz) { mark_tsc_unstable("could not calculate TSC khz"); ... } In the current code we do NOT use TSC for sched_clock() and that's correct as we have no idea what the TSC frequency is. With your changes that is not longer the case, so you end up with a completely wreckaged sched clock. Thanks, tglx