summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorYu-cheng Yu <yu-cheng.yu@intel.com>2020-01-09 13:14:51 -0800
committerBorislav Petkov <bp@suse.de>2020-02-12 15:43:31 +0100
commit49a91d61aed1db01097b51a24c77137eb348a0bf (patch)
tree9f82f7448aed1693db3b23763dfa140912b8ae9c /kernel
parentc12e13dcd814023a903399ec5ac2e7082d664b8b (diff)
x86/fpu/xstate: Fix XSAVES offsets in setup_xstate_comp()
In setup_xstate_comp(), each XSAVES component offset starts from the end of its preceding component plus alignment. A disabled feature does not take space and its offset should be set to the end of its preceding one with no alignment. However, in this case, alignment is incorrectly added to the offset, which can cause the next component to have a wrong offset. This problem has not been visible because currently there is no xfeature requiring alignment. Fix it by tracking the next starting offset only from enabled xfeatures. To make it clear, also change the function name to setup_xstate_comp_offsets(). [ bp: Fix a typo in the comment above it, while at it. ] Signed-off-by: Yu-cheng Yu <yu-cheng.yu@intel.com> Signed-off-by: Borislav Petkov <bp@suse.de> Reviewed-by: Dave Hansen <dave.hansen@linux.intel.com> Link: https://lkml.kernel.org/r/20200109211452.27369-3-yu-cheng.yu@intel.com
Diffstat (limited to 'kernel')
0 files changed, 0 insertions, 0 deletions