x86/fpu: Improve the init_fpstate setup code
Status from this message: The following commit has been merged into the x86/urgent branch of tip:
Get series with b4
b4 am [email protected]Versions newest first
Patches in v1 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | x86/fpu: Configure init_fpstate attributes orderlyarch/ arch/ | +5 | 1 reply | |
| 2/3 | x86/fpu: Fix the init_fpstate size check with the actual sizearch/ | +6 | 0 replies | |
| 3/3 | x86/fpu: Exclude dynamic states from init_fpstatearch/ | +6 | 0 replies |
Reviews trailers per patch
1 of 3 patches has a Reviewed-by or Acked-by.
| Patch | Lin X Wang | [email protected] | Yuan Yao | Mingwei Zhang |
|---|---|---|---|---|
| Series | T-b T-b | T-b | ||
| 1/3 | A-b | |||
| 2/3 | ||||
| 3/3 | T-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.
Cover letter [PATCH 0/3] x86/fpu: Improve the init_fpstate setup code
Hi all,
This set of patches fixes the init_fpstate code. So this first version is sent to the maintainers hoping the fix is reviewable.
Thanks,
Chang
== Background ==
The init_fpstate is an XSAVE image that records init states during the boot time. It is presumed to cover all the supported and enabled features. The setup code has been recently optimized to capture legacy states only as all of the other init states are all zeros.
== Problem with AMX state ==
When AMX is enabled, this buffer is too small to include AMX TILE_DATA (8KB) as it is statically allocated with about a page. But, the buffer is formatted to have them all although using the compacted format.
This also leads to a noisy splat with XRSTORS as it expects all the buffer memory accessible. This is mentioned in Intel SDM Vol.1 13.13 Memory Access By The XSAVE Feature Set:
"An execution of an instruction in the XSAVE feature set may access any
byte of any state component on which that execution operates."
== Other minor issues ==
The existing sanity check could help finding this issue as it checks whether the allocated init_fpstate is enough for the expected size or not. But what is currently measured is not matched -- the size without the AMX state.
Also, these size and features are better to be configured first before setting up the init image.
== Patchset ==
As AMX requires the compacted format, init_fpstate may exclude dynamic states. The series also includes other improvments:
* Set up the init_fpstate buffer after its scope is clarified.
* Fix the size that is validated against the static allocation.
Chang S. Bae (3):
x86/fpu: Configure init_fpstate attributes orderly x86/fpu: Fix the init_fpstate size check with the actual size x86/fpu: Exclude dynamic states from init_fpstate
arch/x86/kernel/fpu/init.c | 8 -------- arch/x86/kernel/fpu/xstate.c | 33 ++++++++++++++------------------- 2 files changed, 14 insertions(+), 27 deletions(-)
base-commit: cf90f46223eef9d5f389b4b88ee2fc7914458b06
Signature · 1 line
2.17.1