diff --git a/src/cpu/cpu_map.xml b/src/cpu/cpu_map.xml index affcce35ef..d059e2036b 100644 --- a/src/cpu/cpu_map.xml +++ b/src/cpu/cpu_map.xml @@ -142,6 +142,9 @@ + + + @@ -261,6 +264,15 @@ + + + + + + + + + diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 7cd67b8f77..e691c04a27 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -1539,7 +1539,10 @@ static inline void cpuidCall(struct cpuX86cpuid *cpuid) { # if __x86_64__ - asm("cpuid" + asm("xor %%ebx, %%ebx;" /* clear the other registers as some cpuid */ + "xor %%ecx, %%ecx;" /* functions may use them as additional */ + "xor %%edx, %%edx;" /* arguments */ + "cpuid;" : "=a" (cpuid->eax), "=b" (cpuid->ebx), "=c" (cpuid->ecx), @@ -1550,6 +1553,9 @@ cpuidCall(struct cpuX86cpuid *cpuid) * for global offset table on i386 with -fPIC */ asm("push %%ebx;" + "xor %%ebx, %%ebx;" /* clear the other registers as some cpuid */ + "xor %%ecx, %%ecx;" /* functions may use them as additional */ + "xor %%edx, %%edx;" /* arguments */ "cpuid;" "mov %%ebx, %1;" "pop %%ebx;"