Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3350558yba; Tue, 23 Apr 2019 02:10:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqxtxVmtbP9Rhz0/tLA8IVaHmY1x9h4gZTzg4gT6AnldVwEVr14kGs2oLBCQXe5ioiWS1Mkb X-Received: by 2002:a65:6294:: with SMTP id f20mr23262706pgv.415.1556010603145; Tue, 23 Apr 2019 02:10:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556010603; cv=none; d=google.com; s=arc-20160816; b=BtJSKbl3/gNpsqskStBd8SJ/HkVM1Rqjb5LYR/sdLR0SnEgigwaiIiAQ8LRdjqdUnS RoubexmagrrF6ilxruKJQR+f5VruEUFOzLQNyCfChZaqrlweHL+DWPAKfputymIItBBh Cn09nQsY0JOnek5ZspGXs0IcvQmlRbNMOTdqqW/nNn0ukK3R12+1nWU6mPedjfbulEzc 3YxmeEDpcFkjZ92+vUOAfiZ/BLQyU4C1EiVcEap4i55KzF9yS+N1kn5rJqPyxuPD4d4r uIl+FmjSuAa83+/QkkI8y+RM5FHIgp/osqKtU7iFQYnmumPsUYXDTCFaiWEsuYZ0KbWx PudQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=RfXhvFzNh2NmHm6BVWXsN7mAOe1Vtl6T9nfC2Mr+z0A=; b=OcVrtYiXJ8AUKWIe8wcKlMD8LAe0ComgdOqMPuntQPgdpMKPDhaM8w5e338kRJEQQK xrnCziemvjJNTvdZ5yBexbKmd3+MkEJKgWhxvqB8pMuuRVXwQtjk03wNN20L1RmLsIop wa8uolVt/4fZsuA+Kz2x/PB+kCAvqdYsVIjAdaUwCaCEYnhSYn6qUVr5I1aBkCca0jtc lOHbAf08CZoZXao/JjSArfXxxwPh6sxvIaLf4nIWKejrLYYYbrZu4QyNnkB1s7ErsWm2 C+ZBcC++mpjte/lCp3Ekj1F3nZSl1bdWCMGiRNlxZhgEdIEPB567wQuO9xaYOxPCMaDt 9wzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=P7vNHkjX; 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 u13si14822548pgn.592.2019.04.23.02.09.47; Tue, 23 Apr 2019 02:10:03 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=P7vNHkjX; 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 S1726966AbfDWJI5 (ORCPT + 99 others); Tue, 23 Apr 2019 05:08:57 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:51944 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725888AbfDWJI4 (ORCPT ); Tue, 23 Apr 2019 05:08:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=RfXhvFzNh2NmHm6BVWXsN7mAOe1Vtl6T9nfC2Mr+z0A=; b=P7vNHkjXHhku/Hm3TA/2LaUdu aBfxwtEddeb3OMvmdoOrErcUUpda2retRHH9XJJ7Z8Dd3AMyEuG1iQNovZa8sGL1R9MA3qqRyr6wP cSRN974upjlFDxOZBV1CP6Na2Y5Xwt0OtSFaEKin5Pk5+SJtxeGOIBrdoOTc3EShfpuqTklNIlMqG hWoZhh9Gzx9Qb66JbGyaAiIAWkUUG3f4MS2/L/k5DBe1EwTSIq/I9fTcjAOyVDPp+8vM4nG0fG/0N e3BdjXXVOvXSTxFZrNbRFYjyRIfYLAAAngDVJduK10G12FlRli5wdwoe69V1GN7vr+Xnz6veuFcRW Y8D/koNsg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1hIrQ3-0008Qa-2J; Tue, 23 Apr 2019 09:08:51 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 7E6BE29B47DCD; Tue, 23 Apr 2019 11:08:49 +0200 (CEST) Date: Tue, 23 Apr 2019 11:08:49 +0200 From: Peter Zijlstra To: Daniel Drake Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, x86@kernel.org, linux-kernel@vger.kernel.org, len.brown@intel.com, rafael.j.wysocki@intel.com, linux@endlessm.com Subject: Re: [PATCH 1/2] x86/tsc: use CPUID.0x16 to calculate missing crystal frequency Message-ID: <20190423090849.GH11158@hirez.programming.kicks-ass.net> References: <20190422101526.28415-1-drake@endlessm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190422101526.28415-1-drake@endlessm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 22, 2019 at 06:15:25PM +0800, Daniel Drake wrote: > Additionally, crystal clock frequency for platforms that were missing > from the list (e.g. SKYLAKE_X) will now be provided. Well, SKX isn't exactly 'missing'; it would be very good if we can confirm the new code is still correct under the below mentioned conditions. --- commit b511203093489eb1829cb4de86e8214752205ac6 Author: Len Brown Date: Fri Dec 22 00:27:55 2017 -0500 x86/tsc: Fix erroneous TSC rate on Skylake Xeon The INTEL_FAM6_SKYLAKE_X hardcoded crystal_khz value of 25MHZ is problematic: - SKX workstations (with same model # as server variants) use a 24 MHz crystal. This results in a -4.0% time drift rate on SKX workstations. - SKX servers subject the crystal to an EMI reduction circuit that reduces its actual frequency by (approximately) -0.25%. This results in -1 second per 10 minute time drift as compared to network time. This issue can also trigger a timer and power problem, on configurations that use the LAPIC timer (versus the TSC deadline timer). Clock ticks scheduled with the LAPIC timer arrive a few usec before the time they are expected (according to the slow TSC). This causes Linux to poll-idle, when it should be in an idle power saving state. The idle and clock code do not graciously recover from this error, sometimes resulting in significant polling and measurable power impact. Stop using native_calibrate_tsc() for INTEL_FAM6_SKYLAKE_X. native_calibrate_tsc() will return 0, boot will run with tsc_khz = cpu_khz, and the TSC refined calibration will update tsc_khz to correct for the difference. [ tglx: Sanitized change log ] Fixes: 6baf3d61821f ("x86/tsc: Add additional Intel CPU models to the crystal quirk list") Signed-off-by: Len Brown Signed-off-by: Thomas Gleixner Cc: peterz@infradead.org Cc: Prarit Bhargava Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/ff6dcea166e8ff8f2f6a03c17beab2cb436aa779.1513920414.git.len.brown@intel.com diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c index ce4b71119c36..3bf4df7f52d7 100644 --- a/arch/x86/kernel/tsc.c +++ b/arch/x86/kernel/tsc.c @@ -602,7 +602,6 @@ unsigned long native_calibrate_tsc(void) case INTEL_FAM6_KABYLAKE_DESKTOP: crystal_khz = 24000; /* 24.0 MHz */ break; - case INTEL_FAM6_SKYLAKE_X: case INTEL_FAM6_ATOM_DENVERTON: crystal_khz = 25000; /* 25.0 MHz */ break;