Fix X86 CPU topology in KVM mode
authorBharata B Rao <bharata.rao@gmail.com>
Wed, 2 Nov 2011 08:46:08 +0000 (14:16 +0530)
committerAnthony Liguori <aliguori@us.ibm.com>
Wed, 2 Nov 2011 12:55:05 +0000 (07:55 -0500)
commitf2209eb854a016eabc444b45f6d6b1636949141f
tree612bd9e8888ee4a69f480e6007397c651c0ce850
parent18ebcc86f2e21c83efe26b09218c859234876465
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>
hw/pc.c
target-i386/helper.c