mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
kvm: x86: Pass KVMState to kvm_arch_get_supported_cpuid
kvm_arch_get_supported_cpuid checks for global cpuid restrictions, it does not require any CPUState reference. Changing its interface allows to call it before any VCPU is initialized. CC: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
This commit is contained in:
parent
4bef75b533
commit
ba9bc59e1f
3 changed files with 28 additions and 24 deletions
|
@ -1144,10 +1144,12 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
|
|||
break;
|
||||
case 7:
|
||||
if (kvm_enabled()) {
|
||||
*eax = kvm_arch_get_supported_cpuid(env, 0x7, count, R_EAX);
|
||||
*ebx = kvm_arch_get_supported_cpuid(env, 0x7, count, R_EBX);
|
||||
*ecx = kvm_arch_get_supported_cpuid(env, 0x7, count, R_ECX);
|
||||
*edx = kvm_arch_get_supported_cpuid(env, 0x7, count, R_EDX);
|
||||
KVMState *s = env->kvm_state;
|
||||
|
||||
*eax = kvm_arch_get_supported_cpuid(s, 0x7, count, R_EAX);
|
||||
*ebx = kvm_arch_get_supported_cpuid(s, 0x7, count, R_EBX);
|
||||
*ecx = kvm_arch_get_supported_cpuid(s, 0x7, count, R_ECX);
|
||||
*edx = kvm_arch_get_supported_cpuid(s, 0x7, count, R_EDX);
|
||||
} else {
|
||||
*eax = 0;
|
||||
*ebx = 0;
|
||||
|
@ -1179,10 +1181,12 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
|
|||
break;
|
||||
}
|
||||
if (kvm_enabled()) {
|
||||
*eax = kvm_arch_get_supported_cpuid(env, 0xd, count, R_EAX);
|
||||
*ebx = kvm_arch_get_supported_cpuid(env, 0xd, count, R_EBX);
|
||||
*ecx = kvm_arch_get_supported_cpuid(env, 0xd, count, R_ECX);
|
||||
*edx = kvm_arch_get_supported_cpuid(env, 0xd, count, R_EDX);
|
||||
KVMState *s = env->kvm_state;
|
||||
|
||||
*eax = kvm_arch_get_supported_cpuid(s, 0xd, count, R_EAX);
|
||||
*ebx = kvm_arch_get_supported_cpuid(s, 0xd, count, R_EBX);
|
||||
*ecx = kvm_arch_get_supported_cpuid(s, 0xd, count, R_ECX);
|
||||
*edx = kvm_arch_get_supported_cpuid(s, 0xd, count, R_EDX);
|
||||
} else {
|
||||
*eax = 0;
|
||||
*ebx = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue