Skip to content

Commit

Permalink
x86/cpufeature: Remove cpu_has_osxsave
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Borislav Petkov authored and Ingo Molnar committed Mar 31, 2016
1 parent 0c9f353 commit ab4a56f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
3 changes: 2 additions & 1 deletion arch/x86/crypto/camellia_aesni_avx2_glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/crypto/camellia_aesni_avx_glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/crypto/serpent_avx2_glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
1 change: 0 additions & 1 deletion arch/x86/include/asm/cpufeature.h
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down
4 changes: 2 additions & 2 deletions arch/x86/include/asm/xor_avx.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit ab4a56f

Please sign in to comment.