public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Jones <davej@codemonkey.org.uk>
To: Andi Kleen <ak@muc.de>
Cc: ink@jurassic.park.msu.ru, linux-kernel@vger.kernel.org
Subject: Re: cacheline size detection code in 2.5.66
Date: Tue, 25 Mar 2003 11:52:38 +0000	[thread overview]
Message-ID: <20030325115227.GA28451@suse.de> (raw)
In-Reply-To: <20030325071532.GA19217@averell>

On Tue, Mar 25, 2003 at 08:15:32AM +0100, Andi Kleen wrote:

 > +        pci_cache_line_size = 32 >> 2;
 > +       if (c->x86 >= 6 && c->x86_vendor == X86_VENDOR_AMD)
 > +               pci_cache_line_size = 64 >> 2;  /* K7 & K8 */
 > +       else if (c->x86 > 6)
 > +               pci_cache_line_size = 128 >> 2; /* P4 */
 > 
 > This will be wrong on Pentium M for example which has a 32byte cache
 > line but x86 model 9.

The above test is comparing family, not model.  It's my understanding
that it's still a family 6 CPU, so it'll match '32'.

 > But it's actually not needed, because all the 
 > new CPUs report their cacheline size as part of CPUID for CLFLUSH.
 > When the CPU supports CLFLUSH you can just extract it from 
 > the second byte in the second word reported by CPUID 1.
 > With that just use what the CPU tells you. This should also
 > work correctly on VIA etc which afaik support CLFLUSH 
 > in the newer CPUs.

Nope. Nehemiah :-
flags		: fpu de pse tsc msr cx8 mtrr pge cmov mmx fxsr sse

Cache line size is still available from cpuid 80000006 though,
but as this is vendor and model specific, this could get messy
to decode. And then there's errata...

		Dave


      parent reply	other threads:[~2003-03-25 11:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-25  7:15 cacheline size detection code in 2.5.66 Andi Kleen
2003-03-25 11:33 ` Ivan Kokshaysky
2003-03-25 12:15   ` Andi Kleen
2003-03-25 12:43     ` Dave Jones
2003-03-25 13:35       ` Andi Kleen
2003-03-25 14:39         ` Ivan Kokshaysky
2003-03-25 16:43           ` Dave Jones
2003-03-25 11:52 ` Dave Jones [this message]

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=20030325115227.GA28451@suse.de \
    --to=davej@codemonkey.org.uk \
    --cc=ak@muc.de \
    --cc=ink@jurassic.park.msu.ru \
    --cc=linux-kernel@vger.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