mirror of https://github.com/xemu-project/xemu.git
target-i386: Clear KVM CPUID features if KVM is disabled
This will ensure all checks for features[FEAT_KVM] in the code will be correct in case the KVM CPUID leaf is completely disabled. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
This commit is contained in:
parent
3ddcd2edc8
commit
aec661de86
|
@ -3038,6 +3038,10 @@ static void x86_cpu_realizefn(DeviceState *dev, Error **errp)
|
|||
cpu->env.features[w] &= ~minus_features[w];
|
||||
}
|
||||
|
||||
if (!kvm_enabled() || !cpu->expose_kvm) {
|
||||
env->features[FEAT_KVM] = 0;
|
||||
}
|
||||
|
||||
x86_cpu_enable_xsave_components(cpu);
|
||||
|
||||
/* CPUID[EAX=7,ECX=0].EBX always increased level automatically: */
|
||||
|
|
Loading…
Reference in New Issue