qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 07/37] target-i386: kvm: Set vcpu_id to APIC ID inst


From: Andreas Färber
Subject: [Qemu-devel] [PATCH 07/37] target-i386: kvm: Set vcpu_id to APIC ID instead of CPU index
Date: Mon, 28 Jan 2013 17:18:24 +0100

From: Eduardo Habkost <address@hidden>

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 equal to the CPU
index, but this won't be true in the future.

Signed-off-by: Eduardo Habkost <address@hidden>
Reviewed-by: Marcelo Tosatti <address@hidden>
Acked-by: Gleb Natapov <address@hidden>
Signed-off-by: Andreas Färber <address@hidden>
---
 target-i386/kvm.c |    5 +++--
 1 Datei geändert, 3 Zeilen hinzugefügt(+), 2 Zeilen entfernt(-)

diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index 5f3f789..c440809 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -411,9 +411,10 @@ static void cpu_update_state(void *opaque, int running, 
RunState state)
     }
 }
 
-unsigned long kvm_arch_vcpu_id(CPUState *cpu)
+unsigned long kvm_arch_vcpu_id(CPUState *cs)
 {
-    return cpu->cpu_index;
+    X86CPU *cpu = X86_CPU(cs);
+    return cpu->env.cpuid_apic_id;
 }
 
 int kvm_arch_init_vcpu(CPUState *cs)
-- 
1.7.10.4




reply via email to

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