From: Ian Pratt Subject: Ensure proper FPU state by issueing fpu_begin/end() around fdiv bug test FPU can end up in a strange state if the fdiv test is done without properly issueing fpu_begin/end() in kernel. Signed-off-by: Kurt Garloff Index: linux-2.6.5/include/asm-i386/bugs.h =================================================================== --- linux-2.6.5.orig/include/asm-i386/bugs.h +++ linux-2.6.5/include/asm-i386/bugs.h @@ -93,9 +93,10 @@ static void __init check_fpu(void) printk(KERN_INFO "Enabling unmasked SIMD FPU exception support... "); set_in_cr4(X86_CR4_OSXMMEXCPT); printk("done.\n"); } - + + fpu_begin(); /* Test for the divl bug.. */ __asm__("fninit\n\t" "fldl %1\n\t" "fdivl %2\n\t" @@ -108,8 +109,9 @@ static void __init check_fpu(void) : "=m" (*&boot_cpu_data.fdiv_bug) : "m" (*&x), "m" (*&y)); if (boot_cpu_data.fdiv_bug) printk("Hmm, FPU with FDIV bug.\n"); + fpu_end(); } static void __init check_hlt(void) {