Commit 617473ac authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Borislav Petkov

x86/fpu: Cleanup fpu__init_system_xstate_size_legacy()

Clean the function up before making changes.

No functional change.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20211014230739.184014242@linutronix.de
parent 578971f4
...@@ -199,17 +199,12 @@ static void __init fpu__init_system_xstate_size_legacy(void) ...@@ -199,17 +199,12 @@ static void __init fpu__init_system_xstate_size_legacy(void)
* Note that xstate sizes might be overwritten later during * Note that xstate sizes might be overwritten later during
* fpu__init_system_xstate(). * fpu__init_system_xstate().
*/ */
if (!cpu_feature_enabled(X86_FEATURE_FPU))
if (!boot_cpu_has(X86_FEATURE_FPU)) {
fpu_kernel_xstate_size = sizeof(struct swregs_state); fpu_kernel_xstate_size = sizeof(struct swregs_state);
} else { else if (cpu_feature_enabled(X86_FEATURE_FXSR))
if (boot_cpu_has(X86_FEATURE_FXSR)) fpu_kernel_xstate_size = sizeof(struct fxregs_state);
fpu_kernel_xstate_size = else
sizeof(struct fxregs_state); fpu_kernel_xstate_size = sizeof(struct fregs_state);
else
fpu_kernel_xstate_size =
sizeof(struct fregs_state);
}
fpu_user_xstate_size = fpu_kernel_xstate_size; fpu_user_xstate_size = fpu_kernel_xstate_size;
fpstate_reset(&current->thread.fpu); fpstate_reset(&current->thread.fpu);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment