Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp6916263ybl; Wed, 15 Jan 2020 12:17:33 -0800 (PST) X-Google-Smtp-Source: APXvYqzm+Hpx51gOqB541ujP3wNeNNO4djIbYLpXGE6detZHK8OQVHRbBQvgqULiX8wDEqa/4w7m X-Received: by 2002:a05:6808:10d:: with SMTP id b13mr1319937oie.69.1579119453465; Wed, 15 Jan 2020 12:17:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579119453; cv=none; d=google.com; s=arc-20160816; b=R73RXBW2lVbcCx+CpphRonX+wkMNlRA0mNopF/hTwBLIvBl9hauR9S46Uj+QF1Dimc ri5fVwiqc7ymMYJ4QtV7Tl7axmwX4uN0Do4yMl/4rbSebopPoBMCwfDNQ2tnRTVUxlyE T8ESUhBqo/nw2ZdeG9RqNRzFjPWpS3EJq9OIxzeqjpJTuCHKsvL7THXoarK4I91Bj7dH Q3qxZ4Y5RHTerBA1UdyK9wtDkDdvvbnP7qwizDXU0UfP/PNf/7ScPHdoj/XGoxY2jXE5 1o3JiM9qwnBw3U2C/VDN9sHccGCajgoglI1mid3IpuFTYHIgDoMZQrlv5ttzK21L4uxM bcoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=XAOoF6ODE40nSICg/n/IVH1Ae5mEpEjc+z8ymDK3fMg=; b=u+b4y8M0xIvFaMhCGce8fLvXBuMeYd01U+IOL8LpRF/dpz/57bYNlKuq3x3cnINKUE kfPV7XUZ6YzJU9TQMs3K1jexaEKiyIFHvbiIU5odHZy33UhHIrV99m8+i/LVFQEwTV5p i0yboiqE/AQzjCIQkrQd2+F+QU0oByQRhJ9AEu8G4SAICh4BvANFpEH3eVlQ/KQo+puL V39Ky5ixAXUc80Q1bG3zf753NUXVAV89eI4qyKdgycJ+aJ/dWB6mrWWMSBbFFaog7oa3 G+dUe7ygbzXYFvtCOS9lLMDbH1ExyH5f5CfI+9rEVTbG250Q02DJTBGqvJRbuX0K9rKv KBHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mRDOOQg0; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w202si9632653oiw.194.2020.01.15.12.17.20; Wed, 15 Jan 2020 12:17:33 -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; dkim=pass header.i=@kernel.org header.s=default header.b=mRDOOQg0; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729141AbgAOUPu (ORCPT + 99 others); Wed, 15 Jan 2020 15:15:50 -0500 Received: from mail.kernel.org ([198.145.29.99]:39556 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729108AbgAOUPu (ORCPT ); Wed, 15 Jan 2020 15:15:50 -0500 Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F07192064C for ; Wed, 15 Jan 2020 20:15:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579119349; bh=l1Qq0CVhPL/GxMn+TDWXRowAL2bleP+DqLBLYN8WhwA=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=mRDOOQg0KKNaAZRiaZr1kbWc1mYG0F+s7Jrh3zJKE13cju0fE+wDybCKb1G9hYDj+ T7xe7X4etH6OxC690OmjmuS/2ON+R9pT5FVrt5szk/dwgSzEY1OX9bUepyJopF2UPD xezUvWg0dniokSmLanbeD01oybITFsWMA/gfObpI= Received: by mail-wr1-f44.google.com with SMTP id b6so17031606wrq.0 for ; Wed, 15 Jan 2020 12:15:48 -0800 (PST) X-Gm-Message-State: APjAAAXGuHO9JGHpKTc2+9nOZIz5n3rSHmSHlPA7EcYD+t9eLUJXqRbN 9k8+s5aKmKBRveUGX0y2QUePwG4uVFzFEYvDn0Y1nA== X-Received: by 2002:adf:f20b:: with SMTP id p11mr32200761wro.195.1579119347459; Wed, 15 Jan 2020 12:15:47 -0800 (PST) MIME-Version: 1.0 References: <03j72W25Dne_HDSwI8Y7xiXPzvEBX5Ezw_xw8ed8DC83bpdMxoPcjhbinNcDD0yeoX9GGN691f3kqqtGLztTnW8Pay3FrbO5sTlj3vjnh-Y=@protonmail.com> In-Reply-To: <03j72W25Dne_HDSwI8Y7xiXPzvEBX5Ezw_xw8ed8DC83bpdMxoPcjhbinNcDD0yeoX9GGN691f3kqqtGLztTnW8Pay3FrbO5sTlj3vjnh-Y=@protonmail.com> From: Andy Lutomirski Date: Wed, 15 Jan 2020 12:15:36 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] x86/tsc: Add tsc_guess flag disabling CPUID.16h use for tsc calibration To: Krzysztof Piecuch Cc: "linux-kernel@vger.kernel.org" , "juri.lelli@redhat.com" , "malat@debian.org" , 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" , "tglx@linutronix.de" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 14, 2020 at 6:39 AM Krzysztof Piecuch wrote: > > 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. > > Signed-off-by: Krzysztof Piecuch > --- > Documentation/admin-guide/kernel-parameters.txt | 6 ++++++ > arch/x86/kernel/tsc.c | 12 ++++++++++-- > 2 files changed, 16 insertions(+), 2 deletions(-) > > diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt > index ade4e6ec23e0..54ae9e153a19 100644 > --- a/Documentation/admin-guide/kernel-parameters.txt > +++ b/Documentation/admin-guide/kernel-parameters.txt > @@ -4905,6 +4905,12 @@ > interruptions from clocksource watchdog are not > acceptable). > > + 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 This has more negatives than makes sense. I also think it's wrong. How about: tsc_guess= ... Use data provided by CPUID.16h ...