diff options
author | Andi Kleen <ak@suse.de> | 2007-05-21 08:31:50 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-21 12:56:57 -0400 |
commit | 39427d6e595ebee38fdd77bcf55d6b13d7a4324a (patch) | |
tree | 64efd3c79a0f043bf313929c1ed64d329030f1f4 /arch/i386 | |
parent | 4c1f59d8be7e5da75d9380da23671005b363c45c (diff) |
i386: Enable CX8/PGE CPUID bits early on VIA C3
Fix boot failures with the early CPUID checking on VIA C3
Includes fixes from Christian Volkmann
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/i386')
-rw-r--r-- | arch/i386/kernel/verify_cpu.S | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/arch/i386/kernel/verify_cpu.S b/arch/i386/kernel/verify_cpu.S index b2a9d80b6421..f1d1eacf4ab0 100644 --- a/arch/i386/kernel/verify_cpu.S +++ b/arch/i386/kernel/verify_cpu.S | |||
@@ -2,6 +2,7 @@ | |||
2 | This runs in 16bit mode so that the caller can still use the BIOS | 2 | This runs in 16bit mode so that the caller can still use the BIOS |
3 | to output errors on the screen */ | 3 | to output errors on the screen */ |
4 | #include <asm/cpufeature.h> | 4 | #include <asm/cpufeature.h> |
5 | #include <asm/msr.h> | ||
5 | 6 | ||
6 | verify_cpu: | 7 | verify_cpu: |
7 | pushfl # Save caller passed flags | 8 | pushfl # Save caller passed flags |
@@ -45,6 +46,32 @@ verify_cpu: | |||
45 | cmpl $0x1,%eax | 46 | cmpl $0x1,%eax |
46 | jb bad # no cpuid 1 | 47 | jb bad # no cpuid 1 |
47 | 48 | ||
49 | #if REQUIRED_MASK1 & NEED_CMPXCHG64 | ||
50 | /* Some VIA C3s need magic MSRs to enable CX64. Do this here */ | ||
51 | cmpl $0x746e6543,%ebx # Cent | ||
52 | jne 1f | ||
53 | cmpl $0x48727561,%edx # aurH | ||
54 | jne 1f | ||
55 | cmpl $0x736c7561,%ecx # auls | ||
56 | jne 1f | ||
57 | movl $1,%eax # check model | ||
58 | cpuid | ||
59 | movl %eax,%ebx | ||
60 | shr $8,%ebx | ||
61 | andl $0xf,%ebx | ||
62 | cmp $6,%ebx # check family == 6 | ||
63 | jne 1f | ||
64 | shr $4,%eax | ||
65 | andl $0xf,%eax | ||
66 | cmpl $6,%eax # check model >= 6 | ||
67 | jb 1f | ||
68 | # assume models >= 6 all support this MSR | ||
69 | movl $MSR_VIA_FCR,%ecx | ||
70 | rdmsr | ||
71 | orl $((1<<1)|(1<<7)),%eax # enable CMPXCHG64 and PGE | ||
72 | wrmsr | ||
73 | 1: | ||
74 | #endif | ||
48 | movl $0x1,%eax # Does the cpu have what it takes | 75 | movl $0x1,%eax # Does the cpu have what it takes |
49 | cpuid | 76 | cpuid |
50 | 77 | ||