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]
Date:   Wed, 15 Jan 2020 22:47:13 +0100
From:   Thomas Gleixner <tglx@...utronix.de>
To:     Krzysztof Piecuch <piecuch@...tonmail.com>,
        "linux-kernel\@vger.kernel.org" <linux-kernel@...r.kernel.org>
Cc:     "juri.lelli\@redhat.com" <juri.lelli@...hat.com>,
        "malat\@debian.org" <malat@...ian.org>,
        "piecuch\@protonmail.com" <piecuch@...tonmail.com>,
        Peter Zijlstra <peterz@...radead.org>,
        "mzhivich\@akamai.com" <mzhivich@...mai.com>,
        "viresh.kumar\@linaro.org" <viresh.kumar@...aro.org>,
        "drake\@endlessm.com" <drake@...lessm.com>,
        "rafael.j.wysocki\@intel.com" <rafael.j.wysocki@...el.com>,
        "x86\@kernel.org" <x86@...nel.org>,
        "hpa\@zytor.com" <hpa@...or.com>, "bp\@alien8.de" <bp@...en8.de>,
        "mingo\@redhat.com" <mingo@...hat.com>
Subject: Re: [PATCH] x86/tsc: Add tsc_guess flag disabling CPUID.16h use for tsc calibration

Krzysztof Piecuch <piecuch@...tonmail.com> 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: <bool> (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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ