Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp7057585ybl; Wed, 15 Jan 2020 14:50:55 -0800 (PST) X-Google-Smtp-Source: APXvYqzUDjP6No9Fm23JL0dM71y/VSrFGHVgUj2bqogNpBiwc6PcarL4/w/EtjHB2yMOYr/RP76C X-Received: by 2002:a9d:f26:: with SMTP id 35mr4680536ott.260.1579128655230; Wed, 15 Jan 2020 14:50:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579128655; cv=none; d=google.com; s=arc-20160816; b=FXEZjD1RF/f/SRlnDhUSPysCmHLC4klLTe1GzR08yN7mqa21wAfwG1ic7U/i9ubMqg hkwBRgYwH1W79UpxqrGwWlvSDT+fut1bIVGko0FoyJFRJ3sM3nMWbtRyTbK6VeaBsLkL HAkmNXl+VCe9yyL2sDjvGVY7lkjaAhpM1u1E1Im2pn9Hsj8usIuTEW9frRFw0qcxSBrv DDJ4nKtvexzDCfQgS6AwwJ9k6xbaEqdg7nSWxcAiLI6eVjiqDKZxb2SyHbKSRP/aHuQH wZrvC4MNDznZ/aXlfobwNlmp2K7mBYwifgdnWh3vH42Ti4S3ulvqE54KCjFoBApDfehK /mcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=5GrfEAJhvvJ5HrxSe2Vr9h3LUaxbJqWEY/JbIqGCRq8=; b=Cme//G3yN3RskpRKbFgChE2AhkGpusAmmnaGnkd5zU0ivJIjbLYpiNk7+5SULd8DwO v52Dk4jb4WHVfwKfsDIQEGCRshSIKvpIgeMnxJHfHUtF1O3WGC4KOp2pX6hYeSOT5lCG 8SUBXBLxlp6UlApt9YNTNviujgtGEXbXQN+xNtB7Kh6XGTubwdE5JR/X9Q03RwMwjNYC X2hcKdBtHY6aWLDxuYGT+1ptvy5QwJVKysVxPH104ufmS9hrjeCz+m+TELduNA97m1/v L9hfMxJiROLidBKr9b/YniTRdndd5fwKQsSNah04DiPgWhAbZC4T5g/3xbQtJS3ZvHPw cs2w== 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 r6si11188157otq.95.2020.01.15.14.50.43; Wed, 15 Jan 2020 14:50:55 -0800 (PST) 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 S1729792AbgAOVre (ORCPT + 99 others); Wed, 15 Jan 2020 16:47:34 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:49315 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726187AbgAOVrd (ORCPT ); Wed, 15 Jan 2020 16:47:33 -0500 Received: from p5b06da22.dip0.t-ipconnect.de ([91.6.218.34] 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 1irqVO-0001fH-05; Wed, 15 Jan 2020 22:47:14 +0100 Received: by nanos.tec.linutronix.de (Postfix, from userid 1000) id 74BEA101228; Wed, 15 Jan 2020 22:47:13 +0100 (CET) From: Thomas Gleixner To: Krzysztof Piecuch , "linux-kernel\@vger.kernel.org" Cc: "juri.lelli\@redhat.com" , "malat\@debian.org" , "piecuch\@protonmail.com" , Peter Zijlstra , "mzhivich\@akamai.com" , "viresh.kumar\@linaro.org" , "drake\@endlessm.com" , "rafael.j.wysocki\@intel.com" , "x86\@kernel.org" , "hpa\@zytor.com" , "bp\@alien8.de" , "mingo\@redhat.com" Subject: Re: [PATCH] x86/tsc: Add tsc_guess flag disabling CPUID.16h use for tsc calibration In-Reply-To: <03j72W25Dne_HDSwI8Y7xiXPzvEBX5Ezw_xw8ed8DC83bpdMxoPcjhbinNcDD0yeoX9GGN691f3kqqtGLztTnW8Pay3FrbO5sTlj3vjnh-Y=@protonmail.com> References: <03j72W25Dne_HDSwI8Y7xiXPzvEBX5Ezw_xw8ed8DC83bpdMxoPcjhbinNcDD0yeoX9GGN691f3kqqtGLztTnW8Pay3FrbO5sTlj3vjnh-Y=@protonmail.com> Date: Wed, 15 Jan 2020 22:47:13 +0100 Message-ID: <87pnfkxuhq.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Krzysztof Piecuch writes: > Changing base clock frequency directly impacts tsc hz but not CPUID.16h > values. An overclocked CPU supporting CPUID.16h and partial CPUID.15h > support will set tsc hz according to "best guess" given by CPUID.16h > relying on tsc_refine_calibration_work to give better numbers later. > tsc_refine_calibration_work will refuse to do its work when the outcome is > off the early tsc hz value by more than 1% which is certain to happen on an > overclocked system. The above sets the context which is great, but it does not explain what the solution is. > + tsc_guess= [X86,INTEL] Don't use data provided by CPUID.16h during > + early tsc calibration. Disabling this may be useful for > + CPUs with altered base clocks. > + Format: (1/Y/y=enable, 0/N/n=disable) > + default: enabled That's really a misnomer. CPUID.16h is way more than a guess. It's pretty accurate except for the case you describe. This command line option should clearly tell what it is about, i.e. overclocking. Aside of that we have to be careful because on quite some modern systems CPUID 16h is the only way to calibrate TSC and local APIC because PIT and HPET are either not exposed or disfunct. So disabling CPUID.16h should be prominently noted in dmesg. Thanks, tglx