uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx)
{
#if defined(CONFIG_KVM)
- uint32_t vec[4];
-
-#ifdef __x86_64__
- asm volatile("cpuid"
- : "=a"(vec[0]), "=b"(vec[1]),
- "=c"(vec[2]), "=d"(vec[3])
- : "0"(function), "c"(count) : "cc");
-#else
- asm volatile("pusha \n\t"
- "cpuid \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");
-#endif
-
if (eax)
- *eax = vec[0];
+ *eax = kvm_arch_get_supported_cpuid(kvm_state, function, count, R_EAX);
if (ebx)
- *ebx = vec[1];
+ *ebx = kvm_arch_get_supported_cpuid(kvm_state, function, count, R_EBX);
if (ecx)
- *ecx = vec[2];
+ *ecx = kvm_arch_get_supported_cpuid(kvm_state, function, count, R_ECX);
if (edx)
- *edx = vec[3];
+ *edx = kvm_arch_get_supported_cpuid(kvm_state, function, count, R_EDX);
#endif
}