[PATCH 0/2] x86/fpu: Extend kernel_fpu_begin_mask() for the In-Field Scan driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux