summaryrefslogtreecommitdiffstats
path: root/target-i386
diff options
context:
space:
mode:
authorBharata B Rao2011-11-02 09:46:08 +0100
committerAnthony Liguori2011-11-02 13:55:05 +0100
commitf2209eb854a016eabc444b45f6d6b1636949141f (patch)
tree612bd9e8888ee4a69f480e6007397c651c0ce850 /target-i386
parentintel-hda: fix stream search (diff)
downloadqemu-f2209eb854a016eabc444b45f6d6b1636949141f.tar.gz
qemu-f2209eb854a016eabc444b45f6d6b1636949141f.tar.xz
qemu-f2209eb854a016eabc444b45f6d6b1636949141f.zip
Fix X86 CPU topology in KVM mode
apic id returned to guest kernel in ebx for cpuid(function=1) depends on CPUX86State->cpuid_apic_id which gets populated after the cpuid information is cached in the host kernel. This results in broken CPU topology in guest. Fix this by setting cpuid_apic_id before cpuid information is passed to the host kernel. This is done by moving the setting of cpuid_apic_id to cpu_x86_init() where it will work for both KVM as well as TCG modes. Acked-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Bharata B Rao <bharata.rao@gmail.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'target-i386')
-rw-r--r--target-i386/helper.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/target-i386/helper.c b/target-i386/helper.c
index 6c6a1675df..2586aff700 100644
--- a/target-i386/helper.c
+++ b/target-i386/helper.c
@@ -1257,6 +1257,7 @@ CPUX86State *cpu_x86_init(const char *cpu_model)
cpu_x86_close(env);
return NULL;
}
+ env->cpuid_apic_id = env->cpu_index;
mce_init(env);
qemu_init_vcpu(env);