lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 5 Jun 2024 17:21:34 -0400
From: Brian Gerst <brgerst@...il.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>, Oleg Nesterov <oleg@...hat.com>, 
	Thomas Gleixner <tglx@...utronix.de>, Uros Bizjak <ubizjak@...il.com>
Subject: Re: [PATCH 0/3, v3] x86/fpu: Remove the thread::fpu pointer

On Wed, Jun 5, 2024 at 4:36 AM Ingo Molnar <mingo@...nel.org> wrote:
>
> This series is one of the dependencies of the fast-headers work,
> which aims to reduce header complexity by removing <asm/processor.h>
> from the <linux/sched.h> dependency chain, which headers are headers
> are fat enough already even if we do not combine them.
>
> To achieve that decoupling, one of the key steps is to not embedd any
> C types from <asm/processor.h> into task_struct.
>
> The only architecture that relies on that in a serious fashion is x86,
> via 'struct thread::fpu', and the series below attempts to resolve it
> by using a calculated &task->thread.fpu value via the x86_task_fpu()
> helper.
>
> Code generation: without CONFIG_X86_DEBUG_FPU=y we get a small reduction:
>
>    text        data        bss        dec         hex        filename
>    26475783    10439082    1740804    38655669    24dd6b5    vmlinux.before
>    26475601    10435146    1740804    38651551    24dc69f    vmlinux.after
>
> With the new debug code - which I think we'll remove soon-ish, there's an
> expected increase:
>
>    text        data        bss        dec         hex        filename
>    26476198    10439286    1740804    38656288    24dd920    vmlinux.CONFIG_X86_DEBUG_FPU.before
>    26477000    10435458    1740804    38653262    24dcd4e    vmlinux.CONFIG_X86_DEBUG_FPU.after
>
> The Git tree can be found at:
>
>   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git WIP.x86/fpu
>
> Thanks,
>
>     Ingo
>
> ===============>
> Ingo Molnar (3):
>   x86/fpu: Make task_struct::thread constant size
>   x86/fpu: Remove the thread::fpu pointer
>   x86/fpu: Remove init_task FPU state dependencies, add debugging warning
>
>  arch/x86/include/asm/fpu/sched.h |  2 +-
>  arch/x86/include/asm/processor.h | 19 ++++++++++---------
>  arch/x86/kernel/fpu/context.h    |  4 ++--
>  arch/x86/kernel/fpu/core.c       | 57 +++++++++++++++++++++++++++++++--------------------------
>  arch/x86/kernel/fpu/init.c       | 23 +++++++++++++----------
>  arch/x86/kernel/fpu/regset.c     | 22 +++++++++++-----------
>  arch/x86/kernel/fpu/signal.c     | 18 +++++++++---------
>  arch/x86/kernel/fpu/xstate.c     | 23 ++++++++++-------------
>  arch/x86/kernel/fpu/xstate.h     |  6 +++---
>  arch/x86/kernel/process.c        |  6 ++----
>  arch/x86/kernel/signal.c         |  6 +++---
>  arch/x86/kernel/traps.c          |  2 +-
>  arch/x86/math-emu/fpu_aux.c      |  2 +-
>  arch/x86/math-emu/fpu_entry.c    |  4 ++--
>  arch/x86/math-emu/fpu_system.h   |  2 +-
>  arch/x86/mm/extable.c            |  2 +-
>  include/linux/sched.h            | 13 +++----------
>  17 files changed, 104 insertions(+), 107 deletions(-)

This series would be better if you added the x86_task_fpu() helper in
an initial patch without any other changes.  That would make the
actual changes more visible with less code churn.

Brian Gerst

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ