mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] x86: better CPU identification without the CPUID
@ 2008-09-13 10:56 Krzysztof Helt
  2008-09-14  4:43 ` Yinghai Lu
  0 siblings, 1 reply; 6+ messages in thread
From: Krzysztof Helt @ 2008-09-13 10:56 UTC (permalink / raw)
  To: linux-kernel; +Cc: hpa, tglx, mingo

From: Krzysztof Helt <krzysztof.h1@wp.pl>

cpus without the CPUID instruction are identified
as general 386 or 486 while some cpus (mostly made
by Cyrix) provide c_identify function which identify
correctly older cpus using cpu specific registers).

Cyrix cpus are even worse as 5x86 and 6x68 have
the CPUID instruction disabled. The CPUID is
enabled by the c_identify() but the c_identify
is only called when the CPUID is available.

Fix this by calling the c_identify() for all known
cpu families if there is no the CPUID instruction

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
---

I have tested it on Cyrix Cx486DX2 cpu.

I suspect that coma_bug field and mtrr support is not
set correctly for the Cyrix 6x86 family. I have not a cpu from
the Cyrix 6x68 family to test. 

The code path is (+ where the patch code is added)

if (have_cpuid_p()) {

}
+ } else {
...
+ }

so it does not affect cpus with the CPUID instruction.

Regards,
Krzysztof

diff -urp linux-mm/arch/x86/kernel/cpu/common.c linux-486/arch/x86/kernel/cpu/common.c
--- linux-mm/arch/x86/kernel/cpu/common.c	2008-09-05 23:38:20.295563396 +0200
+++ linux-486/arch/x86/kernel/cpu/common.c	2008-09-12 22:53:27.062265329 +0200
@@ -444,6 +444,17 @@ static void __cpuinit generic_identify(s
 
 		init_scattered_cpuid_features(c);
 		detect_nopl(c);
+	} else {
+		int i;
+		for (i = 0; i < X86_VENDOR_NUM; i++)
+			if (cpu_devs[i] && cpu_devs[i]->c_identify) {
+				c->x86_vendor_id[0] = 0;
+				cpu_devs[i]->c_identify(c);
+				if (c->x86_vendor_id[0]) {
+					get_cpu_vendor(c, 0);
+					break;
+				}
+			}
 	}
 }
 

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-09-14  9:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-13 10:56 [PATCH] x86: better CPU identification without the CPUID Krzysztof Helt
2008-09-14  4:43 ` Yinghai Lu
2008-09-14  5:55   ` Yinghai Lu
2008-09-14  8:30     ` Krzysztof Helt
2008-09-14  9:01       ` Yinghai Lu
2008-09-14  9:16         ` Yinghai Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®