@@ -1554,9 +1554,7 @@ static int cpu_x86_find_by_name(X86CPU *cpu, x86_def_t *x86_cpu_def,
x86_cpu_def->kvm_features &= ~minus_kvm_features;
x86_cpu_def->svm_features &= ~minus_svm_features;
x86_cpu_def->cpuid_7_0_ebx_features &= ~minus_7_0_ebx_features;
- if (x86_cpu_def->cpuid_7_0_ebx_features && x86_cpu_def->level < 7) {
- x86_cpu_def->level = 7;
- }
+
g_free(s);
return 0;
@@ -2120,6 +2118,10 @@ void x86_cpu_realize(Object *obj, Error **errp)
return;
}
+ if (env->cpuid_7_0_ebx_features && env->cpuid_level < 7) {
+ env->cpuid_level = 7;
+ }
+
if (!kvm_enabled()) {
env->cpuid_features &= TCG_FEATURES;
env->cpuid_ext_features &= TCG_EXT_FEATURES;
delay force set cpuid_level to 7 to realize time so property setters for cpuid_7_0_ebx_features and "level" could be used in any order/time between x86_cpu_initfn() and x86_cpu_realize(). Signed-off-by: Igor Mammedov <imammedo@redhat.com> --- target-i386/cpu.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-)