From owner-freebsd-threads@FreeBSD.ORG Sat May 31 23:13:45 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0974837B404 for ; Sat, 31 May 2003 23:13:45 -0700 (PDT) Received: from ns1.xcllnt.net (209-128-86-226.bayarea.net [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 89BDB43F85 for ; Sat, 31 May 2003 23:13:43 -0700 (PDT) (envelope-from marcel@xcllnt.net) Received: from dhcp01.pn.xcllnt.net (dhcp01.pn.xcllnt.net [192.168.4.201]) by ns1.xcllnt.net (8.12.9/8.12.9) with ESMTP id h516Dhwk091145; Sat, 31 May 2003 23:13:43 -0700 (PDT) (envelope-from marcel@piii.pn.xcllnt.net) Received: from dhcp01.pn.xcllnt.net (localhost [127.0.0.1]) by dhcp01.pn.xcllnt.net (8.12.9/8.12.9) with ESMTP id h516Dgqu001124; Sat, 31 May 2003 23:13:42 -0700 (PDT) (envelope-from marcel@dhcp01.pn.xcllnt.net) Received: (from marcel@localhost) by dhcp01.pn.xcllnt.net (8.12.9/8.12.9/Submit) id h516Dgq7001123; Sat, 31 May 2003 23:13:42 -0700 (PDT) Date: Sat, 31 May 2003 23:13:42 -0700 From: Marcel Moolenaar To: Mike Makonnen Message-ID: <20030601061342.GA1075@dhcp01.pn.xcllnt.net> References: <20030531072259.GA2408@athlon.pn.xcllnt.net> <20030601034817.OXXJ20810.pop015.verizon.net@kokeb.ambesa.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030601034817.OXXJ20810.pop015.verizon.net@kokeb.ambesa.net> User-Agent: Mutt/1.5.4i cc: threads@freebsd.org Subject: Re: libthr: thr_create(2): no kernel stack? X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jun 2003 06:13:46 -0000 On Sat, May 31, 2003 at 11:48:15PM -0400, Mike Makonnen wrote: > On Sat, 31 May 2003 00:22:59 -0700 > > > > I'm porting libthr to ia64 and reached a point where I can actually > > do initial testing. I immediately hit upon a snafu in thr_create(2). > > The second bcopy (ie sys/kern/kern_thr.c:159) is panicing because > > the new thread (td0) does not have a frame (ie td_frame == NULL). > > Creating a frame is obviously the thing to do, but there's no kernel > > stack created for the new thread AFAICT. Without kernel thread. > > cpu_set_upcall() will also fail if we ever reach that point. > > > > Am I missing something here? > > I just took a look at this and it _did_ look funny, but it seems to work on i386 > so I did a little more digging and it seems that the stack frame is allocated in > the uma thread initialization routine thread_init(), which calls > cpu_thread_setup(). > This is currently undefined for ia64: ia64/ia64/vm_machdep.c: line 110 Ah, ok. Thanks. I got distracted by an ia64 specific hack in kern_thread.c. I just committed the removal of that hack. I too was in the process of figuring out why it worked on i386. You beat me to it ;-) Thanks. I'll commit an implementation shorty, -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net