x86/fpu/xstate: Consolidate size calculations
authorThomas Gleixner <tglx@linutronix.de>
Mon, 28 Mar 2022 18:43:21 +0000 (20:43 +0200)
committerBorislav Petkov <bp@suse.de>
Wed, 30 Mar 2022 10:04:09 +0000 (12:04 +0200)
commitd6d6d50f1e801a790a242c80eeda261e36c43b7b
tree537bfef6dd75df1a31abd08c4b96aaa7acf94fdc
parent781c64bfcb735960717d1cb45428047ff6a5030c
x86/fpu/xstate: Consolidate size calculations

Use the offset calculation to do the size calculation which avoids yet
another series of CPUID instructions for each invocation.

  [ Fix the FP/SSE only case which missed to take the xstate
    header into account, as
Reported-by: kernel test robot <oliver.sang@intel.com> ]
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lore.kernel.org/r/87o81pgbp2.ffs@tglx
arch/x86/kernel/fpu/xstate.c