]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - arch/x86/kernel/cpu/common.c
x86/cpufeatures: Enumerate the new AVX512 BFLOAT16 instructions
[linux.git] / arch / x86 / kernel / cpu / common.c
index efb114298cfbc8a6d96ef76cac77bac8791ef1fb..dad20bc891d500a22af3f447e49da9119630bbf8 100644 (file)
@@ -847,6 +847,12 @@ void get_cpu_cap(struct cpuinfo_x86 *c)
                c->x86_capability[CPUID_7_0_EBX] = ebx;
                c->x86_capability[CPUID_7_ECX] = ecx;
                c->x86_capability[CPUID_7_EDX] = edx;
+
+               /* Check valid sub-leaf index before accessing it */
+               if (eax >= 1) {
+                       cpuid_count(0x00000007, 1, &eax, &ebx, &ecx, &edx);
+                       c->x86_capability[CPUID_7_1_EAX] = eax;
+               }
        }
 
        /* Extended state features: level 0x0000000d */