Re: [PATCH 6/7] x86/fpu: Pre-fault only required size of xstate buffer
From: Borislav Petkov
Date: Fri Sep 25 2026 - 00:02:58 EST
On Thu, Sep 24, 2026 at 09:01:20PM +0000, Andrei Vagin wrote:
> diff --git a/arch/x86/kernel/fpu/xstate.h b/arch/x86/kernel/fpu/xstate.h
> index 38a2862f09d3..c73cf2444de6 100644
> --- a/arch/x86/kernel/fpu/xstate.h
> +++ b/arch/x86/kernel/fpu/xstate.h
> @@ -55,6 +55,8 @@ extern int copy_sigframe_from_user_to_xstate(struct task_struct *tsk, const void
> extern void fpu__init_cpu_xstate(void);
> extern void fpu__init_system_xstate(unsigned int legacy_size);
>
> +extern unsigned int xstate_calculate_size(u64 xfeatures, bool compacted);
> +
> extern void __user *get_xsave_addr_user(struct xregs_state __user *xsave, int xfeature_nr);
>
> static inline u64 xfeatures_mask_supervisor(void)
> --
Hmm, so which tree are you basing your stuff ontop?
Because in patch 5, xstate_calculate_size() is not static so you must be
basing it ontop of some tip/master branch from sometime because tip/perf/core
has
b84c96283684 ("perf/x86: Enable XMM register sampling for non-PEBS events")
which drops the static qualifier of that function.
But then you're declaring a prototype above in the header while that same
patch is declaring the same prototype too. So if you were applying ontop of
some tip/master state which has tip/perf/core, then you wouldn't need the
extern.
Weird.
So what I think you should do is, rebase all your stuff ontop of this branch:
https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/log/?h=x86/fpu
Then I can apply your pile and we can sort out the merge conflicts later.
That would be better, IMO, than merging the whole pile of gunk from
tip/perf/core into x86/fpu or applying everything FPU ontop of perf/core which
would be yuck in a different way.
Thx.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette