函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Convert from kernel XSAVES compacted format to standard format and copy* to a user-space buffer. It supports partial copy but pos always starts from* zero. This is called from xstateregs_get() and there we check the CPU* has XSAVES.

函数原型:int copy_xstate_to_user(void __user *ubuf, struct xregs_state *xsave, unsigned int offset_start, unsigned int size_total)

返回类型:int

参数:

类型参数名称
void __user *ubuf
struct xregs_state *xsave
unsigned intoffset_start
unsigned intsize_total
1074  如果此条件成立可能性小(为编译器优化)(offset_start != 0)则返回:负EFAULT
1080  memset( & header, 0, header的长度)
1081  xfeatures等于xfeatures
1082  xfeatures与等于Supervisor features 的反
1087  offset等于offsetof(structxregs_state, header)
1088  size等于header的长度
1090  ret等于__copy_xstate_to_user(ubuf, & header, offset, size, size_total)
1091  如果ret则返回:ret
1094 i小于XFEATURE_MAX循环
1098  如果xfeatures右移i位按位与1则
1101  offset等于xstate_offsets[i]
1102  size等于xstate_sizes[i]
1105  如果offsetsize大于size_total退出
1109  如果ret则返回:ret
1115  如果Weird legacy quirk: SSE and YMM states store information in the* MXCSR and MXCSR_FLAGS fields of the FP area. That means if the FP* area is marked as unused in the xfeatures header, we need to copy* MXCSR and MXCSR_FLAGS if either SSE or YMM are in use.
1116  offset等于offsetof(structfxregs_state, mxcsr)
1117  size等于Copy both mxcsr & mxcsr_flags with a single u64 memcpy:
1118  __copy_xstate_to_user(ubuf, & MXCSR Register State , offset, size, size_total)
1124  offset等于offsetof(structfxregs_state, sw_reserved)
1125  size等于xstate_fx_sw_bytes的长度
1127  ret等于__copy_xstate_to_user(ubuf, xstate_fx_sw_bytes, offset, size, size_total)
1128  如果ret则返回:ret
1131  返回:0
调用者
名称描述
xstateregs_get