lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3987740c-44b4-72fa-3b3e-ebccecc32b00@supermicro.com>
Date:   Fri, 13 Jul 2018 12:54:48 -0700
From:   patrickg <patrickg@...ermicro.com>
To:     Arjan van de Ven <arjan@...ux.intel.com>, <len.brown@...el.com>,
        <linux-kernel@...r.kernel.org>
CC:     <mingo@...nel.org>, <alek.du@...el.com>, <feng.tang@...el.com>
Subject: Re: [RFC] x86, tsc: Add kcmdline args for skipping tsc calibration
 sequences



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?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ