linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Krzysztof Piecuch <piecuch@protonmail.com>,
	"linux-kernel\@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: "juri.lelli\@redhat.com" <juri.lelli@redhat.com>,
	"malat\@debian.org" <malat@debian.org>,
	"piecuch\@protonmail.com" <piecuch@protonmail.com>,
	Peter Zijlstra <peterz@infradead.org>,
	"mzhivich\@akamai.com" <mzhivich@akamai.com>,
	"viresh.kumar\@linaro.org" <viresh.kumar@linaro.org>,
	"drake\@endlessm.com" <drake@endlessm.com>,
	"rafael.j.wysocki\@intel.com" <rafael.j.wysocki@intel.com>,
	"x86\@kernel.org" <x86@kernel.org>,
	"hpa\@zytor.com" <hpa@zytor.com>, "bp\@alien8.de" <bp@alien8.de>,
	"mingo\@redhat.com" <mingo@redhat.com>
Subject: Re: [PATCH] x86/tsc: Add tsc_guess flag disabling CPUID.16h use for tsc calibration
Date: Wed, 15 Jan 2020 22:47:13 +0100	[thread overview]
Message-ID: <87pnfkxuhq.fsf@nanos.tec.linutronix.de> (raw)
In-Reply-To: <03j72W25Dne_HDSwI8Y7xiXPzvEBX5Ezw_xw8ed8DC83bpdMxoPcjhbinNcDD0yeoX9GGN691f3kqqtGLztTnW8Pay3FrbO5sTlj3vjnh-Y=@protonmail.com>

Krzysztof Piecuch <piecuch@protonmail.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

  parent reply	other threads:[~2020-01-15 21:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-14 14:23 [PATCH] x86/tsc: Add tsc_guess flag disabling CPUID.16h use for tsc calibration Krzysztof Piecuch
2020-01-15 20:15 ` Andy Lutomirski
2020-01-15 21:47 ` Thomas Gleixner [this message]
2020-01-16  7:38 ` kbuild test robot
2020-01-16  9:41 ` kbuild test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pnfkxuhq.fsf@nanos.tec.linutronix.de \
    --to=tglx@linutronix.de \
    --cc=bp@alien8.de \
    --cc=drake@endlessm.com \
    --cc=hpa@zytor.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=malat@debian.org \
    --cc=mingo@redhat.com \
    --cc=mzhivich@akamai.com \
    --cc=peterz@infradead.org \
    --cc=piecuch@protonmail.com \
    --cc=rafael.j.wysocki@intel.com \
    --cc=viresh.kumar@linaro.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).