Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 324003
b: refs/heads/master
c: e002298
h: refs/heads/master
i:
  324001: c70ebba
  323999: 897b1d1
v: v3
  • Loading branch information
Suresh Siddha authored and H. Peter Anvin committed Sep 18, 2012
1 parent a032883 commit faac3ac
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 212b02125f3725127148475059a70031bd031bdb
refs/heads/master: e00229819f306b1f86134095347e9187dc346bd1
4 changes: 3 additions & 1 deletion trunk/Documentation/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1834,8 +1834,10 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
enabling legacy floating-point and sse state.

eagerfpu= [X86]
on enable eager fpu restore (default for xsaveopt)
on enable eager fpu restore
off disable eager fpu restore
auto selects the default scheme, which automatically
enables eagerfpu restore for xsaveopt.

nohlt [BUGS=ARM,SH] Tells the kernel that the sleep(SH) or
wfi(ARM) instruction doesn't work correctly and not to
Expand Down
17 changes: 12 additions & 5 deletions trunk/arch/x86/kernel/xsave.c
Original file line number Diff line number Diff line change
Expand Up @@ -508,13 +508,15 @@ static void __init setup_init_fpu_buf(void)
xsave_state(init_xstate_buf, -1);
}

static int disable_eagerfpu;
static enum { AUTO, ENABLE, DISABLE } eagerfpu = AUTO;
static int __init eager_fpu_setup(char *s)
{
if (!strcmp(s, "on"))
setup_force_cpu_cap(X86_FEATURE_EAGER_FPU);
eagerfpu = ENABLE;
else if (!strcmp(s, "off"))
disable_eagerfpu = 1;
eagerfpu = DISABLE;
else if (!strcmp(s, "auto"))
eagerfpu = AUTO;
return 1;
}
__setup("eagerfpu=", eager_fpu_setup);
Expand Down Expand Up @@ -557,8 +559,9 @@ static void __init xstate_enable_boot_cpu(void)
prepare_fx_sw_frame();
setup_init_fpu_buf();

if (cpu_has_xsaveopt && !disable_eagerfpu)
setup_force_cpu_cap(X86_FEATURE_EAGER_FPU);
/* Auto enable eagerfpu for xsaveopt */
if (cpu_has_xsaveopt && eagerfpu != DISABLE)
eagerfpu = ENABLE;

pr_info("enabled xstate_bv 0x%llx, cntxt size 0x%x\n",
pcntxt_mask, xstate_size);
Expand Down Expand Up @@ -598,6 +601,10 @@ void __cpuinit eager_fpu_init(void)

clear_used_math();
current_thread_info()->status = 0;

if (eagerfpu == ENABLE)
setup_force_cpu_cap(X86_FEATURE_EAGER_FPU);

if (!cpu_has_eager_fpu) {
stts();
return;
Expand Down

0 comments on commit faac3ac

Please sign in to comment.