From: Peter Maydell Date: Mon, 2 Mar 2015 14:25:48 +0000 (+0000) Subject: Merge remote-tracking branch 'remotes/ehabkost/tags/x86-pull-request' into staging X-Git-Tag: v2.3.0-rc0~47 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b8a173b25c887a606681fc35a46702c164d5b2d0;p=thirdparty%2Fqemu.git Merge remote-tracking branch 'remotes/ehabkost/tags/x86-pull-request' into staging * remotes/ehabkost/tags/x86-pull-request: target-i386: Move APIC ID compatibility code to pc.c target-i386: Require APIC ID to be explicitly set before CPU realize target-i386: Set APIC ID using cpu_index on CONFIG_USER linux-user: Check for cpu_init() errors target-i386: Move CPUX86State.cpuid_apic_id to X86CPU.apic_id target-i386: Simplify error handling on cpu_x86_init_user() target-i386: Eliminate cpu_init() function target-i386: Rename cpu_x86_init() to cpu_x86_init_user() target-i386: Move topology.h to include/hw/i386 target-i386: Eliminate unnecessary get_cpuid_vendor() function target-i386: Simplify listflags() function Conflicts: target-i386/cpu.c Signed-off-by: Peter Maydell --- b8a173b25c887a606681fc35a46702c164d5b2d0 diff --cc target-i386/cpu.c index d543e2b5370,70fd6db72f8..14c6c4abaf9 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@@ -2156,20 -2141,29 +2141,28 @@@ CPUX86State *cpu_x86_init_user(const ch cpu = cpu_x86_create(cpu_model, NULL, &error); if (error) { - goto out; + goto error; } - object_property_set_bool(OBJECT(cpu), true, "realized", &error); + object_property_set_int(OBJECT(cpu), CPU(cpu)->cpu_index, "apic-id", + &error); + if (error) { + goto error; + } - out: + object_property_set_bool(OBJECT(cpu), true, "realized", &error); if (error) { - error_report_err(error); - if (cpu != NULL) { - object_unref(OBJECT(cpu)); - cpu = NULL; - } + goto error; } - return cpu; + + return &cpu->env; + + error: - error_report("%s", error_get_pretty(error)); - error_free(error); ++ error_report_err(error); + if (cpu != NULL) { + object_unref(OBJECT(cpu)); + } + return NULL; } static void x86_cpu_cpudef_class_init(ObjectClass *oc, void *data)