[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-stable] [PATCH stable-0.15 13/36] Fix X86 CPU topology in KVM mode
From: |
Andreas Färber |
Subject: |
[Qemu-stable] [PATCH stable-0.15 13/36] Fix X86 CPU topology in KVM mode |
Date: |
Wed, 28 Mar 2012 14:52:16 +0200 |
From: Bharata B Rao <address@hidden>
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 <address@hidden>
Signed-off-by: Bharata B Rao <address@hidden>
Signed-off-by: Anthony Liguori <address@hidden>
(cherry picked from commit f2209eb854a016eabc444b45f6d6b1636949141f)
Signed-off-by: Bruce Rogers <address@hidden>
Signed-off-by: Andreas Färber <address@hidden>
---
hw/pc.c | 1 -
target-i386/helper.c | 1 +
2 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/hw/pc.c b/hw/pc.c
index a3e8539..14ce684 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -931,7 +931,6 @@ static CPUState *pc_new_cpu(const char *cpu_model)
exit(1);
}
if ((env->cpuid_features & CPUID_APIC) || smp_cpus > 1) {
- env->cpuid_apic_id = env->cpu_index;
env->apic_state = apic_init(env, env->cpuid_apic_id);
}
qemu_register_reset(pc_cpu_reset, env);
diff --git a/target-i386/helper.c b/target-i386/helper.c
index e9be104..829c1da 100644
--- a/target-i386/helper.c
+++ b/target-i386/helper.c
@@ -1258,6 +1258,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);
--
1.7.7
- [Qemu-stable] [PATCH stable-0.15 00/36] Preparing 0.15.2, Andreas Färber, 2012/03/29
- [Qemu-stable] [PATCH stable-0.15 01/36] ccid: Fix buffer overrun in handling of VSC_ATR message, Andreas Färber, 2012/03/28
- [Qemu-stable] [PATCH stable-0.15 11/36] acl: Fix use after free in qemu_acl_reset(), Andreas Färber, 2012/03/28
- [Qemu-stable] [PATCH stable-0.15 25/36] block: Fix vpc initialization of the Dynamic Disk Header, Andreas Färber, 2012/03/28
- [Qemu-stable] [PATCH stable-0.15 13/36] Fix X86 CPU topology in KVM mode,
Andreas Färber <=
- [Qemu-stable] [PATCH stable-0.15 07/36] kvm: avoid reentring kvm_flush_coalesced_mmio_buffer(), Andreas Färber, 2012/03/28
- [Qemu-stable] [PATCH stable-0.15 10/36] ide: Fix off-by-one error in array index check, Andreas Färber, 2012/03/28
- [Qemu-stable] [PATCH stable-0.15 27/36] block: reinitialize across bdrv_close()/bdrv_open(), Andreas Färber, 2012/03/28
- [Qemu-stable] [PATCH stable-0.15 20/36] hda: do not mix output and input stream states, RHBZ #740493, Andreas Färber, 2012/03/28
- [Qemu-stable] [PATCH stable-0.15 09/36] block: Fix bdrv_open use after free, Andreas Färber, 2012/03/28
- [Qemu-stable] [PATCH stable-0.15 23/36] block: set bs->read_only before .bdrv_open(), Andreas Färber, 2012/03/28
- [Qemu-stable] [PATCH stable-0.15 17/36] vns/tls: don't use depricated gnutls functions, Andreas Färber, 2012/03/28
- [Qemu-stable] [PATCH stable-0.15 08/36] vmdk: vmdk_read_cid returns garbage if p_name is NULL, Andreas Färber, 2012/03/28
- [Qemu-stable] [PATCH stable-0.15 29/36] vmdk: Fix possible segfaults, Andreas Färber, 2012/03/28
- [Qemu-stable] [PATCH stable-0.15 34/36] pc: fix event_idx compatibility for virtio devices, Andreas Färber, 2012/03/28