提交 7304d3af 编写于 作者: T Thomas Gleixner 提交者: Aichun Shi

x86/fpu: Cleanup fpu__init_system_xstate_size_legacy()

mainline inclusion
from mainline-v5.16-rc1
commit 617473ac
category: feature
bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I590ZC
CVE: NA

Intel-SIG: commit 617473ac x86/fpu: Cleanup fpu__init_system_xstate_size_legacy().
--------------------------------

Clean the function up before making changes.

No functional change.
Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
Signed-off-by: NBorislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20211014230739.184014242@linutronix.deSigned-off-by: NLin Wang <lin.x.wang@intel.com>
Signed-off-by: NAichun Shi <aichun.shi@intel.com>
上级 14c1b227
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册