From: Thomas Gleixner Date: Wed, 13 Oct 2021 14:55:51 +0000 (+0200) Subject: x86/fpu/xstate: Use fpstate for xsave_to_user_sigframe() X-Git-Tag: v6.1-rc5~2804^2~43 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0b2d39aa03574eb401cdfaac2f483a6f68173355;p=platform%2Fkernel%2Flinux-starfive.git x86/fpu/xstate: Use fpstate for xsave_to_user_sigframe() With dynamically enabled features the sigframe code must know the features which are enabled for the task. Get them from fpstate. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20211013145323.077781448@linutronix.de --- diff --git a/arch/x86/kernel/fpu/xstate.h b/arch/x86/kernel/fpu/xstate.h index 24a1479..3e9eaf9 100644 --- a/arch/x86/kernel/fpu/xstate.h +++ b/arch/x86/kernel/fpu/xstate.h @@ -149,7 +149,7 @@ static inline int xsave_to_user_sigframe(struct xregs_state __user *buf) * internally, e.g. PKRU. That's user space ABI and also required * to allow the signal handler to modify PKRU. */ - u64 mask = xfeatures_mask_uabi(); + u64 mask = current->thread.fpu.fpstate->user_xfeatures; u32 lmask = mask; u32 hmask = mask >> 32; int err;