Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\fpu\xstate.c Create Date:2022-07-28 07:50:44
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:init_xstate_size

Proto:static int __init init_xstate_size(void)

Type:int

Parameter:Nothing

676  xsave_size = get_xsave_size()
678  If boot_cpu_has(XSAVES/XRSTORS instructions ) Then possible_xstate_size = Get total size of enabled xstates in XCR0/xfeatures_mask.* Note the SDM's wording here. "sub-function 0" only enumerates* the size of the *user* states. If we use it to size a buffer* that we use 'XSAVES' on, we could potentially overflow the
680  Else possible_xstate_size = xsave_size
684  If Not Will the runtime-enumerated 'xstate_size' fit in the init* task's statically-allocated buffer? Then Return -EINVAL
691  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: = possible_xstate_size
692  This essentially double-checks what the cpu told us about* how large the XSAVE buffer needs to be. We are recalculating* it to be safe.
697  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. = xsave_size
698  Return 0
Caller
NameDescribe
fpu__init_system_xstateEnable and initialize the xsave feature.* Called once per system bootup.