From: Jan Beulich Move some code unrelated to any dealing with hardware bugs from i386's bugs.h to a more logical place. Signed-off-by: Andrew Morton --- arch/i386/kernel/traps.c | 18 ++++++++++++++++++ include/asm-i386/bugs.h | 23 +---------------------- 2 files changed, 19 insertions(+), 22 deletions(-) diff -puN arch/i386/kernel/traps.c~i386-move-simd-initialization arch/i386/kernel/traps.c --- devel/arch/i386/kernel/traps.c~i386-move-simd-initialization 2005-11-09 17:49:45.000000000 -0800 +++ devel-akpm/arch/i386/kernel/traps.c 2005-11-09 17:49:45.000000000 -0800 @@ -1108,6 +1108,24 @@ void __init trap_init(void) #endif set_trap_gate(19,&simd_coprocessor_error); + if (cpu_has_fxsr) { + /* + * Verify that the FXSAVE/FXRSTOR data will be 16-byte aligned. + */ + struct fxsrAlignAssert { + int _:!(offsetof(struct task_struct, thread.i387.fxsave) & 15); + }; + + printk(KERN_INFO "Enabling fast FPU save and restore... "); + set_in_cr4(X86_CR4_OSFXSR); + printk("done.\n"); + } + if (cpu_has_xmm) { + printk(KERN_INFO "Enabling unmasked SIMD FPU exception support... "); + set_in_cr4(X86_CR4_OSXMMEXCPT); + printk("done.\n"); + } + set_system_gate(SYSCALL_VECTOR,&system_call); /* diff -puN include/asm-i386/bugs.h~i386-move-simd-initialization include/asm-i386/bugs.h --- devel/include/asm-i386/bugs.h~i386-move-simd-initialization 2005-11-09 17:49:45.000000000 -0800 +++ devel-akpm/include/asm-i386/bugs.h 2005-11-09 17:49:45.000000000 -0800 @@ -8,9 +8,6 @@ * * - Channing Corn (tests & fixes), * - Andrew D. Balsa (code cleanup). - * - * Pentium III FXSR, SSE support - * Gareth Hughes , May 2000 */ /* @@ -76,25 +73,7 @@ static void __init check_fpu(void) return; } -/* Enable FXSR and company _before_ testing for FP problems. */ - /* - * Verify that the FXSAVE/FXRSTOR data will be 16-byte aligned. - */ - if (offsetof(struct task_struct, thread.i387.fxsave) & 15) { - extern void __buggy_fxsr_alignment(void); - __buggy_fxsr_alignment(); - } - if (cpu_has_fxsr) { - printk(KERN_INFO "Enabling fast FPU save and restore... "); - set_in_cr4(X86_CR4_OSFXSR); - printk("done.\n"); - } - if (cpu_has_xmm) { - printk(KERN_INFO "Enabling unmasked SIMD FPU exception support... "); - set_in_cr4(X86_CR4_OSXMMEXCPT); - printk("done.\n"); - } - +/* trap_init() enabled FXSR and company _before_ testing for FP problems here. */ /* Test for the divl bug.. */ __asm__("fninit\n\t" "fldl %1\n\t" _