mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
kvm: Add CPUID support for VIA CPU
When KVM is running on VIA CPU with host cpu's model, the feautures of VIA CPU will be passed into kvm guest by calling the CPUID instruction for Centaur. Signed-off-by: BrillyWu<brillywu@viatech.com.cn> Signed-off-by: KaryJin<karyjin@viatech.com.cn> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
This commit is contained in:
parent
6df658f55c
commit
b3baa152aa
3 changed files with 74 additions and 3 deletions
|
@ -482,6 +482,21 @@ int kvm_arch_init_vcpu(CPUState *env)
|
|||
cpu_x86_cpuid(env, i, 0, &c->eax, &c->ebx, &c->ecx, &c->edx);
|
||||
}
|
||||
|
||||
/* Call Centaur's CPUID instructions they are supported. */
|
||||
if (env->cpuid_xlevel2 > 0) {
|
||||
env->cpuid_ext4_features &=
|
||||
kvm_arch_get_supported_cpuid(env, 0xC0000001, 0, R_EDX);
|
||||
cpu_x86_cpuid(env, 0xC0000000, 0, &limit, &unused, &unused, &unused);
|
||||
|
||||
for (i = 0xC0000000; i <= limit; i++) {
|
||||
c = &cpuid_data.entries[cpuid_i++];
|
||||
|
||||
c->function = i;
|
||||
c->flags = 0;
|
||||
cpu_x86_cpuid(env, i, 0, &c->eax, &c->ebx, &c->ecx, &c->edx);
|
||||
}
|
||||
}
|
||||
|
||||
cpuid_data.cpuid.nent = cpuid_i;
|
||||
|
||||
#ifdef KVM_CAP_MCE
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue