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.

Backports commit aec661de86894e914d2d82431d9cefa9a9a40213 from qemu
This commit is contained in:
Eduardo Habkost 2018-02-26 04:47:01 -05:00 committed by Lioncash
parent f29384c810
commit 49c04d7104
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -3023,6 +3023,11 @@ static int x86_cpu_realizefn(struct uc_struct *uc, DeviceState *dev, Error **err
cpu->env.features[w] &= ~cpu->minus_features[w];
}
// Unicorn: commented out
//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: */