qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 06/27] target-i386: kvm: set vcpu_id to APIC ID inst


From: Eduardo Habkost
Subject: [Qemu-devel] [PATCH 06/27] target-i386: kvm: set vcpu_id to APIC ID instead of CPU index
Date: Wed, 24 Oct 2012 15:49:40 -0200

The CPU ID in KVM is supposed to be the APIC ID, so change the
KVM_CREATE_VCPU call to match it. The current behavior didn't break
anything yet because today the APIC ID is assumed to be == the CPU
index, but this won't be true in the future.

Signed-off-by: Eduardo Habkost <address@hidden>
---
Changes v1 -> v2:
 - Change only i386 code (kvm_arch_vcpu_id())
---
 target-i386/kvm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index 6e82125..a0880ca 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -355,7 +355,7 @@ static void cpu_update_state(void *opaque, int running, 
RunState state)
 
 unsigned long kvm_arch_vcpu_id(CPUArchState *env)
 {
-    return env->cpu_index;
+    return env->cpuid_apic_id;
 }
 
 int kvm_arch_init_vcpu(CPUX86State *env)
-- 
1.7.11.7




reply via email to

[Prev in Thread] Current Thread [Next in Thread]