mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 10:51:54 -04:00
Check maximum basic CPUID leaf before querying leaf 7 in AVX probing
This commit is contained in:
parent
5ed6a29db2
commit
46a09a380a
1 changed files with 5 additions and 0 deletions
|
|
@ -91,6 +91,11 @@ static inline int raid_cpu_match_avx(uint32_t leaf_1_ecx, uint32_t leaf_7_ebx, u
|
|||
{
|
||||
uint32_t reg[4];
|
||||
|
||||
/* check that leaf 7 is supported */
|
||||
raid_cpuid(0, 0, reg);
|
||||
if (reg[0] < 7)
|
||||
return 0;
|
||||
|
||||
raid_cpuid(1, 0, reg);
|
||||
if ((reg[2] & leaf_1_ecx) != leaf_1_ecx)
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue