函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Convert from a ptrace standard-format kernel buffer to kernel XSAVES format* and copy to the target thread. This is called from xstateregs_set().

函数原型:int copy_kernel_to_xstate(struct xregs_state *xsave, const void *kbuf)

返回类型:int

参数:

类型参数名称
struct xregs_state *xsave
const void *kbuf
1144  offset等于offsetof(structxregs_state, header)
1145  size等于hdr的长度
1147  memcpy( & hdr, kbuf + offset, size)
1149  如果Validate an xstate header supplied by userspace (ptrace or sigreturn) 则返回:负EINVAL
1152 i小于XFEATURE_MAX循环
1153  mask等于1左移i
1155  如果xfeatures按位与mask
1158  offset等于xstate_offsets[i]
1159  size等于xstate_sizes[i]
1161  memcpy(dst, kbuf + offset, size)
1165  如果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.
1166  offset等于offsetof(structfxregs_state, mxcsr)
1167  size等于Copy both mxcsr & mxcsr_flags with a single u64 memcpy:
1168  memcpy( & MXCSR Register State , kbuf + offset, size)
1175  xfeatures与等于Supervisor features
1180  xfeatures或等于xfeatures
1182  返回:0
调用者
名称描述
xstateregs_set