函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\fpu\xstate.c Create Date:2022-07-27 08:50:56
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 kernel-space ptrace 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_kernel(void *kbuf, struct xregs_state *xsave, unsigned int offset_start, unsigned int size_total)

返回类型:int

参数:

类型参数名称
void *kbuf
struct xregs_state *xsave
unsigned intoffset_start
unsigned intsize_total
990  如果此条件成立可能性小(为编译器优化)(offset_start != 0)则返回:负EFAULT
996  memset( & header, 0, header的长度)
997  xfeatures等于xfeatures
998  xfeatures与等于Supervisor features 的反
1003  offset等于offsetof(structxregs_state, header)
1004  size等于header的长度
1006  This is similar to user_regset_copyout(), but will not add offset to* the source data pointer or increment pos, count, kbuf, and ubuf.
1008 i小于XFEATURE_MAX循环
1012  如果xfeatures右移i位按位与1则
1015  offset等于xstate_offsets[i]
1016  size等于xstate_sizes[i]
1019  如果offsetsize大于size_total退出
1027  如果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.
1028  offset等于offsetof(structfxregs_state, mxcsr)
1029  size等于Copy both mxcsr & mxcsr_flags with a single u64 memcpy:
1030  This is similar to user_regset_copyout(), but will not add offset to* the source data pointer or increment pos, count, kbuf, and ubuf.
1036  offset等于offsetof(structfxregs_state, sw_reserved)
1037  size等于xstate_fx_sw_bytes的长度
1039  This is similar to user_regset_copyout(), but will not add offset to* the source data pointer or increment pos, count, kbuf, and ubuf.
1041  返回:0
调用者
名称描述
xstateregs_get