From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH RFC 3/3] Break dependency between vcpu index in vcpus array and vcpu's apic id. Date: Thu, 28 May 2009 08:11:09 +0300 Message-ID: <20090528051109.GB3948@redhat.com> References: <1242910606-29286-1-git-send-email-gleb@redhat.com> <1242910606-29286-4-git-send-email-gleb@redhat.com> <20090521182145.GA11828@amt.cnet> <20090521200642.GB6052@redhat.com> <20090521202957.GA12943@amt.cnet> <20090522114120.GD6052@redhat.com> <20090528034732.GB6090@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: avi@redhat.com, kvm@vger.kernel.org To: Marcelo Tosatti Return-path: Received: from mx2.redhat.com ([66.187.237.31]:36253 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751207AbZE1FLJ (ORCPT ); Thu, 28 May 2009 01:11:09 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n4S5BBEO024123 for ; Thu, 28 May 2009 01:11:11 -0400 Content-Disposition: inline In-Reply-To: <20090528034732.GB6090@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, May 28, 2009 at 12:47:32AM -0300, Marcelo Tosatti wrote: > On Fri, May 22, 2009 at 02:41:20PM +0300, Gleb Natapov wrote: > > On Thu, May 21, 2009 at 05:29:57PM -0300, Marcelo Tosatti wrote: > > > On Thu, May 21, 2009 at 11:06:42PM +0300, Gleb Natapov wrote: > > > > > Why don't make a convention that vcpu_id 0 is the BSP, by default, > > > > > instead of the first vcpu created? This way if userspace creates vcpu 3 > > > > > first, there are no problems. > > > > > > > > > Because userspace no longer control vcpu_id allocation. I also want to > > > > get rid of "first vcpu is bsp" restriction, but this fill require new > > > > ioctl I guess. > > > > > > Or hardcode "apic_id == 0 is BSP" for now, and later add an ioctl to set > > > the BSP? > > > > > We should not assume anything about apic_ids. For instance if the number > > of ioapics+cpu cores are greater than 15 it is recommended to assign ids > > 0-(N-1) to ioapic (N is the number of ioapics). This is because ioapic > > id is only 4 bits long, but it occupies the same id space as apic ids. > > If keep the behaviour like in the last patch submitted, and introduce a > new ioctl to set the BSP, you get backward compatibility for free. Yeah, this is what I did for the next patch series. I am playing with userspace now. -- Gleb.