OSDN Git Service

x86/fpu: Make XSAVE check the base CPUID features before enabling
authorAndi Kleen <ak@linux.intel.com>
Fri, 13 Oct 2017 21:56:44 +0000 (14:56 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Dec 2017 13:26:14 +0000 (14:26 +0100)
commit0e7127aa76e05b51f767dbec74b236a1fa5eab06
tree46dba17f1f20480cf5b24933479bfebc37ac4c22
parentf01d7efac7929e3630e25a84e101228ea907bbea
x86/fpu: Make XSAVE check the base CPUID features before enabling

commit ccb18db2ab9d923df07e7495123fe5fb02329713 upstream.

Before enabling XSAVE, not only check the XSAVE specific CPUID bits,
but also the base CPUID features of the respective XSAVE feature.
This allows to disable individual XSAVE states using the existing
clearcpuid= option, which can be useful for performance testing
and debugging, and also in general avoids inconsistencies.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20171013215645.23166-5-andi@firstfloor.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kernel/fpu/xstate.c