函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\fpu\xstate.c Create Date:2022-07-27 08:50:52
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Enable and initialize the xsave feature.* Called once per system bootup.

函数原型:void __init fpu__init_system_xstate(void)

返回类型:void

参数:

719  on_boot_cpu((__section__(".init.data")))等于1
723  WARN_ON_FPU(!on_boot_cpu)
724  on_boot_cpu等于0
726  如果非boot_cpu_has(Onboard FPU )则
727  打印信息("x86/fpu: No FPU detected\n")
728  返回
731  如果非boot_cpu_has(XSAVE/XRSTOR/XSETBV/XGETBV instructions )则
732  打印信息("x86/fpu: x87 FPU will use %s\n", boot_cpu_has(FXSAVE/FXRSTOR, CR4.OSFXSR ) ? "FXSAVE" : "FSAVE")
734  返回
737  如果Maximum supported CPUID level, -1=no CPUID: 小于XSTATE_CPUID
738  WARN_ON_FPU(1)
739  返回
742  cpuid_count(XSTATE_CPUID, 0, & eax, & ebx, & ecx, & edx)
743  Mask of xstate features supported by the CPU and the kernel:等于eaxedx左移32位的值
745  如果Mask of xstate features supported by the CPU and the kernel:按位与XFEATURE_MASK_FPSSE的值不等于XFEATURE_MASK_FPSSE
751  打印错误信息("x86/fpu: FP/SSE not present amongst the CPU's xstate features: 0x%llx.\n", Mask of xstate features supported by the CPU and the kernel:)
752  转到:out_disable
758 i小于ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(xsave_cpuid_features)循环
759  如果非boot_cpu_has(xsave_cpuid_features[i])则Mask of xstate features supported by the CPU and the kernel:与等于BIT(i)的反
763  Mask of xstate features supported by the CPU and the kernel:与等于Find supported xfeatures based on cpu features and command-line input.* This must be called after fpu__init_parse_early_param() is called and* xfeatures_mask is enumerated.
766  Enable the extended processor state save/restore feature.* Called once per CPU onlining.
767  err等于init_xstate_size()
768  如果err则转到:out_disable
775  update_regset_xstate_info(The XSAVE area of kernel can be in standard or compacted format;* it is always in standard format for user mode. This is the user* mode standard format size used for signal and ptrace frames., Mask of xstate features supported by the CPU and the kernel: & ~Supervisor features )
777  Prepare the SW reserved portion of the fxsave memory layout, indicating* the presence of the extended state information in the memory layout* pointed by the fpstate pointer in the sigcontext
778  setup the xstate image representing the init state
779  This function sets up offsets and sizes of all extended states in* xsave area. This supports both standard format and compacted format* of the xsave aread.
780  Print out xstate component offsets and sizes
782  打印信息("x86/fpu: Enabled xstate features 0x%llx, context size is %d bytes, using '%s' format.\n", Mask of xstate features supported by the CPU and the kernel:, Size of the FPU context state. All tasks in the system use the* same context size, regardless of what portion they use.* This is inherent to the XSAVE architecture which puts all state* components into a single, continuous memory block:, boot_cpu_has(XSAVES/XRSTORS instructions ) ? "compacted" : "standard")
786  返回
788  out_disable :
790  We enabled the XSAVE hardware, but something went wrong and* we can not use it. Disable it.
调用者
名称描述
fpu__init_systemCalled on the boot CPU once per system bootup, to set up the initial* FPU state that is later cloned into all processes: