From owner-p4-projects@FreeBSD.ORG Tue May 10 11:27:46 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B34A316A4D1; Tue, 10 May 2005 11:27:45 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6FC6716A4CE; Tue, 10 May 2005 11:27:45 +0000 (GMT) Received: from gw-kit.locore.ca (gw-kit.locore.ca [67.43.130.39]) by mx1.FreeBSD.org (Postfix) with ESMTP id 18B2F43D4C; Tue, 10 May 2005 11:27:45 +0000 (GMT) (envelope-from jake@locore.ca) Received: from [10.0.0.3] (ws.locore.ca [10.0.0.3]) by gw-kit.locore.ca (Postfix) with ESMTP id 58DCB163A66; Tue, 10 May 2005 07:27:44 -0400 (EDT) Message-ID: <42809AAF.5060904@locore.ca> Date: Tue, 10 May 2005 07:27:43 -0400 From: Jake Burkholder User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050424) X-Accept-Language: en-us, en MIME-Version: 1.0 To: John Baldwin References: <200504171042.j3HAgeTQ054345@repoman.freebsd.org> <87f1dd37c46f5e61c68035b9989ae5b7@FreeBSD.org> In-Reply-To: <87f1dd37c46f5e61c68035b9989ae5b7@FreeBSD.org> Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit cc: Perforce Change Reviews cc: David Xu Subject: Re: PERFORCE change 75366 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 May 2005 11:27:46 -0000 John Baldwin wrote: > > On Apr 17, 2005, at 6:42 AM, David Xu wrote: > >> http://perforce.freebsd.org/chv.cgi?CH=75366 >> >> Change 75366 by davidxu@davidxu_alona on 2005/04/17 10:42:05 >> >> Implement cpu_set_user_tls for sparc64. >> >> Affected files ... >> >> .. >> //depot/projects/davidxu_thread/src/sys/sparc64/sparc64/vm_machdep.c#6 >> edit >> >> Differences ... >> >> ==== >> //depot/projects/davidxu_thread/src/sys/sparc64/sparc64/vm_machdep.c#6 >> (text+ko) ==== >> >> @@ -194,6 +194,15 @@ >> td->td_retval[1] = tf->tf_out[1]; >> } >> >> +void >> +cpu_set_user_tls(struct thread *td, void *tls_base, size_t tls_size, >> + int tls_seg __unused) >> +{ >> + if (td == curthread) >> + flushw(); >> + td->td_frame->tf_global[7] = tls_base; >> +} >> + > > > I think for at least this one and Alpha you might want a critical > section in the curthread case like you do on i386 and amd64 since > calling the Alpha PAL and setting tls_base + flushw() are more than > one instruction long. > Just FWIW, you don't need a flushw when setting the global registers since they're not windowed and guaranteed to be reloaded on return to user mode. Jake