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

Name:Convert from a ptrace or sigreturn standard-format user-space buffer to* kernel XSAVES format and copy to the target thread. This is called from* xstateregs_set(), as well as potentially from the sigreturn() and* rt_sigreturn() system calls.

Proto:int copy_user_to_xstate(struct xregs_state *xsave, const void __user *ubuf)

Type:int

Parameter:

TypeParameterName
struct xregs_state *xsave
const void __user *ubuf
1197  offset = offsetof(structxregs_state, header)
1198  size = size of hdr
1200  If __copy_from_user( & hdr, ubuf + offset, size) Then Return -EFAULT
1203  If Validate an xstate header supplied by userspace (ptrace or sigreturn) Then Return -EINVAL
1206  When i < XFEATURE_MAX cycle
1207  mask = 1 << i
1209  If xfeatures & mask Then
1212  offset = xstate_offsets[i]
1213  size = xstate_sizes[i]
1215  If __copy_from_user(dst, ubuf + offset, size) Then Return -EFAULT
1220  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
1221  offset = offsetof(structfxregs_state, mxcsr)
1222  size = Copy both mxcsr & mxcsr_flags with a single u64 memcpy:
1223  If __copy_from_user( & MXCSR Register State , ubuf + offset, size) Then Return -EFAULT
1231  xfeatures &= Supervisor features
1236  xfeatures |= xfeatures
1238  Return 0
Caller
NameDescribe
__fpu__restore_sig