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:49
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name: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.

Proto:int copy_xstate_to_kernel(void *kbuf, struct xregs_state *xsave, unsigned int offset_start, unsigned int size_total)

Type:int

Parameter:

TypeParameterName
void *kbuf
struct xregs_state *xsave
unsigned intoffset_start
unsigned intsize_total
990  If Value for the false possibility is greater at compile time(offset_start != 0) Then Return -EFAULT
996  memset( & header, 0, size of header )
997  xfeatures = xfeatures
998  xfeatures &= ~Supervisor features
1003  offset = offsetof(structxregs_state, header)
1004  size = size of 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  When i < XFEATURE_MAX cycle
1012  If xfeatures >> i & 1 Then
1015  offset = xstate_offsets[i]
1016  size = xstate_sizes[i]
1019  If offset + size > size_total Then Break
1027  If 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. Then
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 = size of 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  Return 0