Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2796829yba; Mon, 8 Apr 2019 05:05:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqykZLvtzDFTUbDrH5UnurJy6LBG4BbkswlFWYBfGPbAHq8b3Dfsbn3DQsZcO/UrxRLSSYFf X-Received: by 2002:aa7:8384:: with SMTP id u4mr29258426pfm.214.1554725117275; Mon, 08 Apr 2019 05:05:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554725117; cv=none; d=google.com; s=arc-20160816; b=H0k+dFIjb5VLr/o2YuzSEHfGz1rDefWLgeqDD6yvgiwYI3AFjB87OkmtT2H1AzarjW 7m7jMdjxsfnuQ3S6zXei3saC+rbM2t9t3J5SJYydlop/0IGffLOxRwtqj2PvLB2pXHmR hl3HlKtIk9g/dD/3HvnKHz2bk9hx/iWPK4h8DArB2uNRx3cDQ+5paOjUqS9zMxhXmfA/ AEOlKNnDZ1CSyM0plmZISTS1Kj4YRqJ/yOciWPNmFT75I3JqmIDKxaMqc3uD1df8KykC Fg10GdLX5sXysJbq6i+pfxfGhPYvr/7Tg3aHwRWPkcQ1eZ+LRLorUZA5SnJTgtF2nXS5 Kr0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=LfuawTc6oc5O7s/u33zid9c0z5HHkO3fVQLqF0Lchko=; b=U1Dd544ljrh49DFlgf5ZPVvRlQ2edevBdGgwiZziNcAQc6EKMHTj2NAgaR/9h/Bn2+ VDiqCtez0a5EIEQOCqC22SnoRwm/R5bINc0qQcUxr/OY4+xedxb2nRij3cCfHdQe9yrs 2TJDJk6QCOr0Z2tHD1KIc50rLWrisMoV2XhBXViTXo8uMcc+jfr1seHn/ofTcvo2gmiu guQqAjXzhLZmdRkr0MG+yJ2mAbcnzwfQbYm4wlErduF4/un55kLzaxOx7+AplLZIZtwu PI3x+3pw7VrDYWYe80ru3cH18tGnA9zYaaxIVDoRkk1OGZA7RkTQvz07WWpo5vBUa8IY h2QQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c127si27510901pfc.256.2019.04.08.05.05.01; Mon, 08 Apr 2019 05:05:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726570AbfDHMEN (ORCPT + 99 others); Mon, 8 Apr 2019 08:04:13 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:52238 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726220AbfDHMEN (ORCPT ); Mon, 8 Apr 2019 08:04:13 -0400 Received: from [5.158.153.52] (helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1hDT01-0003go-Hu; Mon, 08 Apr 2019 14:03:41 +0200 Date: Mon, 8 Apr 2019 14:03:36 +0200 (CEST) From: Thomas Gleixner To: You-Sheng Yang cc: Ingo Molnar , Borislav Petkov , x86@kernel.org, Pavel Tatashin , Peter Zijlstra , "Rafael J. Wysocki" , Dou Liyang , Daniel Vacek , Mike Travis , Xiaoming Gao , You-Sheng Yang , "H. Peter Anvin" , Chuanhua Lei , Juergen Gross , linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86/tsc: mark tsc reliable on CoffeeLake In-Reply-To: <20190408104012.26791-1-vicamo@gmail.com> Message-ID: References: <20190408104012.26791-1-vicamo@gmail.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 8 Apr 2019, You-Sheng Yang wrote: > From: You-Sheng Yang > > On Intel CoffeeLake it's observed tsc is always marked unstable > unexpectedly after entering idle state Package C10(PC10), and then clock > source is switched to hpet. This patch marks tsc as reliable when CPUID > matches CoffeeLake. This lacks a proper analysis: 1) Why is it marked unstable 2) Why is it correct to set that for coffeelake > Link: https://bugzilla.kernel.org/show_bug.cgi?id=203183 > Signed-off-by: You-Sheng Yang > --- > arch/x86/kernel/tsc.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c > index aab0c82e0a0d..2abbadc9cff0 100644 > --- a/arch/x86/kernel/tsc.c > +++ b/arch/x86/kernel/tsc.c > @@ -1161,6 +1161,16 @@ static void __init check_system_tsc_reliable(void) > #endif > if (boot_cpu_has(X86_FEATURE_TSC_RELIABLE)) > tsc_clocksource_reliable = 1; > + > + /* > + * On Intel CoffeeLake, tsc may be marked unstable unexpectedly after > + * entering PC10. > + */ > + if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL && > + (boot_cpu_data.x86_model == INTEL_FAM6_KABYLAKE_MOBILE || > + boot_cpu_data.x86_model == INTEL_FAM6_KABYLAKE_DESKTOP) && > + boot_cpu_data.x86_stepping >= 0x0a) > + tsc_clocksource_reliable = 1; No. We are not starting that family/model/stepping game especially not with random stepping cutoffs which are pulled out of thin air. That's going to spiral out of control sooner than later. There must be a better way to do that. Rafael? Thanks, tglx