kvm-unit-test: fix cpuid test
PATCH 1/1 kvm-unit-test: fix cpuid test
If cpuid is called with function value greater than max supported one max supported value is used instead and index parameter is honored. That is why we need to initialize index to same value in the test to get same result from both cpuid invocations.
x86/realmode.c +1 -0
@@ -1375,6 +1375,7 @@ static void test_cpuid(void)unsigned eax, ebx, ecx, edx; inregs.eax = eax = function; + inregs.ecx = ecx =0 ; asm("cpuid" :"+a" (eax),"=b" (ebx),"=c" (ecx),"=d" (edx));exec_in_big_real_mode (&insn_cpuid); report("cpuid", R_AX|R_BX|R_CX|R_DX,
--
Gleb.
Il 04/11/2013 15:04, Gleb Natapov ha scritto:
Quoted 18 lines
If cpuid is called with function value greater than max supported one max supported value is used instead and index parameter is honored. That is why we need to initialize index to same value in the test to get same result from both cpuid invocations.
x86/realmode.c +1
-1@@ -1375,6 +1375,7 @@ static void test_cpuid(void)unsigned eax, ebx, ecx, edx; inregs.eax = eax = function; + inregs.ecx = ecx =0 ; asm("cpuid" :"+a" (eax),"=b" (ebx),"=c" (ecx),"=d" (edx));exec_in_big_real_mode (&insn_cpuid); report("cpuid", R_AX|R_BX|R_CX|R_DX, --
Quoted 2 lines
Gleb.
Reviewed-by Paolo Bonzini <[email protected]>