]> git.baikalelectronics.ru Git - kernel.git/commit
x86/fpu: Rework restore_regs_from_fpstate()
authorThomas Gleixner <tglx@linutronix.de>
Thu, 14 Oct 2021 23:09:38 +0000 (01:09 +0200)
committerBorislav Petkov <bp@suse.de>
Fri, 22 Oct 2021 09:09:15 +0000 (11:09 +0200)
commit683397e67ea4c5cdb2aad8a96c514b4b8a5d066c
tree31af7db20335b0b0f50fbbb19e4b212abbb61245
parent607436fc95ee1a9874b96cfd1468618c88228998
x86/fpu: Rework restore_regs_from_fpstate()

xfeatures_mask_fpstate() is no longer valid when dynamically enabled
features come into play.

Rework restore_regs_from_fpstate() so it takes a constant mask which will
then be applied against the maximum feature set so that the restore
operation brings all features which are not in the xsave buffer xfeature
bitmap into init state.

This ensures that if the previous task used a dynamically enabled feature
that the task which restores has all unused components properly initialized.

Cleanup the last user of xfeatures_mask_fpstate() as well and remove it.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20211014230739.461348278@linutronix.de
arch/x86/include/asm/fpu/xstate.h
arch/x86/kernel/fpu/context.h
arch/x86/kernel/fpu/core.c
arch/x86/kernel/fpu/xstate.c