From 307c87115c2d90403b584941e93bc42b18644a35 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Tue, 27 Nov 2012 08:54:36 -0800 Subject: [PATCH] --- yaml --- r: 336151 b: refs/heads/master c: 6662c34fa9c60a48aaa5879cb229cd9a84de9c22 h: refs/heads/master i: 336149: b4e83801f95f3ae2fff4fcfc86b5130a3147f744 336147: 195a993596035e8ac687604ffeb815f49a75b6d8 336143: 17e05d932be4da9426f1974b34abed392606a078 v: v3 --- [refs] | 2 +- trunk/arch/x86/kernel/head_32.S | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index f9573fda5575..6517bfe52f0c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: cb7cb2864e758a1b040040bc55e404c677c911cb +refs/heads/master: 6662c34fa9c60a48aaa5879cb229cd9a84de9c22 diff --git a/trunk/arch/x86/kernel/head_32.S b/trunk/arch/x86/kernel/head_32.S index 957a47aec64e..4dac2f68ed4a 100644 --- a/trunk/arch/x86/kernel/head_32.S +++ b/trunk/arch/x86/kernel/head_32.S @@ -292,8 +292,8 @@ default_entry: * be using the global pages. * * NOTE! If we are on a 486 we may have no cr4 at all! - * Specifically, cr4 exists if and only if CPUID exists, - * which in turn exists if and only if EFLAGS.ID exists. + * Specifically, cr4 exists if and only if CPUID exists + * and has flags other than the FPU flag set. */ movl $X86_EFLAGS_ID,%ecx pushl %ecx @@ -308,6 +308,11 @@ default_entry: testl %ecx,%eax jz 6f # No ID flag = no CPUID = no CR4 + movl $1,%eax + cpuid + andl $~1,%edx # Ignore CPUID.FPU + jz 6f # No flags or only CPUID.FPU = no CR4 + movl pa(mmu_cr4_features),%eax movl %eax,%cr4