public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] x86/fpu: Extend kernel_fpu_begin_mask() for the In-Field Scan driver
@ 2024-04-30 21:25 Chang S. Bae
  2024-04-30 21:25 ` [PATCH 1/2] x86/fpu: Extend kernel_fpu_begin_mask() to initialize AMX state Chang S. Bae
                   ` (4 more replies)
  0 siblings, 5 replies; 29+ messages in thread
From: Chang S. Bae @ 2024-04-30 21:25 UTC (permalink / raw)
  To: linux-kernel
  Cc: x86, platform-driver-x86, tglx, mingo, bp, dave.hansen, hdegoede,
	ilpo.jarvinen, tony.luck, ashok.raj, jithu.joseph, chang.seok.bae

The recent update [1] in the SDM highlights the requirement of
initializing the AMX state for executing the scan test:
    "... maintaining AMX state in a non-initialized state ... will
     prevent the execution of In-Field Scan tests."
which is one of CPU state conditions required for the test's execution.

In situations where AMX workloads are running, the switched-away active
user AMX state remains due to the optimization to reduce the state
switching cost. A user state reload is fully completed right before
returning to userspace. Consequently, if the switched-in kernel task is
executing the scan test, this non-initialized AMX state causes the test
to be unable to start.

Given the benefit of the scan test in detecting hardware faults, ensuring
its seamless execution is not negligible. This necessitates a proper API
for the driver code to initialize AMX states. Although fpu_idle_fpregs()
may initialize the AMX state, its primary usage should be limited to
sleep state handling, making it unsuitable for the scan test.

The across-architecture FPU API, kernel_fpu_begin()/kernel_fpu_end(), is
universally established for floating-point SIMD code in the kernel. On
x86, kernel_fpu_begin_mask() is available, with kernel_fpu_begin()
serving as a wrapper to it for initializing legacy states by default.

The proposed solution extends kernel_fpu_begin_mask() to accept a new
option for initializing the AMX state. Additionally, it introduces custom
FPU handling wrappers for the In-Field Scan driver, which are variants of
kernel_fpu_begin()/kernel_fpu_end(). This approach is considerably
compliant with established semantics, following the EFI case with
efi_fpu_begin/efi_fpu_end().

Thanks,
Chang

[1] Intel Software Development Manual as of March 2024, Section 18.2
    RECOMMENDATIONS FOR SYSTEM SOFTWARE of Vol. 1.
    https://www.intel.com/content/www/us/en/developer/articles/technical/intel-sdm.html

Chang S. Bae (2):
  x86/fpu: Extend kernel_fpu_begin_mask() to initialize AMX state
  platform/x86/intel/ifs: Initialize AMX state for the scan test

 arch/x86/include/asm/fpu/api.h           |  1 +
 arch/x86/kernel/fpu/core.c               |  3 +++
 drivers/platform/x86/intel/ifs/ifs.h     | 14 ++++++++++++++
 drivers/platform/x86/intel/ifs/runtest.c |  6 ++++++
 4 files changed, 24 insertions(+)


base-commit: e67572cd2204894179d89bd7b984072f19313b03
-- 
2.34.1


^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2024-05-10  7:51 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-30 21:25 [PATCH 0/2] x86/fpu: Extend kernel_fpu_begin_mask() for the In-Field Scan driver Chang S. Bae
2024-04-30 21:25 ` [PATCH 1/2] x86/fpu: Extend kernel_fpu_begin_mask() to initialize AMX state Chang S. Bae
2024-04-30 23:42   ` Ashok Raj
2024-04-30 21:25 ` [PATCH 2/2] platform/x86/intel/ifs: Initialize AMX state for the scan test Chang S. Bae
2024-05-01  0:06   ` Ashok Raj
2024-05-01  8:58   ` Hans de Goede
2024-05-08  0:22     ` Chang S. Bae
2024-05-02 11:00   ` Ilpo Järvinen
2024-05-02 22:19     ` Chang S. Bae
2024-05-09  0:45   ` Kuppuswamy Sathyanarayanan
2024-05-02 20:52 ` [PATCH 0/2] x86/fpu: Extend kernel_fpu_begin_mask() for the In-Field Scan driver Chang S. Bae
2024-05-02 21:35   ` Chang S. Bae
2024-05-02 20:59 ` Dave Hansen
2024-05-07 23:53 ` [PATCH v2 " Chang S. Bae
2024-05-07 23:53   ` [PATCH v2 1/2] x86/fpu: Extend kernel_fpu_begin_mask() to initialize AMX state Chang S. Bae
2024-05-08 13:00     ` Thomas Gleixner
2024-05-08 14:40     ` Dave Hansen
2024-05-08 18:03       ` Chang S. Bae
2024-05-08 19:11         ` Dave Hansen
2024-05-09  0:29       ` Chang S. Bae
2024-05-09 17:36         ` Dave Hansen
2024-05-09 17:41           ` Dave Hansen
2024-05-09 18:41           ` Chang S. Bae
2024-05-09 18:50             ` Dave Hansen
2024-05-10  7:51           ` Thomas Gleixner
2024-05-07 23:53   ` [PATCH v2 2/2] platform/x86/intel/ifs: Initialize AMX state for the scan test Chang S. Bae
2024-05-08  0:19     ` Ashok Raj
2024-05-08  0:21       ` Chang S. Bae
2024-05-08  8:28   ` [PATCH v2 0/2] x86/fpu: Extend kernel_fpu_begin_mask() for the In-Field Scan driver Ilpo Järvinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox