mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: [PATCH 0/3] x86/fpu: Improve the init_fpstate setup code
@ 2023-01-06 23:08 Mingwei Zhang
  2023-01-07  1:03 ` Chang S. Bae
  0 siblings, 1 reply; 4+ messages in thread
From: Mingwei Zhang @ 2023-01-06 23:08 UTC (permalink / raw)
  To: chang.seok.bae
  Cc: LKML, x86, Jim Mattson, Aaron Lewis, Venkatesh Srinivas, Baker,
	Thomas, Neel Natu

Hi Chang,

Is there any update for this code? I haven't seen any updates since
this version.

Thanks. Regards
-Mingwei

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

* Re: [PATCH 0/3] x86/fpu: Improve the init_fpstate setup code
  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
  0 siblings, 1 reply; 4+ messages in thread
From: Chang S. Bae @ 2023-01-07  1:03 UTC (permalink / raw)
  To: Mingwei Zhang
  Cc: LKML, x86, Jim Mattson, Aaron Lewis, Venkatesh Srinivas, Baker,
	Thomas, Neel Natu

On 1/6/2023 3:08 PM, Mingwei Zhang wrote:
> 
> Is there any update for this code? I haven't seen any updates since
> this version.
Hi Mingwei,

Oh, this series was merged. So did the followup fix [1].

They are included in v6.1 [2,3].

Thanks,
Chang

[1] 
https://lore.kernel.org/lkml/20221021185844.13472-1-chang.seok.bae@intel.com/
[2] 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a401f45e38754953c9d402f8b3bc965707eecc91
[3] 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=471f0aa7fa64e23766a1473b32d9ec3f0718895a

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

* Re: [PATCH 0/3] x86/fpu: Improve the init_fpstate setup code
  2023-01-07  1:03 ` Chang S. Bae
@ 2023-01-07  4:01   ` Mingwei Zhang
  0 siblings, 0 replies; 4+ messages in thread
From: Mingwei Zhang @ 2023-01-07  4:01 UTC (permalink / raw)
  To: Chang S. Bae
  Cc: LKML, x86, Jim Mattson, Aaron Lewis, Venkatesh Srinivas, Baker,
	Thomas, Neel Natu

On Fri, Jan 6, 2023 at 5:03 PM Chang S. Bae <chang.seok.bae@intel.com> wrote:
>
> On 1/6/2023 3:08 PM, Mingwei Zhang wrote:
> >
> > Is there any update for this code? I haven't seen any updates since
> > this version.
> Hi Mingwei,
>
> Oh, this series was merged. So did the followup fix [1].
>
> They are included in v6.1 [2,3].
>
> Thanks,
> Chang
>
> [1]
> https://lore.kernel.org/lkml/20221021185844.13472-1-chang.seok.bae@intel.com/
> [2]
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a401f45e38754953c9d402f8b3bc965707eecc91
> [3]
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=471f0aa7fa64e23766a1473b32d9ec3f0718895a

Thank you very much for the update!

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

* [PATCH 0/3] x86/fpu: Improve the init_fpstate setup code
@ 2022-08-24 19:12 Chang S. Bae
  0 siblings, 0 replies; 4+ messages in thread
From: Chang S. Bae @ 2022-08-24 19:12 UTC (permalink / raw)
  To: linux-kernel; +Cc: x86, chang.seok.bae

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


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

end of thread, other threads:[~2023-01-07  4:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
  -- strict thread matches above, loose matches on Subject: below --
2022-08-24 19:12 Chang S. Bae

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®