diff options
author | Chang S. Bae <chang.seok.bae@intel.com> | 2025-03-20 16:42:54 -0700 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2025-04-14 08:18:29 +0200 |
commit | a758ae2885eacaa68e4de9a01539a242a6bbb403 (patch) | |
tree | a51670b9d0784f97b916127782df26c028899af7 /scripts/lib/kdoc/kdoc_re.py | |
parent | 15d51a2f6f3f7057311d6e37d5190d58597a94a9 (diff) |
x86/fpu/xstate: Adjust XSAVE buffer size calculation
The current xstate size calculation assumes that the highest-numbered
xstate feature has the highest offset in the buffer, determining the size
based on the topmost bit in the feature mask. However, this assumption is
not architecturally guaranteed -- higher-numbered features may have lower
offsets.
With the introduction of the xfeature order table and its helper macro,
xstate components can now be traversed in their positional order. Update
the non-compacted format handling to iterate through the table to
determine the last-positioned feature. Then, set the offset accordingly.
Since size calculation primarily occurs during initialization or in
non-critical paths, looping to find the last feature is not expected to
have a meaningful performance impact.
Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Link: https://lore.kernel.org/r/20250320234301.8342-4-chang.seok.bae@intel.com
Diffstat (limited to 'scripts/lib/kdoc/kdoc_re.py')
0 files changed, 0 insertions, 0 deletions