From: "Chang S. Bae" <chang.seok.bae@intel.com>
To: linux-kernel@vger.kernel.org
Cc: x86@kernel.org, chang.seok.bae@intel.com
Subject: [PATCH 0/3] x86/fpu: Improve the init_fpstate setup code
Date: Wed, 24 Aug 2022 12:12:20 -0700 [thread overview]
Message-ID: <20220824191223.1248-1-chang.seok.bae@intel.com> (raw)
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
--
2.17.1
next reply other threads:[~2022-08-24 19:22 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-24 19:12 Chang S. Bae [this message]
2022-08-24 19:12 ` [PATCH 1/3] x86/fpu: Configure init_fpstate attributes orderly Chang S. Bae
2022-10-03 21:18 ` Neel Natu
2022-10-17 13:47 ` [tip: x86/urgent] " tip-bot2 for Chang S. Bae
2022-08-24 19:12 ` [PATCH 2/3] x86/fpu: Fix the init_fpstate size check with the actual size Chang S. Bae
2022-10-17 13:47 ` [tip: x86/urgent] " tip-bot2 for Chang S. Bae
2022-08-24 19:12 ` [PATCH 3/3] x86/fpu: Exclude dynamic states from init_fpstate Chang S. Bae
2022-10-17 13:47 ` [tip: x86/urgent] " tip-bot2 for Chang S. Bae
2022-10-18 22:13 ` [PATCH 0/1] x86/fpu: Follow up on the init_fpstate fix Chang S. Bae
2022-10-18 22:13 ` [PATCH 1/1] x86/fpu: Fix copy_xstate_to_uabi() to copy init states correctly Chang S. Bae
2022-10-20 16:57 ` Dave Hansen
2022-10-20 18:52 ` Chang S. Bae
2022-10-21 18:58 ` [PATCH v2] " Chang S. Bae
2022-10-21 22:25 ` [tip: x86/urgent] " tip-bot2 for Chang S. Bae
2022-10-22 6:23 ` Ingo Molnar
2022-10-22 13:02 ` Chang S. Bae
2023-02-27 21:05 ` [PATCH 0/2] x86/fpu/xstate: Follow up on the init_fpstate fallout again Chang S. Bae
2023-02-27 21:05 ` [PATCH 1/2] x86/fpu/xstate: Prevent false-positive warning in __copy_xstate_uabi_buf() Chang S. Bae
2023-02-27 21:05 ` [PATCH 2/2] selftests/x86/amx: Add a ptrace test Chang S. Bae
2023-01-06 23:08 [PATCH 0/3] x86/fpu: Improve the init_fpstate setup code Mingwei Zhang
2023-01-07 1:03 ` Chang S. Bae
2023-01-07 4:01 ` Mingwei Zhang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220824191223.1248-1-chang.seok.bae@intel.com \
--to=chang.seok.bae@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®