x86/cpufeature: Remove cpu_has_osxsave
authorBorislav Petkov <bp@suse.de>
Tue, 29 Mar 2016 15:41:56 +0000 (17:41 +0200)
committerIngo Molnar <mingo@kernel.org>
Thu, 31 Mar 2016 11:35:08 +0000 (13:35 +0200)
Use boot_cpu_has() instead.

Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-crypto@vger.kernel.org
Link: http://lkml.kernel.org/r/1459266123-21878-4-git-send-email-bp@alien8.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/crypto/camellia_aesni_avx2_glue.c
arch/x86/crypto/camellia_aesni_avx_glue.c
arch/x86/crypto/serpent_avx2_glue.c
arch/x86/include/asm/cpufeature.h
arch/x86/include/asm/xor_avx.h

index d844569245633845da1fe485dca9c44043be680f..c37f7028c85ae5d0d232e6410651ee80a6c91d41 100644 (file)
@@ -562,7 +562,8 @@ static int __init camellia_aesni_init(void)
 {
        const char *feature_name;
 
-       if (!cpu_has_avx2 || !cpu_has_avx || !cpu_has_aes || !cpu_has_osxsave) {
+       if (!cpu_has_avx2 || !cpu_has_avx || !cpu_has_aes ||
+           !boot_cpu_has(X86_FEATURE_OSXSAVE)) {
                pr_info("AVX2 or AES-NI instructions are not detected.\n");
                return -ENODEV;
        }
index 93d8f295784e399c2fc363d8b5602fede9039529..65f64556725b2274df61b312a6a15cfae79a34d6 100644 (file)
@@ -554,7 +554,7 @@ static int __init camellia_aesni_init(void)
 {
        const char *feature_name;
 
-       if (!cpu_has_avx || !cpu_has_aes || !cpu_has_osxsave) {
+       if (!cpu_has_avx || !cpu_has_aes || !boot_cpu_has(X86_FEATURE_OSXSAVE)) {
                pr_info("AVX or AES-NI instructions are not detected.\n");
                return -ENODEV;
        }
index 6d198342e2de4951635c46aa3486c88cbc793274..408cae2b354386cbee90c29ede6ee75c6d1a2189 100644 (file)
@@ -538,7 +538,7 @@ static int __init init(void)
 {
        const char *feature_name;
 
-       if (!cpu_has_avx2 || !cpu_has_osxsave) {
+       if (!cpu_has_avx2 || !boot_cpu_has(X86_FEATURE_OSXSAVE)) {
                pr_info("AVX2 instructions are not detected.\n");
                return -ENODEV;
        }
index 3aea54ecabfda6f459bd3e3e8bfd2bd3f2063bf1..33c29aabc9aaf18791db472cc5f21e6a00d3b450 100644 (file)
@@ -135,7 +135,6 @@ extern const char * const x86_bug_flags[NBUGINTS*32];
 #define cpu_has_x2apic         boot_cpu_has(X86_FEATURE_X2APIC)
 #define cpu_has_xsave          boot_cpu_has(X86_FEATURE_XSAVE)
 #define cpu_has_xsaves         boot_cpu_has(X86_FEATURE_XSAVES)
-#define cpu_has_osxsave                boot_cpu_has(X86_FEATURE_OSXSAVE)
 /*
  * Do not add any more of those clumsy macros - use static_cpu_has() for
  * fast paths and boot_cpu_has() otherwise!
index 7c0a517ec7511a667166c216df8357087ff3e7b0..e45e556140af9a952bb105c0a7b70cf4b9d4b60a 100644 (file)
@@ -167,12 +167,12 @@ static struct xor_block_template xor_block_avx = {
 
 #define AVX_XOR_SPEED \
 do { \
-       if (cpu_has_avx && cpu_has_osxsave) \
+       if (cpu_has_avx && boot_cpu_has(X86_FEATURE_OSXSAVE)) \
                xor_speed(&xor_block_avx); \
 } while (0)
 
 #define AVX_SELECT(FASTEST) \
-       (cpu_has_avx && cpu_has_osxsave ? &xor_block_avx : FASTEST)
+       (cpu_has_avx && boot_cpu_has(X86_FEATURE_OSXSAVE) ? &xor_block_avx : FASTEST)
 
 #else