Skip to content

Commit

Permalink
x86: Fix booting with "no387 nofxsr"
Browse files Browse the repository at this point in the history
Jesper Juhl reported that testing the software math-emulation by forcing
"no387" doesn't work on modern CPU's.

The reason was two-fold:
 - you also need to pass in "nofxsr" to make sure that we not only don't
   touch the old i387 legacy hardware, it also needs to disable the
   modern XMM/FXSR sequences
 - "nofxsr" didn't actually clear the capability bits immediately,
   leaving the early boot sequence still using FXSR until we got to
   the identify_cpu() stage.

This fixes the "nofxsr" flag to take effect immediately on the boot CPU.

Debugging by Randy Dunlap

Acked-by: Randy Dunlap <rdunlap@xenotime.net>
Cc: Jesper Juhl <jesper.juhl@gmail.com>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Linus Torvalds committed Oct 3, 2006
1 parent 63c422a commit 8ccb3dc
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions arch/i386/kernel/cpu/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,16 @@ static void __cpuinit get_cpu_vendor(struct cpuinfo_x86 *c, int early)

static int __init x86_fxsr_setup(char * s)
{
/* Tell all the other CPU's to not use it... */
disable_x86_fxsr = 1;

/*
* ... and clear the bits early in the boot_cpu_data
* so that the bootup process doesn't try to do this
* either.
*/
clear_bit(X86_FEATURE_FXSR, boot_cpu_data.x86_capability);
clear_bit(X86_FEATURE_XMM, boot_cpu_data.x86_capability);
return 1;
}
__setup("nofxsr", x86_fxsr_setup);
Expand Down

0 comments on commit 8ccb3dc

Please sign in to comment.