From owner-cvs-sys Tue Aug 12 08:49:30 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id IAA29812 for cvs-sys-outgoing; Tue, 12 Aug 1997 08:49:30 -0700 (PDT) Received: from Ilsa.StevesCafe.com (Ilsa.StevesCafe.com [205.168.119.129]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id IAA29806; Tue, 12 Aug 1997 08:49:22 -0700 (PDT) Received: from Ilsa.StevesCafe.com (localhost [127.0.0.1]) by Ilsa.StevesCafe.com (8.8.6/8.8.5) with ESMTP id JAA19349; Tue, 12 Aug 1997 09:49:12 -0600 (MDT) Message-Id: <199708121549.JAA19349@Ilsa.StevesCafe.com> X-Mailer: exmh version 2.0gamma 1/27/96 From: Steve Passe To: Michael Smith cc: cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG, cvs-sys@FreeBSD.ORG Subject: Re: cvs commit: src/sys/kern init_main.c In-reply-to: Your message of "Tue, 12 Aug 1997 14:21:15 +0930." <199708120451.OAA05899@genesis.atrad.adelaide.edu.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 12 Aug 1997 09:49:12 -0600 Sender: owner-cvs-sys@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Mike, > > Log: > > Fixes kern/3835: SMP kernel crash on enable "dumps on wd0" > > > > - SMP: set value of curproc in main(), before the SYSINIT stuff > > If I read this correctly, this means that nothing hung off a SYSINIT() > macro needs to worry about curproc being invalid, ie. one can > explicitly expect curproc to be useful for subsystem locking etc. at a > very early stage? no, its a hack to prevent code in configure() from panic()ing when trying to dereference (struct proc*)p->xxx thingies. there is code that does this early in the boot process that knows that curproc is incomplete and is careful to not use the missing parts. There is nothing SMP specific about this. The only reason its needed is that the UP kernel "sets" it at compile time via: struct proc* curproc = &proc0; However the SMP kernel keeps this in per-cpu private page data, and thus there is no compile time init. So I set it here to prevent the dereference panics. Any code that actually uses it this early better know what its doing. -- Steve Passe | powered by smp@csn.net | Symmetric MultiProcessor FreeBSD