|
@@ -38,8 +38,6 @@
|
|
|
#include <crypto/sha.h>
|
|
|
#include <crypto/sha256_base.h>
|
|
|
#include <asm/fpu/api.h>
|
|
|
-#include <asm/xcr.h>
|
|
|
-#include <asm/fpu/xstate.h>
|
|
|
#include <linux/string.h>
|
|
|
|
|
|
asmlinkage void sha256_transform_ssse3(u32 *digest, const char *data,
|
|
@@ -132,15 +130,9 @@ static struct shash_alg algs[] = { {
|
|
|
#ifdef CONFIG_AS_AVX
|
|
|
static bool __init avx_usable(void)
|
|
|
{
|
|
|
- u64 xcr0;
|
|
|
-
|
|
|
- if (!cpu_has_avx || !cpu_has_osxsave)
|
|
|
- return false;
|
|
|
-
|
|
|
- xcr0 = xgetbv(XCR_XFEATURE_ENABLED_MASK);
|
|
|
- if ((xcr0 & (XSTATE_SSE | XSTATE_YMM)) != (XSTATE_SSE | XSTATE_YMM)) {
|
|
|
- pr_info("AVX detected but unusable.\n");
|
|
|
-
|
|
|
+ if (!cpu_has_xfeatures(XSTATE_SSE | XSTATE_YMM, NULL)) {
|
|
|
+ if (cpu_has_avx)
|
|
|
+ pr_info("AVX detected but unusable.\n");
|
|
|
return false;
|
|
|
}
|
|
|
|