Fix cpuid KVM crash on i386
PATCH 1/1 Fix cpuid KVM crash on i386
Cpuid should return into vec, not overwrite past address in count. Changeset 6565 broke this.
Signed-off-by Lubomir Rintel <[email protected]>
helper.c +4 -4
@@ -1418,10 +1418,10 @@#else asmvolatile ("pusha \n\t" "cpuid \n\t" -"mov %%eax, 0(%1) \n\t" -"mov %%ebx, 4(%1) \n\t" -"mov %%ecx, 8(%1) \n\t" -"mov %%edx, 12(%1) \n\t" +"mov %%eax, 0(%2) \n\t" +"mov %%ebx, 4(%2) \n\t" +"mov %%ecx, 8(%2) \n\t" +"mov %%edx, 12(%2) \n\t" "popa" : :"a" (function),"c" (count),"S" (vec) :"memory" ,"cc" );
Anthony Liguori
AppliedQuoted 3 lines · Lubomir Rintel
Cpuid should return into vec, not overwrite past address in count. Changeset 6565 broke this.
Applied to both stable and trunk. Thanks.
Regards,
Anthony Liguori
Quoted 27 lines
Signed-off-by Lubomir Rintel <[email protected]>Index:
target-i386/helper.c
===================================================================helper.c +4
-4@@ -1418,10 +1418,10 @@#else asmvolatile ("pusha \n\t" "cpuid \n\t" -"mov %%eax, 0(%1) \n\t" -"mov %%ebx, 4(%1) \n\t" -"mov %%ecx, 8(%1) \n\t" -"mov %%edx, 12(%1) \n\t" +"mov %%eax, 0(%2) \n\t" +"mov %%ebx, 4(%2) \n\t" +"mov %%ecx, 8(%2) \n\t" +"mov %%edx, 12(%2) \n\t" "popa" : :"a" (function),"c" (count),"S" (vec) :"memory" ,"cc" );