Linux 5.16 compat: restore FSR and FSAVE
Commit 3b52ccd7d
introduced a flaw where FSR and FSAVE are not restored
when using a Linux 5.16 kernel. These instructions are only used when
XSAVE is not supported by the processor meaning only some systems will
encounter this issue.
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Attila Fülöp <attila@fueloep.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #13210
Closes #13236
This commit is contained in:
parent
421750672b
commit
9e3619c535
|
@ -420,9 +420,9 @@ kfpu_end(void)
|
||||||
if (static_cpu_has(X86_FEATURE_XSAVE)) {
|
if (static_cpu_has(X86_FEATURE_XSAVE)) {
|
||||||
kfpu_do_xrstor("xrstor", &state->xsave, ~0);
|
kfpu_do_xrstor("xrstor", &state->xsave, ~0);
|
||||||
} else if (static_cpu_has(X86_FEATURE_FXSR)) {
|
} else if (static_cpu_has(X86_FEATURE_FXSR)) {
|
||||||
kfpu_save_fxsr(&state->fxsave);
|
kfpu_restore_fxsr(&state->fxsave);
|
||||||
} else {
|
} else {
|
||||||
kfpu_save_fsave(&state->fsave);
|
kfpu_restore_fsave(&state->fsave);
|
||||||
}
|
}
|
||||||
out:
|
out:
|
||||||
local_irq_enable();
|
local_irq_enable();
|
||||||
|
|
Loading…
Reference in New Issue