Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1172235imm; Fri, 13 Jul 2018 12:56:12 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcu5j49+Xi43CRof0Uh9CLQCgG3dDFvyZzNyEem+RSOqc2hSpLzWv4fndLiqI8/A1wiNS0O X-Received: by 2002:a62:591a:: with SMTP id n26-v6mr8534532pfb.94.1531511772526; Fri, 13 Jul 2018 12:56:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531511772; cv=none; d=google.com; s=arc-20160816; b=a8KD54vXy7QJCwUXJgPDleRbfah/1a4vIA/VYApS/A8ibytA5OLzC6KGxGX6NDgAZg Svg4KJhTGSPzWnLRgoCINqlUubRtXQH0but2PlatwYhbMiaawUej2t0Mvi+IYb1sGClW DG6C+rvkKVO4yrhDShC9Sehgeya/KOsN6Ee5GO1Jvi2Y3KzH0i6lEGiy11rTjeyyVPJF MzYG55j6YBrGb7M7i3Xz3gvTQE37cyTE7LVjy3AhxKP/Qaa2N20UOKVcCRkqdRd1qKuY tUEC3gcfUwHKPYFv9WMRx+QErB9jSgIO5eaaF5HO6lR8ls6F4Ry/Ul5jdM6KzlU9VWTt Xaug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=A39jJQKKQcZBORC0vGfyWu25MJzfeSnCRDU4ORWMAyo=; b=nE9xzcqqo3tEPCBNEc39XxB54kFfBGESzR50uLCAhJo4TVfeX+0YfJMmtPs+I7nhhp dLJ0zbTHVN60Tsh+xeMqxjKK+sAqt4lSjhIKP34pOA4wxGQ4XpI1Y82YG+c6XrgR8x9K 05gr5ZuFCVuLXb059LVZ/QddV9YfARo2ahjZrU3GLC7wajVyYVCq/2pcWujFBS+BV2qJ xXEE3eH3QT9k/sqCPsq/aqPgXDSacrJoAywISVsr5ei5ApZbvK6+AGb7Ew7eAsMn3pnO vBfX5D9TaI8QRub35Q3qjSazEaBq3hKfasp0192q8Eu2sN1X1h37/1vGc0lG87jNdtpS PfDg== 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 h1-v6si25382702pll.416.2018.07.13.12.55.58; Fri, 13 Jul 2018 12:56:12 -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 S1731949AbeGMUKz (ORCPT + 99 others); Fri, 13 Jul 2018 16:10:55 -0400 Received: from mgb.supermicro.com ([207.212.57.85]:35524 "EHLO mgb.supermicro.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730017AbeGMUKz (ORCPT ); Fri, 13 Jul 2018 16:10:55 -0400 Received: from pps.filterd (MGB.supermicro.com [127.0.0.1]) by MGB.supermicro.com (8.16.0.22/8.16.0.22) with SMTP id w6DJnmZh000826; Fri, 13 Jul 2018 12:54:49 -0700 Received: from ex2013-mbx2.supermicro.com ([10.2.1.38]) by MGB.supermicro.com with ESMTP id 2k2w4s8tf1-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Fri, 13 Jul 2018 12:54:49 -0700 Received: from [172.16.95.100] (10.2.0.41) by Ex2013-MBX2.supermicro.com (10.2.1.38) with Microsoft SMTP Server (TLS) id 15.0.1236.3; Fri, 13 Jul 2018 12:53:56 -0700 Subject: Re: [RFC] x86, tsc: Add kcmdline args for skipping tsc calibration sequences To: Arjan van de Ven , , CC: , , References: <9cdcf3bb-4d01-19cc-536f-4745ecb058c6@linux.intel.com> From: patrickg Message-ID: <3987740c-44b4-72fa-3b3e-ebccecc32b00@supermicro.com> Date: Fri, 13 Jul 2018 12:54:48 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <9cdcf3bb-4d01-19cc-536f-4745ecb058c6@linux.intel.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.2.0.41] X-ClientProxiedBy: EX2013-CA1.supermicro.com (10.2.1.31) To Ex2013-MBX2.supermicro.com (10.2.1.38) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-07-13_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=794 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807130179 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/13/2018 12:40 PM, Arjan van de Ven wrote: > On 7/13/2018 12:19 PM, patrickg wrote: >> This RFC patch is intended to allow bypass CPUID, MSR and QuickPIT calibration methods should the user desire to. >> >> The current ordering in ML x86 tsc is to calibrate in the order listed above; returning whenever there's a successful calibration.  However there are certain BIOS/HW Designs for overclocking that cause the TSC to change along with the max core clock; and simple 'trusting' calibration methodologies will lead to the TSC running 'faster' and eventually, TSC instability. >> > > > that would be a real violation of the contract between cpu and OS: tsc is not supposed to change for the duration of the boot With the methodology used; the TSC is still invariant; it's just running faster than the CPUID math calculates. > >> I only know that there's a use-case for me to want to be able to skip CPUID calibration, however I included args for skipping all the rest just so that all functionality is covered in the long run instead of just one use-case. > > wouldn't it be better to start the detailed calibration with the value from CPUID instead; that way we also properly calibrate spread spectrum etc... > > I thought we switched to that recently to be honest... Are you referencing: 1bf8915ae5156dff439d2c65314bd8fdde1b83bf - x86/tsc: Enumerate SKL cpu_khz and tsc_khz via CPUID However since it's returning at CPUID calibration during native_calibrate_cpu(); it's not compared after-the-fact, leading to the TSC to use the 'slower' number returned by CPUID. Now keep in mind; I dunno if there was any reason to explicitly not want to utilize the PIT calib sequences on SKL. That'd be a factor for this. Would comparing the number after the fact; then if there's a significant difference between PIT and MSR/CPUID, defaulting to the 'faster' value be a better solution?