Hi, One of the problems when coordinating with the recent x86 CPU work (CPU properties, APIC ID topology fixes) is to have a sane x86 CPU initialization code to be used as base.
To make things worse, the cleanups we're doing are buried inside series that do more intrusive work. This is an attempt to establish a saner base for further work. Except for additional error messages when initialization fails, this series should not introduce any behavior change, but just clean up cpu_x86_init() to look like this: name, features = g_strsplit(cpu_string, ",", 2); cpu = X86_CPU(object_new(TYPE_X86_CPU)); cpu_x86_find_cpudef(name, &def, &error) cpu_x86_parse_featurestr(&def, features, &error) cpudef_2_x86_cpu(cpu, &def, &error) x86_cpu_realize(OBJECT(cpu), &error); Basically, this isolates the parts of the code that do: - Splitting cpu_model string into CPU model and feature string; - CPU object creation; - CPU model lookup; - CPU feature string parsing. After this, I will send an additional patch to introduce CPU classes on target-i386, based on this series. Eduardo Habkost (16): target-i386/cpu.c: coding style fix target-i386: move cpu_x86_init() to cpu.c target-i386: cpu: rename x86_def_t to X86CPUDefinition target-i386: x86_cpudef_setup(): cosmetic change on comment target-i386: cpu_x86_init(): move error handling to end of function target-i386: cpu_x86_init(): print error message in case of error target-i386: cpu_x86_register(): report errors using Error parameter target-i386: cpu_x86_register(): reorder CPU property setting target-i386: kill cpu_x86_register() target-i386: return Error from cpu_x86_find_by_name() target-i386: cpu_x86_find_by_name(): split CPU model and feature string first target-i386: cpu: create cpu_x86_find_cpudef() function target-i386: cpu_x86_init(): rename cpu_model to cpu_string target-i386: cpu_x86_init(): eliminate extra 'def1' variable target-i386: cpu: separate cpudef lookup from feature string parsing target-i386: cpu_x86_init(): reorder split of CPU string and creation of CPU object Igor Mammedov (1): target-i386: move out CPU features initialization to separate func target-i386/cpu.c | 175 ++++++++++++++++++++++++++++++++++----------------- target-i386/cpu.h | 1 - target-i386/helper.c | 24 ------- 3 files changed, 118 insertions(+), 82 deletions(-) -- 1.7.11.7