All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Siddha, Suresh B" <suresh.b.siddha@intel.com>
To: Petr Vandrovec <vandrove@vc.cvut.cz>
Cc: "Siddha, Suresh B" <suresh.b.siddha@intel.com>,
	linux-kernel@vger.kernel.org, ak@suse.de, akpm@osdl.org
Subject: Re: [Patch] x86, x86_64: fix cpu model for family 0x6
Date: Fri, 30 Sep 2005 11:23:10 -0700	[thread overview]
Message-ID: <20050930112310.A28092@unix-os.sc.intel.com> (raw)
In-Reply-To: <433D391A.70607@vc.cvut.cz>; from vandrove@vc.cvut.cz on Fri, Sep 30, 2005 at 03:09:46PM +0200

On Fri, Sep 30, 2005 at 03:09:46PM +0200, Petr Vandrovec wrote:
> Siddha, Suresh B wrote:
> > -		if (c->x86 == 0xf) {
> > +		if (c->x86 == 0xf)
> >  			c->x86 += (tfms >> 20) & 0xff;
> > +		if (c->x86 == 0x6 || c->x86 == 0xf)
> 
> Are you sure this is correct?  You just incremented c->x86 by extended
> family, so I believe test should be
> 
>                  if (c->x86 == 0x6 || c->x86 >= 0xf)

My bad. Your suggestion might work. But let me just follow what SDM Vol-2a
says here. New patch appended.

Andi, please apply.

thanks,
suresh

--

According to cpuid instruction in IA32 SDM-Vol2, when computing cpu model,
we need to consider extended model ID for family 0x6 also.
  
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>

--- linux-2.6.14-rc2-git7/arch/x86_64/kernel/setup.c~	2005-09-29 18:05:26.503939536 -0700
+++ linux-2.6.14-rc2-git7/arch/x86_64/kernel/setup.c	2005-09-30 10:17:37.964209680 -0700
@@ -1059,10 +1059,10 @@ void __cpuinit early_identify_cpu(struct
 		c->x86 = (tfms >> 8) & 0xf;
 		c->x86_model = (tfms >> 4) & 0xf;
 		c->x86_mask = tfms & 0xf;
-		if (c->x86 == 0xf) {
-			c->x86 += (tfms >> 20) & 0xff;
+		if (c->x86 == 0x6 || c->x86 == 0xf)
 			c->x86_model += ((tfms >> 16) & 0xF) << 4;
-		} 
+		if (c->x86 == 0xf)
+			c->x86 += (tfms >> 20) & 0xff;
 		if (c->x86_capability[0] & (1<<19)) 
 			c->x86_clflush_size = ((misc >> 8) & 0xff) * 8;
 	} else {
--- linux-2.6.14-rc2-git7/arch/x86_64/kernel/setup.c~	2005-09-29 18:05:26.503939536 -0700
+++ linux-2.6.14-rc2-git7/arch/x86_64/kernel/setup.c	2005-09-30 10:17:37.964209680 -0700
@@ -1059,10 +1059,10 @@ void __cpuinit early_identify_cpu(struct
 		c->x86 = (tfms >> 8) & 0xf;
 		c->x86_model = (tfms >> 4) & 0xf;
 		c->x86_mask = tfms & 0xf;
-		if (c->x86 == 0xf) {
-			c->x86 += (tfms >> 20) & 0xff;
+		if (c->x86 == 0x6 || c->x86 == 0xf)
 			c->x86_model += ((tfms >> 16) & 0xF) << 4;
-		} 
+		if (c->x86 == 0xf)
+			c->x86 += (tfms >> 20) & 0xff;
 		if (c->x86_capability[0] & (1<<19)) 
 			c->x86_clflush_size = ((misc >> 8) & 0xff) * 8;
 	} else {

  reply	other threads:[~2005-09-30 18:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-30  2:04 [Patch] x86, x86_64: fix cpu model for family 0x6 Siddha, Suresh B
2005-09-30  8:11 ` Andi Kleen
2005-09-30 13:09 ` Petr Vandrovec
2005-09-30 18:23   ` Siddha, Suresh B [this message]
2005-09-30 22:02     ` Andi Kleen
2005-09-30 22:23       ` Siddha, Suresh B
2005-09-30 22:37         ` Petr Vandrovec
2005-09-30 22:56           ` Dave Jones
2005-09-30 22:46         ` Andi Kleen
2005-10-01  1:37           ` Siddha, Suresh B

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=20050930112310.A28092@unix-os.sc.intel.com \
    --to=suresh.b.siddha@intel.com \
    --cc=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vandrove@vc.cvut.cz \
    /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.