Commit 938d4c25 authored by Andreas Färber's avatar Andreas Färber
Browse files

target-i386: Add "model-id" property to X86CPU


Signed-off-by: default avatarAndreas Färber <afaerber@suse.de>
Reviewed-by: default avatarEduardo Habkost <ehabkost@redhat.com>
Reviewed-by: default avatarIgor Mammedov <imammedo@redhat.com>
parent 036e2222
...@@ -673,8 +673,11 @@ static void x86_cpuid_version_set_stepping(Object *obj, Visitor *v, ...@@ -673,8 +673,11 @@ static void x86_cpuid_version_set_stepping(Object *obj, Visitor *v,
env->cpuid_version |= value & 0xf; env->cpuid_version |= value & 0xf;
} }
static void x86_cpuid_set_model_id(CPUX86State *env, const char *model_id) static void x86_cpuid_set_model_id(Object *obj, const char *model_id,
Error **errp)
{ {
X86CPU *cpu = X86_CPU(obj);
CPUX86State *env = &cpu->env;
int c, len, i; int c, len, i;
if (model_id == NULL) { if (model_id == NULL) {
...@@ -1004,7 +1007,7 @@ int cpu_x86_register(X86CPU *cpu, const char *cpu_model) ...@@ -1004,7 +1007,7 @@ int cpu_x86_register(X86CPU *cpu, const char *cpu_model)
env->cpuid_ext3_features &= TCG_EXT3_FEATURES; env->cpuid_ext3_features &= TCG_EXT3_FEATURES;
env->cpuid_svm_features &= TCG_SVM_FEATURES; env->cpuid_svm_features &= TCG_SVM_FEATURES;
} }
x86_cpuid_set_model_id(env, def->model_id); object_property_set_str(OBJECT(cpu), def->model_id, "model-id", &error);
if (error_is_set(&error)) { if (error_is_set(&error)) {
error_free(error); error_free(error);
return -1; return -1;
...@@ -1543,6 +1546,9 @@ static void x86_cpu_initfn(Object *obj) ...@@ -1543,6 +1546,9 @@ static void x86_cpu_initfn(Object *obj)
object_property_add(obj, "stepping", "int", object_property_add(obj, "stepping", "int",
NULL, NULL,
x86_cpuid_version_set_stepping, NULL, NULL, NULL); x86_cpuid_version_set_stepping, NULL, NULL, NULL);
object_property_add_str(obj, "model-id",
NULL,
x86_cpuid_set_model_id, NULL);
env->cpuid_apic_id = env->cpu_index; env->cpuid_apic_id = env->cpu_index;
mce_init(cpu); mce_init(cpu);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment