All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: You-Sheng Yang <vicamo@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	x86@kernel.org, Pavel Tatashin <pasha.tatashin@oracle.com>,
	Peter Zijlstra <peterz@infradead.org>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	Dou Liyang <douly.fnst@cn.fujitsu.com>,
	Daniel Vacek <neelx@redhat.com>,
	Mike Travis <mike.travis@hpe.com>,
	Xiaoming Gao <gxm.linux.kernel@gmail.com>,
	You-Sheng Yang <vicamo.yang@canonical.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Chuanhua Lei <chuanhua.lei@linux.intel.com>,
	Juergen Gross <jgross@suse.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86/tsc: mark tsc reliable on CoffeeLake
Date: Mon, 8 Apr 2019 14:03:36 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.21.1904081403220.1748@nanos.tec.linutronix.de> (raw)
In-Reply-To: <20190408104012.26791-1-vicamo@gmail.com>

On Mon, 8 Apr 2019, You-Sheng Yang wrote:

> From: You-Sheng Yang <vicamo.yang@canonical.com>
> 
> On Intel CoffeeLake it's observed tsc is always marked unstable
> unexpectedly after entering idle state Package C10(PC10), and then clock
> source is switched to hpet. This patch marks tsc as reliable when CPUID
> matches CoffeeLake.

This lacks a proper analysis:

  1) Why is it marked unstable

  2) Why is it correct to set that for coffeelake
 
> Link: https://bugzilla.kernel.org/show_bug.cgi?id=203183
> Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
> ---
>  arch/x86/kernel/tsc.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
> index aab0c82e0a0d..2abbadc9cff0 100644
> --- a/arch/x86/kernel/tsc.c
> +++ b/arch/x86/kernel/tsc.c
> @@ -1161,6 +1161,16 @@ static void __init check_system_tsc_reliable(void)
>  #endif
>  	if (boot_cpu_has(X86_FEATURE_TSC_RELIABLE))
>  		tsc_clocksource_reliable = 1;
> +
> +	/*
> +	 * On Intel CoffeeLake, tsc may be marked unstable unexpectedly after
> +	 * entering PC10.
> +	 */
> +	if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL &&
> +	    (boot_cpu_data.x86_model == INTEL_FAM6_KABYLAKE_MOBILE ||
> +	     boot_cpu_data.x86_model == INTEL_FAM6_KABYLAKE_DESKTOP) &&
> +	    boot_cpu_data.x86_stepping >= 0x0a)
> +		tsc_clocksource_reliable = 1;

No. We are not starting that family/model/stepping game especially not
with random stepping cutoffs which are pulled out of thin air.  That's
going to spiral out of control sooner than later.

There must be a better way to do that. Rafael?

Thanks,

	tglx



  reply	other threads:[~2019-04-08 12:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-08 10:40 [PATCH] x86/tsc: mark tsc reliable on CoffeeLake You-Sheng Yang
2019-04-08 12:03 ` Thomas Gleixner [this message]
2019-04-10  8:11   ` You-Sheng Yang
2019-04-12  3:28   ` You-Sheng Yang

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=alpine.DEB.2.21.1904081403220.1748@nanos.tec.linutronix.de \
    --to=tglx@linutronix.de \
    --cc=bp@alien8.de \
    --cc=chuanhua.lei@linux.intel.com \
    --cc=douly.fnst@cn.fujitsu.com \
    --cc=gxm.linux.kernel@gmail.com \
    --cc=hpa@zytor.com \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mike.travis@hpe.com \
    --cc=mingo@redhat.com \
    --cc=neelx@redhat.com \
    --cc=pasha.tatashin@oracle.com \
    --cc=peterz@infradead.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=vicamo.yang@canonical.com \
    --cc=vicamo@gmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.