From: Dave Jones <davej@suse.de>
To: Linus Torvalds <torvalds@transmeta.com>,
Alan Cox <alan@lxorguk.ukuu.org.uk>,
Linux Kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH] Updated cachesize errata
Date: Fri, 12 Oct 2001 15:49:33 +0100 [thread overview]
Message-ID: <20011012154933.A27312@suse.de> (raw)
Hi,
The patch below fixes yet another CPU that reports incorrect cachesize.
This one is a little trickier than the previous fixes of this sort, as Intel
have made two CPUs with differing cachesizes, with the same model/stepping.
(Yes, we were meant to distinguish between with cachesize-- doh)
Buggy PIII Tualatins with 256K cache will automatically be fixed up with this patch.
Ones with 512K cache will need an extra boot time argument passed
'cachesize=512'
This bootflag may also come in useful if/when any future CPU makes this mistake
again. Now people can override what the CPU reports, without having to wait
for a kernel patch.
Patch applies to 2.4.13pre1, and 2.4.12-ac1 cleanly, and has been tested on
several boxes here without problems.
regards,
Dave.
diff -urN --exclude-from=/home/davej/.exclude linux/arch/i386/kernel/setup.c linux-dj/arch/i386/kernel/setup.c
--- linux/arch/i386/kernel/setup.c Tue Sep 18 07:03:09 2001
+++ linux-dj/arch/i386/kernel/setup.c Tue Oct 2 18:55:11 2001
@@ -67,6 +67,10 @@
*
* AMD Athlon/Duron/Thunderbird bluesmoke support.
* Dave Jones <davej@suse.de>, April 2001.
+ *
+ * CacheSize bug workaround updates for AMD, Intel & VIA Cyrix.
+ * Dave Jones <davej@suse.de>, September, October 2001.
+ *
*/
/*
@@ -1036,6 +1040,15 @@
#endif
}
+static int cachesize_override __initdata = -1;
+static int __init cachesize_setup(char *str)
+{
+ get_option (&str, &cachesize_override);
+ return 1;
+}
+__setup("cachesize=", cachesize_setup);
+
+
#ifndef CONFIG_X86_TSC
static int tsc_disable __initdata = 0;
@@ -1106,11 +1119,24 @@
l2size = 256;
}
+ /* Intel PIII Tualatin. This comes in two flavours.
+ * One has 256kb of cache, the other 512. We have no way
+ * to determine which, so we use a boottime override
+ * for the 512kb model, and assume 256 otherwise.
+ */
+ if ((c->x86_vendor == X86_VENDOR_INTEL) && (c->x86 == 6) &&
+ (c->x86_model == 11) && (l2size == 0))
+ l2size = 256;
+
/* VIA C3 CPUs (670-68F) need further shifting. */
if (c->x86_vendor == X86_VENDOR_CENTAUR && (c->x86 == 6) &&
((c->x86_model == 7) || (c->x86_model == 8))) {
l2size = l2size >> 8;
}
+
+ /* Allow user to override all this if necessary. */
+ if (cachesize_override != -1)
+ l2size = cachesize_override;
if ( l2size == 0 )
return; /* Again, no L2 cache is possible */
--
| Dave Jones. http://www.codemonkey.org.uk
| SuSE Labs .
reply other threads:[~2001-10-12 14:47 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20011012154933.A27312@suse.de \
--to=davej@suse.de \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/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.