From owner-cvs-all@FreeBSD.ORG Wed Jul 30 17:47:57 2003 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E54AB37B401; Wed, 30 Jul 2003 17:47:56 -0700 (PDT) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id E4AD043F85; Wed, 30 Jul 2003 17:47:55 -0700 (PDT) (envelope-from gallatin@cs.duke.edu) Received: from grasshopper.cs.duke.edu (grasshopper.cs.duke.edu [152.3.145.30]) by duke.cs.duke.edu (8.12.9/8.12.9) with ESMTP id h6V0lsnq020081 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Wed, 30 Jul 2003 20:47:55 -0400 (EDT) Received: (from gallatin@localhost) by grasshopper.cs.duke.edu (8.11.6/8.9.1) id h6V0lnZ75953; Wed, 30 Jul 2003 20:47:49 -0400 (EDT) (envelope-from gallatin@cs.duke.edu) Date: Wed, 30 Jul 2003 20:47:49 -0400 From: Andrew Gallatin To: Marcel Moolenaar Message-ID: <20030730204749.A75933@grasshopper.cs.duke.edu> References: <20030724191943.GA1028@dhcp01.pn.xcllnt.net> <20030724232117.GA1913@dhcp01.pn.xcllnt.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20030724232117.GA1913@dhcp01.pn.xcllnt.net>; from marcel@xcllnt.net on Thu, Jul 24, 2003 at 04:21:17PM -0700 X-Operating-System: FreeBSD 4.4-RELEASE on an i386 cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org cc: John Baldwin Subject: Re: cvs commit: src/lib/libthr/arch/alpha/alpha _curthread.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jul 2003 00:47:57 -0000 Marcel Moolenaar [marcel@xcllnt.net] wrote: > On Thu, Jul 24, 2003 at 05:00:13PM -0400, John Baldwin wrote: > > > > There is a chicken and egg problem. We use the unique value to > > initialize the per-cpu pointer on kernel entry. We only have one > > such beast, and in the kernel we cache it in a register that userland > > gets to clobber (and frequently does). If you can think of a better > > way to store the per-cpu pointer such that kernel entry can load it > > into the register go for it. > > I see where the confusion is: > > > pcpup = (struct pcpu *) alpha_pal_rdval(); > ^^^^^^^^^^^^^^^^^^^^^^ > > This is not the per-CPU unique value. I had to add alpha_pal_rdunique() > in order to access it. In numbers: > > PAL_rdval = PAL_OSF1_rdval = 0x0032 > PAL_rdunique = 0x009e > > PAL_rdval is a privileged operation PAL_rdunique isn't. > > There is no fundamental problem (although my alpha does reboot > when I run a 1:1-threaded application, so there is a problem :-) > FWIW, if we need another way to get to pcpu, we can always use alpha_pal_whami() to index into an array of pre-allocated per-cpu structs. Drew