Re: [PATCH 3/7] x86/fpu: Extract restore_from_ia32_fxstate() and clean up fpu__restore_sig()

From: Borislav Petkov

Date: Mon Sep 21 2026 - 20:50:51 EST


On Wed, Sep 16, 2026 at 11:23:06PM +0000, Andrei Vagin wrote:
> diff --git a/arch/x86/kernel/fpu/signal.c b/arch/x86/kernel/fpu/signal.c
> index cd7db6dc819b..db069947bdb8 100644
> --- a/arch/x86/kernel/fpu/signal.c
> +++ b/arch/x86/kernel/fpu/signal.c
> @@ -325,32 +325,24 @@ static bool restore_fpregs_from_user(void __user *buf, u64 xrestore_mask, bool f
> return true;
> }
>
> -static bool __fpu_restore_sig(void __user *buf_f, void __user *buf_fx,
> - bool ia32_fxstate)
> +#if defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION)

We didn't need that ugly ifdeffery and the stub until now. Can we use
IS_ENABLED instead and return false early?

Thx.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette