From 90fc7df7f2f520d86a00d4a6b2e8d5ffedae0968 Mon Sep 17 00:00:00 2001 From: Andi Kleen Date: Mon, 21 May 2007 14:31:50 +0200 Subject: [PATCH] --- yaml --- r: 56673 b: refs/heads/master c: 39427d6e595ebee38fdd77bcf55d6b13d7a4324a h: refs/heads/master i: 56671: 12a38569f09d266845328c4fbd395c10ae4a372d v: v3 --- [refs] | 2 +- trunk/arch/i386/kernel/verify_cpu.S | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index fff216d686ef..6a7784ad9a68 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 4c1f59d8be7e5da75d9380da23671005b363c45c +refs/heads/master: 39427d6e595ebee38fdd77bcf55d6b13d7a4324a diff --git a/trunk/arch/i386/kernel/verify_cpu.S b/trunk/arch/i386/kernel/verify_cpu.S index b2a9d80b6421..f1d1eacf4ab0 100644 --- a/trunk/arch/i386/kernel/verify_cpu.S +++ b/trunk/arch/i386/kernel/verify_cpu.S @@ -2,6 +2,7 @@ This runs in 16bit mode so that the caller can still use the BIOS to output errors on the screen */ #include +#include verify_cpu: pushfl # Save caller passed flags @@ -45,6 +46,32 @@ verify_cpu: cmpl $0x1,%eax jb bad # no cpuid 1 +#if REQUIRED_MASK1 & NEED_CMPXCHG64 + /* Some VIA C3s need magic MSRs to enable CX64. Do this here */ + cmpl $0x746e6543,%ebx # Cent + jne 1f + cmpl $0x48727561,%edx # aurH + jne 1f + cmpl $0x736c7561,%ecx # auls + jne 1f + movl $1,%eax # check model + cpuid + movl %eax,%ebx + shr $8,%ebx + andl $0xf,%ebx + cmp $6,%ebx # check family == 6 + jne 1f + shr $4,%eax + andl $0xf,%eax + cmpl $6,%eax # check model >= 6 + jb 1f + # assume models >= 6 all support this MSR + movl $MSR_VIA_FCR,%ecx + rdmsr + orl $((1<<1)|(1<<7)),%eax # enable CMPXCHG64 and PGE + wrmsr +1: +#endif movl $0x1,%eax # Does the cpu have what it takes cpuid