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-next>] [day] [month] [year] [list]
Message-ID: <20211013142847.120153383@linutronix.de>
Date:   Wed, 13 Oct 2021 16:55:25 +0200 (CEST)
From:   Thomas Gleixner <tglx@...utronix.de>
To:     LKML <linux-kernel@...r.kernel.org>
Cc:     x86@...nel.org, "Chang S. Bae" <chang.seok.bae@...el.com>,
        Dave Hansen <dave.hansen@...ux.intel.com>,
        Arjan van de Ven <arjan@...ux.intel.com>,
        kvm@...r.kernel.org, Paolo Bonzini <pbonzini@...hat.com>
Subject: [patch 00/21] x86/fpu: Move register state into a container struct (part 2)

This is the second part of the effort to support AMX. The first part can be
found here:

     https://lore.kernel.org/r/20211011215813.558681373@linutronix.de

With AMX the FPU register state buffer which is part of
task_struct::thread::fpu is not going to be extended unconditionally for
all tasks on an AMX enabled system as that would waste minimum 8K per task.

AMX provides a mechanism to trap on first use. That trap will be utilized
to allocate a larger register state buffer when the task (process) has
permissions to use it. The default buffer task_struct will only carry
states up to AVX512.

The original approach was to just allocate new register buffer, but that's
not the right abstraction.

The current series creates a container which carries information about the
fpstate buffer, i.e. feature bits (user and kernel) and sizes (user and
kernel).

That allows all relevant code pathes to retrieve the required information
from fpstate which avoids conditionals and lets the code just use this
instead of reading it from the various global variables which provide this
information today.

The series is first introducing the new structure and then converting all
usage sites over to it. After that it adds feature and size information and
converts the affected code over to use that.

This series is based on:

   git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git x86/fpu-1

and also available from git:

   git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git x86/fpu-2

The full series with part 3 and 4 on top is available here:

   git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git x86/fpu

Thanks,

	tglx
---
 include/asm/fpu/api.h    |    5 +
 include/asm/fpu/signal.h |    2 
 include/asm/fpu/types.h  |   42 +++++++++++---
 include/asm/fpu/xstate.h |   13 ----
 include/asm/processor.h  |    9 +--
 include/asm/trace/fpu.h  |    4 -
 kernel/fpu/context.h     |    2 
 kernel/fpu/core.c        |  140 +++++++++++++++++++++++++++--------------------
 kernel/fpu/init.c        |   16 ++++-
 kernel/fpu/internal.h    |    7 +-
 kernel/fpu/regset.c      |   28 ++++-----
 kernel/fpu/signal.c      |   70 +++++++++++++----------
 kernel/fpu/xstate.c      |   56 ++++++++++++------
 kernel/fpu/xstate.h      |   24 ++++++--
 kernel/process.c         |    2 
 kvm/x86.c                |   18 ++----
 math-emu/fpu_aux.c       |    2 
 math-emu/fpu_entry.c     |    4 -
 math-emu/fpu_system.h    |    2 
 19 files changed, 266 insertions(+), 180 deletions(-)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ