linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Herrmann <andreas.herrmann3@amd.com>
To: Jaswinder Singh Rajput <jaswinder@kernel.org>
Cc: Ingo Molnar <mingo@elte.hu>, "H. Peter Anvin" <hpa@kernel.org>,
	Robert Richter <robert.richter@amd.com>,
	Dave Jones <davej@redhat.com>,
	LKML <linux-kernel@vger.kernel.org>,
	x86 maintainers <x86@kernel.org>
Subject: Re: [PATCH 6/10 -tip] x86: early_init_intel() user of Advanced Power Management features
Date: Wed, 13 May 2009 08:18:01 +0200	[thread overview]
Message-ID: <20090513061801.GD9991@alberich.amd.com> (raw)
In-Reply-To: <1242142908.2547.20.camel@ht.satnam>

On Tue, May 12, 2009 at 09:11:48PM +0530, Jaswinder Singh Rajput wrote:
> 
> use X86_FEATURE_CONSTANT_TSC to determine TSC Invariance
> 
> Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>

I'd like to NAK this as well.

You didn't get to the point what's the difference between
X86_FEATURE_CONSTANT_TSC and X86_FEATURE_NONSTOP_TSC, did you?
I guess you never checked the related commit messages. (I.e. using git
blame to see how code evolved over time and _why_ was it changed.)
In this case it would have been commit 40fb17152c50a69dc304dd632131c2f41281ce44
(x86: support always running TSC on Intel CPUs), see
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=40fb17152c50a69dc304dd632131c2f41281ce44

>  arch/x86/kernel/cpu/intel.c |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
> index 7437fa1..62130a0 100644
> --- a/arch/x86/kernel/cpu/intel.c
> +++ b/arch/x86/kernel/cpu/intel.c
> @@ -61,14 +61,14 @@ static void __cpuinit early_init_intel(struct cpuinfo_x86 *c)
>  		c->x86_phys_bits = 36;
>  
>  	/*
> -	 * c->x86_power is 8000_0007 edx. Bit 8 is TSC runs at constant rate
> -	 * with P/T states and does not stop in deep C-states.
> +	 * Advanced power management is 8000_0007 edx.
> +	 * Bit 8 is TSC runs at constant rate with P/T states
> +	 * and does not stop in deep C-states.
>  	 *
>  	 * It is also reliable across cores and sockets. (but not across
>  	 * cabinets - we turn it off in that case explicitly.)
>  	 */
> -	if (c->x86_power & (1 << 8)) {
> -		set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC);
> +	if (cpu_has(c, X86_FEATURE_CONSTANT_TSC)) {
>  		set_cpu_cap(c, X86_FEATURE_NONSTOP_TSC);
>  		set_cpu_cap(c, X86_FEATURE_TSC_RELIABLE);
>  		sched_clock_stable = 1;

This code would mark some Intel CPUs as having
X86_FEATURE_NONSTOP_TSC which is certainly wrong in some cases.

You missed this snippet.

        if ((c->x86 == 0xf && c->x86_model >= 0x03) ||
                (c->x86 == 0x6 && c->x86_model >= 0x0e))
                set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC);

in early_init_intel().


Regards,
Andreas

-- 
Operating | Advanced Micro Devices GmbH
  System  | Karl-Hammerschmidt-Str. 34, 85609 Dornach b. München, Germany
 Research | Geschäftsführer: Thomas M. McCoy, Giuliano Meroni
  Center  | Sitz: Dornach, Gemeinde Aschheim, Landkreis München
  (OSRC)  | Registergericht München, HRB Nr. 43632



  parent reply	other threads:[~2009-05-13  6:20 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-12 15:35 [git-pull -tip][PATCH 0/10] few cpufeature additions and users Jaswinder Singh Rajput
2009-05-12 15:37 ` [PATCH 1/10 -tip] x86: Add cpufeature for Processor Name Jaswinder Singh Rajput
2009-05-12 15:38   ` [PATCH 2/10 -tip] x86: get_model_name() user of X86_FEATURE_PNAME Jaswinder Singh Rajput
2009-05-12 15:39     ` [PATCH 3/10 -tip] x86: Add cpufeatures for Advanced Power Management Jaswinder Singh Rajput
2009-05-12 15:40       ` [PATCH 4/10 -tip] x86: check_powernow() for K7 user of Advanced Power Management features Jaswinder Singh Rajput
2009-05-12 15:40         ` [PATCH 5/10 -tip] x86: check_powernow() for K8 and later " Jaswinder Singh Rajput
2009-05-12 15:41           ` [PATCH 6/10 -tip] x86: early_init_intel() " Jaswinder Singh Rajput
2009-05-12 15:42             ` [PATCH 7/10 -tip] x86: early_init_amd() " Jaswinder Singh Rajput
2009-05-12 15:43               ` [PATCH 8/10 -tip] x86: Add cpufeature for Microcode update Jaswinder Singh Rajput
2009-05-12 15:44                 ` [PATCH 9/10 -tip] x86: collect_cpu_info() of Intel user of Microcode feature Jaswinder Singh Rajput
2009-05-12 15:44                   ` [PATCH 10/10 -tip] x86: collect_cpu_info() of AMD " Jaswinder Singh Rajput
2009-05-13  5:47                     ` Andreas Herrmann
2009-05-13  7:20                       ` Jaswinder Singh Rajput
2009-05-13  5:46                 ` [PATCH 8/10 -tip] x86: Add cpufeature for Microcode update Andreas Herrmann
2009-05-13  7:18                   ` Jaswinder Singh Rajput
2009-05-13  6:18             ` Andreas Herrmann [this message]
2009-05-13  7:20               ` [PATCH 6/10 -tip] x86: early_init_intel() user of Advanced Power Management features Jaswinder Singh Rajput
2009-05-12 17:48           ` [PATCH 5/10 -tip] x86: check_powernow() for K8 and later " Ingo Molnar
2009-05-12 18:45             ` Jaswinder Singh Rajput
2009-05-13  6:36               ` Andreas Herrmann
2009-05-12 19:07         ` [PATCH 4/10 -tip] x86: check_powernow() for K7 " Jaswinder Singh Rajput
2009-05-12 19:06       ` [PATCH 3/10 -tip] x86: Add cpufeatures for Advanced Power Management Jaswinder Singh Rajput
2009-05-12 21:04         ` Thomas Gleixner
2009-05-13  8:57           ` Jaswinder Singh Rajput
2009-05-15 13:47           ` Jaswinder Singh Rajput
2009-05-17 12:17             ` Thomas Gleixner
2009-05-17 14:18               ` Jaswinder Singh Rajput
2009-05-19 15:01               ` Jaswinder Singh Rajput
2009-05-19 16:41                 ` H. Peter Anvin
2009-05-20  7:15                   ` Jaswinder Singh Rajput
2009-05-20  7:23                     ` Jaswinder Singh Rajput
2009-05-20 18:30                     ` H. Peter Anvin
2009-05-21  5:09                       ` Jaswinder Singh Rajput
2009-05-13  6:27         ` Andreas Herrmann
2009-05-21  6:14           ` H. Peter Anvin
2009-05-21  6:11   ` [PATCH 1/10 -tip] x86: Add cpufeature for Processor Name H. Peter Anvin
2009-05-21  7:38     ` Jaswinder Singh Rajput
2009-05-21 20:09       ` H. Peter Anvin
2009-05-12 20:15 ` [git-pull -tip][PATCH 0/10] few cpufeature additions and users Jaswinder Singh Rajput

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=20090513061801.GD9991@alberich.amd.com \
    --to=andreas.herrmann3@amd.com \
    --cc=davej@redhat.com \
    --cc=hpa@kernel.org \
    --cc=jaswinder@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=robert.richter@amd.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 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).