]> git.baikalelectronics.ru Git - kernel.git/commit
x86/fpu: Cache xfeature flags from CPUID
authorThomas Gleixner <tglx@linutronix.de>
Thu, 24 Mar 2022 13:47:12 +0000 (14:47 +0100)
committerBorislav Petkov <bp@suse.de>
Wed, 30 Mar 2022 09:05:32 +0000 (11:05 +0200)
commit1c2d2cefd62de2e03286b4cfb112bf9a8e6e80a4
tree635cb351f107ece2f35e86f197791e8d0262ff74
parent76304fe39c596b511acff9be353bfc2025b17ef2
x86/fpu: Cache xfeature flags from CPUID

In preparation for runtime calculation of XSAVE offsets cache the feature
flags for each XSTATE component during feature enumeration via CPUID(0xD).

EDX has two relevant bits:
    0 Supervisor component
    1 Feature storage must be 64 byte aligned

These bits are currently only evaluated during init, but the alignment bit
must be cached to make runtime calculation of XSAVE offsets efficient.

Cache the full EDX content and use it for the existing alignment and
supervisor checks.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lore.kernel.org/r/20220324134623.573656209@linutronix.de
arch/x86/kernel/fpu/xstate.c