Received: from eggs.gnu.org ([208.118.235.92]:33437) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T10me-0001P4-Qz for qemu-devel@nongnu.org; Mon, 13 Aug 2012 15:58:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T10md-0007NL-Ok for qemu-devel@nongnu.org; Mon, 13 Aug 2012 15:58:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:6392) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T10md-0007ND-Fh for qemu-devel@nongnu.org; Mon, 13 Aug 2012 15:58:39 -0400 Date: Mon, 13 Aug 2012 16:59:46 -0300 From: Eduardo Habkost Message-ID: <20120813195946.GT4425@otherpad.lan.raisama.net> References: <1344369413-9053-1-git-send-email-ehabkost@redhat.com> <1344369413-9053-4-git-send-email-ehabkost@redhat.com> <502952A4.4070508@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <502952A4.4070508@redhat.com> Subject: Re: [Qemu-devel] [RFC 03/15] kvm: set vcpu_id to APIC ID instead of CPU index List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov Cc: qemu-devel@nongnu.org, Gleb Natapov , Andreas =?iso-8859-1?Q?F=E4rber?= On Mon, Aug 13, 2012 at 09:16:52PM +0200, Igor Mammedov wrote: > On 08/07/2012 09:56 PM, Eduardo Habkost wrote: > >The CPU ID in KVM is supposed to be the APIC ID, so change the > >KVM_CREATE_VCPU call to match it. It 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. > What it would break if APIC ID != CPU index ? It is not supposed to break anything, now that SeaBIOS was changed to accept non-contiguous APIC IDs (and after applying patches 3-6 from this series). If there is other code that expect APIC ID == CPU index, that code also needs to be fixed. > > > > >Signed-off-by: Eduardo Habkost > >--- > > kvm-all.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > >diff --git a/kvm-all.c b/kvm-all.c > >index 2148b20..38de992 100644 > >--- a/kvm-all.c > >+++ b/kvm-all.c > >@@ -213,7 +213,7 @@ int kvm_init_vcpu(CPUArchState *env) > > > > DPRINTF("kvm_init_vcpu\n"); > > > >- ret = kvm_vm_ioctl(s, KVM_CREATE_VCPU, env->cpu_index); > >+ ret = kvm_vm_ioctl(s, KVM_CREATE_VCPU, env->cpuid_apic_id); > > if (ret < 0) { > > DPRINTF("kvm_create_vcpu failed\n"); > > goto err; > > > > > -- > Regards, > Igor -- Eduardo