[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240326174903.GA4539@redhat.com>
Date: Tue, 26 Mar 2024 18:49:03 +0100
From: Oleg Nesterov <oleg@...hat.com>
To: Ingo Molnar <mingo@...nel.org>
Cc: linux-kernel@...r.kernel.org, Andy Lutomirski <luto@...capital.net>,
Andrew Morton <akpm@...ux-foundation.org>,
Dave Hansen <dave@...1.net>, Peter Zijlstra <peterz@...radead.org>,
Borislav Petkov <bp@...en8.de>, "H . Peter Anvin" <hpa@...or.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Thomas Gleixner <tglx@...utronix.de>,
Uros Bizjak <ubizjak@...il.com>
Subject: Re: [PATCH 1/1] headers/deps: x86/fpu: Make task_struct::thread
constant size
On 03/20, Ingo Molnar wrote:
>
> --- a/arch/x86/kernel/fpu/init.c
> +++ b/arch/x86/kernel/fpu/init.c
> @@ -38,7 +38,7 @@ static void fpu__init_cpu_generic(void)
> /* Flush out any pending x87 state: */
> #ifdef CONFIG_MATH_EMULATION
> if (!boot_cpu_has(X86_FEATURE_FPU))
> - fpstate_init_soft(¤t->thread.fpu.fpstate->regs.soft);
> + fpstate_init_soft(current->thread.fpu->fpstate->regs.soft);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Typo? it should be
¤t->thread.fpu->fpstate->regs.soft
> +static struct fpu x86_init_fpu __read_mostly;
> +
> static void __init fpu__init_system_early_generic(void)
> {
> + {
> + int this_cpu = smp_processor_id();
> +
> + fpstate_reset(&x86_init_fpu);
> + current->thread.fpu = &x86_init_fpu;
> + per_cpu(fpu_fpregs_owner_ctx, this_cpu) = &x86_init_fpu;
> + x86_init_fpu.last_cpu = this_cpu;
> + }
Can't x86_init_fpu be declared inside the block above?
> void __init fpu__init_system(void)
> {
> - fpstate_reset(¤t->thread.fpu);
> fpu__init_system_early_generic();
> + fpstate_reset(current->thread.fpu);
It seems that fpstate_reset(current->thread.fpu) is not needed after the
change in fpu__init_system_early_generic() above.
Oleg.
Powered by blists - more mailing lists