Skip to content

Commit

Permalink
Linux 5.16 compat: restore FSR and FSAVE
Browse files Browse the repository at this point in the history
Commit 3b52ccd 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 <[email protected]>
Reviewed-by: Attila Fülöp <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #13210
Closes #13236
  • Loading branch information
behlendorf authored Mar 19, 2022
1 parent 565089f commit 6b444cb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/os/linux/kernel/linux/simd_x86.h
Original file line number Diff line number Diff line change
Expand Up @@ -379,9 +379,9 @@ kfpu_end(void)
if (static_cpu_has(X86_FEATURE_XSAVE)) {
kfpu_do_xrstor("xrstor", state, ~0);
} else if (static_cpu_has(X86_FEATURE_FXSR)) {
kfpu_save_fxsr(state);
kfpu_restore_fxsr(state);
} else {
kfpu_save_fsave(state);
kfpu_restore_fsave(state);
}
out:
local_irq_enable();
Expand Down

0 comments on commit 6b444cb

Please sign in to comment.