From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH v4 03/10] x86: Extend validity of cpu_is_bsp Date: Sun, 7 Mar 2010 15:50:36 +0200 Message-ID: <20100307135036.GZ16909@redhat.com> References: <20100303160022.GG16909@redhat.com> <4B8EF1FE.7020000@web.de> <20100304064723.GH16909@redhat.com> <4B8F6E12.8040707@web.de> <20100304083549.GI16909@redhat.com> <4B8F9B11.60804@siemens.com> <20100304120354.GK16909@redhat.com> <20100307063643.GN16909@redhat.com> <4B938481.70307@web.de> <4B93ADD2.1000405@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Avi Kivity , Marcelo Tosatti , "kvm@vger.kernel.org" , "qemu-devel@nongnu.org" To: Jan Kiszka Return-path: Received: from mx1.redhat.com ([209.132.183.28]:63565 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753137Ab0CGNuk (ORCPT ); Sun, 7 Mar 2010 08:50:40 -0500 Content-Disposition: inline In-Reply-To: <4B93ADD2.1000405@web.de> Sender: kvm-owner@vger.kernel.org List-ID: On Sun, Mar 07, 2010 at 02:44:50PM +0100, Jan Kiszka wrote: > Jan Kiszka wrote: > > Gleb Natapov wrote: > >> On Thu, Mar 04, 2010 at 02:03:54PM +0200, Gleb Natapov wrote: > >>>> BTW, do real systems allow to hot plug BSP as well? Or how is the case > >>>> handled when you unplug the BSP and then reboot the box? > >>>> > >>> Did you mean hot unplug BSP? OS determines what CPU is BSP by checking > >>> BSP bit in APIC base register. My guess is that there is some pin on CPU > >>> which value is mirrored as BSP bit in APIC base register. Board may have > >>> some logic to check what sockets are populated and chose one of them as > >>> BSP by pulling its pin up. But this is only guess. > >>> > >> Actually this is much more simple: > >> SDM 8.4.1: > >> The MP initialization protocol defines two classes of processors: the > >> bootstrap processor (BSP) and the application processors (APs). Following > >> a power-up or RESET of an MP system, system hardware dynamically selects > >> one of the processors on the system bus as the BSP. The remaining > >> processors are designated as APs. > >> And by "hardware" they mean CPUs themselves over apic BUS. > > > > That should be straightforward, will have a look. I just want to ensure > > that cpu_is_bsp delivers a valid result all the time. Otherwise we will > > run into ordering issues again once some new user of this services shows up. > > > > ...but you have to explain to me how CPU hotplugging in current qemu-kvm > is supposed to work. 'cpu_set n offline' does not have any visible > effect: Linux still allows to bring such a CPU online again, and it is > also brought up again after reset. Current BIOS does not support cpu hotplug/unplug. If after reset unplugged vcpu is brought up again then there is a bug there somewhere. > > Besides this, I would probably need some other OS to test offlining the > BSP - Linux does not appear to support it. > -- Gleb. From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NoGsV-0006Lg-3y for qemu-devel@nongnu.org; Sun, 07 Mar 2010 08:50:43 -0500 Received: from [199.232.76.173] (port=38106 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NoGsT-0006LN-Lb for qemu-devel@nongnu.org; Sun, 07 Mar 2010 08:50:41 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NoGsS-0005K2-0a for qemu-devel@nongnu.org; Sun, 07 Mar 2010 08:50:41 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51694) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NoGsR-0005Ju-Lz for qemu-devel@nongnu.org; Sun, 07 Mar 2010 08:50:39 -0500 Date: Sun, 7 Mar 2010 15:50:36 +0200 From: Gleb Natapov Message-ID: <20100307135036.GZ16909@redhat.com> References: <20100303160022.GG16909@redhat.com> <4B8EF1FE.7020000@web.de> <20100304064723.GH16909@redhat.com> <4B8F6E12.8040707@web.de> <20100304083549.GI16909@redhat.com> <4B8F9B11.60804@siemens.com> <20100304120354.GK16909@redhat.com> <20100307063643.GN16909@redhat.com> <4B938481.70307@web.de> <4B93ADD2.1000405@web.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4B93ADD2.1000405@web.de> Subject: [Qemu-devel] Re: [PATCH v4 03/10] x86: Extend validity of cpu_is_bsp List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: Marcelo Tosatti , Avi Kivity , "kvm@vger.kernel.org" , "qemu-devel@nongnu.org" On Sun, Mar 07, 2010 at 02:44:50PM +0100, Jan Kiszka wrote: > Jan Kiszka wrote: > > Gleb Natapov wrote: > >> On Thu, Mar 04, 2010 at 02:03:54PM +0200, Gleb Natapov wrote: > >>>> BTW, do real systems allow to hot plug BSP as well? Or how is the case > >>>> handled when you unplug the BSP and then reboot the box? > >>>> > >>> Did you mean hot unplug BSP? OS determines what CPU is BSP by checking > >>> BSP bit in APIC base register. My guess is that there is some pin on CPU > >>> which value is mirrored as BSP bit in APIC base register. Board may have > >>> some logic to check what sockets are populated and chose one of them as > >>> BSP by pulling its pin up. But this is only guess. > >>> > >> Actually this is much more simple: > >> SDM 8.4.1: > >> The MP initialization protocol defines two classes of processors: the > >> bootstrap processor (BSP) and the application processors (APs). Following > >> a power-up or RESET of an MP system, system hardware dynamically selects > >> one of the processors on the system bus as the BSP. The remaining > >> processors are designated as APs. > >> And by "hardware" they mean CPUs themselves over apic BUS. > > > > That should be straightforward, will have a look. I just want to ensure > > that cpu_is_bsp delivers a valid result all the time. Otherwise we will > > run into ordering issues again once some new user of this services shows up. > > > > ...but you have to explain to me how CPU hotplugging in current qemu-kvm > is supposed to work. 'cpu_set n offline' does not have any visible > effect: Linux still allows to bring such a CPU online again, and it is > also brought up again after reset. Current BIOS does not support cpu hotplug/unplug. If after reset unplugged vcpu is brought up again then there is a bug there somewhere. > > Besides this, I would probably need some other OS to test offlining the > BSP - Linux does not appear to support it. > -- Gleb.