From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932322AbWIKXDi (ORCPT ); Mon, 11 Sep 2006 19:03:38 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932326AbWIKXDh (ORCPT ); Mon, 11 Sep 2006 19:03:37 -0400 Received: from smtp.osdl.org ([65.172.181.4]:63621 "EHLO smtp.osdl.org") by vger.kernel.org with ESMTP id S932322AbWIKXDh (ORCPT ); Mon, 11 Sep 2006 19:03:37 -0400 Date: Mon, 11 Sep 2006 16:03:01 -0700 From: Andrew Morton To: Jeremy Fitzhardinge Cc: Andi Kleen , Ingo Molnar , Linux Kernel Mailing List Subject: Re: [PATCH] i386-pda: Initialize the PDA early, before any C code runs. Message-Id: <20060911160301.10789d6e.akpm@osdl.org> In-Reply-To: <4505E8C1.7010906@goop.org> References: <4505E8C1.7010906@goop.org> X-Mailer: Sylpheed version 2.2.7 (GTK+ 2.8.6; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 11 Sep 2006 15:52:49 -0700 Jeremy Fitzhardinge wrote: > Initialize the PDA early, before any C code runs. > > This patch makes sure the PDA is usable in head.S, before any C code > is run. > > On the boot CPU, this is done by using a temporary boot_pda which is > initialized appropriately. It is replaced with a proper PDA when the > proper GDT is installed. > > For secondary CPUs, the GDT and PDA are pre-allocated and initialized. > head.S just needs to set %gs and load the GDT. > > In the process, this removes the need for early_smp_processor_id() and > early_current(). > > ... > > +/* Initial PDA used by boot CPU */ > +struct i386_pda boot_pda = { > + ._pda = &boot_pda, > + .cpu_number = 0, > + .pcurrent = &init_task, > +}; What is likely to happen if the boot CPU is not CPU #0? (iirc Voyager does that?)