From patchwork Mon Jan 28 16:18:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 2056681 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 8178DDF2A1 for ; Mon, 28 Jan 2013 16:19:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757288Ab3A1QTQ (ORCPT ); Mon, 28 Jan 2013 11:19:16 -0500 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 Received: from relay2.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id B5CADA5255; Mon, 28 Jan 2013 17:19:12 +0100 (CET) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org 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) 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> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1359389934-16663-1-git-send-email-afaerber@suse.de> References: <1359389934-16663-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: 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 CPU 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ärber --- 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)