From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [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 Message-ID: <1359389934-16663-8-git-send-email-afaerber@suse.de> References: <1359389934-16663-1-git-send-email-afaerber@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Eduardo Habkost , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Gleb Natapov (supporter:X86), Marcelo Tosatti (supporter:X86), kvm@vger.kernel.org (open list:X86) To: qemu-devel@nongnu.org Return-path: Received: from cantor2.suse.de ([195.135.220.15]:43540 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757233Ab3A1QTN (ORCPT ); Mon, 28 Jan 2013 11:19:13 -0500 In-Reply-To: <1359389934-16663-1-git-send-email-afaerber@suse.de> Sender: kvm-owner@vger.kernel.org List-ID: =46rom: Eduardo Habkost 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 CP= U index, but this won't be true in the future. Signed-off-by: Eduardo Habkost Reviewed-by: Marcelo Tosatti Acked-by: Gleb Natapov Signed-off-by: Andreas F=C3=A4rber --- target-i386/kvm.c | 5 +++-- 1 Datei ge=C3=A4ndert, 3 Zeilen hinzugef=C3=BCgt(+), 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 run= ning, RunState state) } } =20 -unsigned long kvm_arch_vcpu_id(CPUState *cpu) +unsigned long kvm_arch_vcpu_id(CPUState *cs) { - return cpu->cpu_index; + X86CPU *cpu =3D X86_CPU(cs); + return cpu->env.cpuid_apic_id; } =20 int kvm_arch_init_vcpu(CPUState *cs) --=20 1.7.10.4