x86/fpu: Remove the explicit clearing of XSAVE dependent features
authorAndi Kleen <ak@linux.intel.com>
Fri, 13 Oct 2017 21:56:45 +0000 (14:56 -0700)
committerIngo Molnar <mingo@kernel.org>
Tue, 17 Oct 2017 15:14:57 +0000 (17:14 +0200)
Clearing a CPU feature with setup_clear_cpu_cap() clears all features
which depend on it. Expressing feature dependencies in one place is
easier to maintain than keeping functions like
fpu__xstate_clear_all_cpu_caps() up to date.

The features which depend on XSAVE have their dependency expressed in the
dependency table, so its sufficient to clear X86_FEATURE_XSAVE.

Remove the explicit clearing of XSAVE dependent features.

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-6-andi@firstfloor.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/kernel/fpu/xstate.c

index fb581292975b1223f798f071d79bd0b1e000c576..87a57b7642d3673420b272fec0f442b9baf76414 100644 (file)
@@ -73,26 +73,6 @@ unsigned int fpu_user_xstate_size;
 void fpu__xstate_clear_all_cpu_caps(void)
 {
        setup_clear_cpu_cap(X86_FEATURE_XSAVE);
-       setup_clear_cpu_cap(X86_FEATURE_XSAVEOPT);
-       setup_clear_cpu_cap(X86_FEATURE_XSAVEC);
-       setup_clear_cpu_cap(X86_FEATURE_XSAVES);
-       setup_clear_cpu_cap(X86_FEATURE_AVX);
-       setup_clear_cpu_cap(X86_FEATURE_AVX2);
-       setup_clear_cpu_cap(X86_FEATURE_AVX512F);
-       setup_clear_cpu_cap(X86_FEATURE_AVX512IFMA);
-       setup_clear_cpu_cap(X86_FEATURE_AVX512PF);
-       setup_clear_cpu_cap(X86_FEATURE_AVX512ER);
-       setup_clear_cpu_cap(X86_FEATURE_AVX512CD);
-       setup_clear_cpu_cap(X86_FEATURE_AVX512DQ);
-       setup_clear_cpu_cap(X86_FEATURE_AVX512BW);
-       setup_clear_cpu_cap(X86_FEATURE_AVX512VL);
-       setup_clear_cpu_cap(X86_FEATURE_MPX);
-       setup_clear_cpu_cap(X86_FEATURE_XGETBV1);
-       setup_clear_cpu_cap(X86_FEATURE_AVX512VBMI);
-       setup_clear_cpu_cap(X86_FEATURE_PKU);
-       setup_clear_cpu_cap(X86_FEATURE_AVX512_4VNNIW);
-       setup_clear_cpu_cap(X86_FEATURE_AVX512_4FMAPS);
-       setup_clear_cpu_cap(X86_FEATURE_AVX512_VPOPCNTDQ);
 }
 
 /*