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: <20240430212508.105117-1-chang.seok.bae@intel.com>
Date: Tue, 30 Apr 2024 14:25:06 -0700
From: "Chang S. Bae" <chang.seok.bae@...el.com>
To: linux-kernel@...r.kernel.org
Cc: x86@...nel.org,
	platform-driver-x86@...r.kernel.org,
	tglx@...utronix.de,
	mingo@...hat.com,
	bp@...en8.de,
	dave.hansen@...ux.intel.com,
	hdegoede@...hat.com,
	ilpo.jarvinen@...ux.intel.com,
	tony.luck@...el.com,
	ashok.raj@...el.com,
	jithu.joseph@...el.com,
	chang.seok.bae@...el.com
Subject: [PATCH 0/2] x86/fpu: Extend kernel_fpu_begin_mask() for the In-Field Scan driver

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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ