Skip to content

Commit

Permalink
x86/fpu: Cleanup fpu__init_system_xstate_size_legacy()
Browse files Browse the repository at this point in the history
Clean the function up before making changes.

No functional change.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20211014230739.184014242@linutronix.de
  • Loading branch information
Thomas Gleixner authored and Borislav Petkov committed Oct 21, 2021
1 parent 578971f commit 617473a
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions arch/x86/kernel/fpu/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,17 +199,12 @@ static void __init fpu__init_system_xstate_size_legacy(void)
* Note that xstate sizes might be overwritten later during
* fpu__init_system_xstate().
*/

if (!boot_cpu_has(X86_FEATURE_FPU)) {
if (!cpu_feature_enabled(X86_FEATURE_FPU))
fpu_kernel_xstate_size = sizeof(struct swregs_state);
} else {
if (boot_cpu_has(X86_FEATURE_FXSR))
fpu_kernel_xstate_size =
sizeof(struct fxregs_state);
else
fpu_kernel_xstate_size =
sizeof(struct fregs_state);
}
else if (cpu_feature_enabled(X86_FEATURE_FXSR))
fpu_kernel_xstate_size = sizeof(struct fxregs_state);
else
fpu_kernel_xstate_size = sizeof(struct fregs_state);

fpu_user_xstate_size = fpu_kernel_xstate_size;
fpstate_reset(&current->thread.fpu);
Expand Down

0 comments on commit 617473a

Please sign in to comment.