From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:44657) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QEoQ8-0001bD-2h for qemu-devel@nongnu.org; Tue, 26 Apr 2011 15:59:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QEoQ7-0007fX-1j for qemu-devel@nongnu.org; Tue, 26 Apr 2011 15:59:39 -0400 Received: from mail-vx0-f173.google.com ([209.85.220.173]:52903) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QEoQ6-0007fT-UO for qemu-devel@nongnu.org; Tue, 26 Apr 2011 15:59:39 -0400 Received: by vxb41 with SMTP id 41so865662vxb.4 for ; Tue, 26 Apr 2011 12:59:38 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <4DB7151A.4000401@web.de> References: <4DB68768.3050700@siemens.com> <4DB7151A.4000401@web.de> From: Blue Swirl Date: Tue, 26 Apr 2011 22:59:18 +0300 Message-ID: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] target-i386: Initialize CPUState::halted in cpu_reset List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: qemu-devel On Tue, Apr 26, 2011 at 9:55 PM, Jan Kiszka wrote: > On 2011-04-26 20:00, Blue Swirl wrote: >> On Tue, Apr 26, 2011 at 11:50 AM, Jan Kiszka wr= ote: >>> Instead of having an extra reset function at machine level and special >>> code for processing INIT, move the initialization of halted into the >>> cpu reset handler. >> >> Nack. A CPU is designated as a BSP at board level. CPUs do not need to >> know about this at all. > > That's why we have cpu_is_bsp() in pc.c. > > Obviously, every CPU (which includes the APIC) must know if it is > supposed to be BP or AP. It would be unable to enter the right state > after reset otherwise (e.g. Intel SDM 9.1). cpu_is_bsp() is basically > reporting the result of the MP init protocol in condensed from. Intel 64 and IA-32 Architectures Software Developer=E2=80=99s Manual vol 3A= , 7.5.1 says that the protocol result is stored in APIC MSR. I think we should be using that instead. For example, the board could call cpu_designate_bsp() to set the BSP flag in MSR. Then cpu_is_bsp() would only check the MSR, which naturally belongs to the CPU/APIC domain.