From owner-freebsd-ia64 Sun Oct 7 7:16:49 2001 Delivered-To: freebsd-ia64@freebsd.org Received: from anchor-post-33.mail.demon.net (anchor-post-33.mail.demon.net [194.217.242.91]) by hub.freebsd.org (Postfix) with ESMTP id CD26537B403 for ; Sun, 7 Oct 2001 07:16:46 -0700 (PDT) Received: from [62.49.251.130] (helo=herring.nlsystems.com) by anchor-post-33.mail.demon.net with esmtp (Exim 2.12 #1) id 15qEjV-000DY6-0X; Sun, 7 Oct 2001 15:16:45 +0100 Received: from salmon.nlsystems.com (salmon [10.0.0.3]) by herring.nlsystems.com (8.11.2/8.11.2) with ESMTP id f97EFT764215; Sun, 7 Oct 2001 15:15:29 +0100 (BST) (envelope-from dfr@nlsystems.com) Date: Sun, 7 Oct 2001 15:14:06 +0100 (BST) From: Doug Rabson To: "Kenneth D. Merry" Cc: Subject: Re: how much memory does the ia64 port support? In-Reply-To: <20011006173427.A7880@panzer.kdm.org> Message-ID: <20011007151129.A530-100000@salmon.nlsystems.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-ia64@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Sat, 6 Oct 2001, Kenneth D. Merry wrote: > > Just out of curiosity, how much memory does the ia64 port support? I don't think there is a hard limit, although we should really scale the size of the VHPT based on the amount of physical memory. At the moment, we use a fixed-size 32k VHPT which is probably too small. Right now, using more than 4GB would be a problem for some drivers. I think the busdma code should be able to bounce-buffer things for 32bit PCI DMA but not all drivers use busdma. -- Doug Rabson Mail: dfr@nlsystems.com Phone: +44 20 8348 6160 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ia64" in the body of the message From owner-freebsd-ia64 Sun Oct 7 7:20:18 2001 Delivered-To: freebsd-ia64@freebsd.org Received: from finch-post-10.mail.demon.net (finch-post-10.mail.demon.net [194.217.242.38]) by hub.freebsd.org (Postfix) with ESMTP id 8653237B406 for ; Sun, 7 Oct 2001 07:20:04 -0700 (PDT) Received: from [62.49.251.130] (helo=herring.nlsystems.com) by finch-post-10.mail.demon.net with esmtp (Exim 2.12 #1) id 15qEmd-00018Z-0A; Sun, 7 Oct 2001 14:19:59 +0000 Received: from salmon.nlsystems.com (salmon [10.0.0.3]) by herring.nlsystems.com (8.11.2/8.11.2) with ESMTP id f97EIh764267; Sun, 7 Oct 2001 15:18:43 +0100 (BST) (envelope-from dfr@nlsystems.com) Date: Sun, 7 Oct 2001 15:17:20 +0100 (BST) From: Doug Rabson To: Peter Wemm Cc: Subject: Re: dependency violations... In-Reply-To: <20011007022028.B99F43808@overcee.netplex.com.au> Message-ID: <20011007151608.M530-100000@salmon.nlsystems.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-ia64@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Sat, 6 Oct 2001, Peter Wemm wrote: > In the current kernel, with a later compiler and toolchain: > > ia64-unknown-linux-gcc -D__FreeBSD__ -U__linux__ -c -O -pipe -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -g -nostdinc -I- -I. -I../../.. -I../../../dev -I../../../contrib/dev/acpica -I../../../contrib/ipfilter -I../../../../include -D_KERNEL -include opt_global.h -ffixed-r13 -mfixed-range=f32-f127 ../../../ia64/ia64/machdep.c > In file included from ../../../ia64/ia64/machdep.c:77: > ../../../alpha/alpha/db_instruction.h:175:9: warning: extra tokens at end of #endif directive What the hell is that doing there :-) > In file included from machine/efi.h:37, > from ../../../ia64/ia64/machdep.c:81: > ../../../boot/efi/include/efiapi.h:528: warning: function declaration isn't a prototype > ../../../ia64/ia64/machdep.c: In function `identifycpu': > ../../../ia64/ia64/machdep.c:397: warning: unknown conversion type character `b' in format > ../../../ia64/ia64/machdep.c:397: warning: too many arguments for format > ../../../ia64/ia64/machdep.c: At top level: > ../../../ia64/ia64/machdep.c:827: warning: `bzero' was used with no prototype before its definition > {standard input}: Assembler messages: > {standard input}:1079: Warning: Use of 'br.ret.sptk.many' violates RAW dependency 'PSR.tb' (data) > {standard input}:1079: Warning: Only the first path encountering the conflict is reported > {standard input}:1072: Warning: This is the location of the conflicting usage > {standard input}:1079: Warning: Use of 'br.ret.sptk.many' violates RAW dependency 'PSR.lp' (data) > {standard input}:1079: Warning: Only the first path encountering the conflict is reported > {standard input}:1072: Warning: This is the location of the conflicting usage > ../../../sys/libkern.h:102: warning: `memset' defined but not used Hmm. I would need to see the assembler that gcc generated. Are these to do with the various bits of inline assembler? -- Doug Rabson Mail: dfr@nlsystems.com Phone: +44 20 8348 6160 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ia64" in the body of the message From owner-freebsd-ia64 Sun Oct 7 9:18:30 2001 Delivered-To: freebsd-ia64@freebsd.org Received: from finch-post-10.mail.demon.net (finch-post-10.mail.demon.net [194.217.242.38]) by hub.freebsd.org (Postfix) with ESMTP id 26B1037B407 for ; Sun, 7 Oct 2001 09:18:27 -0700 (PDT) Received: from [62.49.251.130] (helo=herring.nlsystems.com) by finch-post-10.mail.demon.net with esmtp (Exim 2.12 #1) id 15qGdG-000L6U-0A for ia64@freebsd.org; Sun, 7 Oct 2001 16:18:26 +0000 Received: from salmon.nlsystems.com (salmon [10.0.0.3]) by herring.nlsystems.com (8.11.2/8.11.2) with ESMTP id f97GHA765290 for ; Sun, 7 Oct 2001 17:17:10 +0100 (BST) (envelope-from dfr@nlsystems.com) Date: Sun, 7 Oct 2001 17:15:46 +0100 (BST) From: Doug Rabson To: Subject: Things to do Message-ID: <20011007170619.C530-100000@salmon.nlsystems.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-ia64@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org A random list of things which need doing: DDB 'n' command Remote GDB support link_elf backend rtld-elf FPSWA support Workaround ar.itc errata Figure out why loader.rc hangs the loader Use AllocatePages in copy.c to make sure we don't step on EFI Resize VHPT based on physical memory Unaligned fault handler ia32 emulation Write pipelined bcopy/memcpy Write inline ntohl etc. Make sure that busdma works on >4GB machines Make all drivers use busdma ISA dma New toolchain Rewrite db_trace.c to use unwind records Thats all I can think of for now. There are probably lots more. -- Doug Rabson Mail: dfr@nlsystems.com Phone: +44 20 8348 6160 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ia64" in the body of the message From owner-freebsd-ia64 Sun Oct 7 9:28:51 2001 Delivered-To: freebsd-ia64@freebsd.org Received: from mail12.speakeasy.net (mail12.speakeasy.net [216.254.0.212]) by hub.freebsd.org (Postfix) with ESMTP id D1E0837B407 for ; Sun, 7 Oct 2001 09:28:45 -0700 (PDT) Received: (qmail 79303 invoked from network); 7 Oct 2001 16:28:45 -0000 Received: from unknown (HELO laptop.baldwin.cx) ([64.81.54.73]) (envelope-sender ) by mail12.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 7 Oct 2001 16:28:45 -0000 Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20011005193722.X530-100000@salmon.nlsystems.com> Date: Sun, 07 Oct 2001 09:28:17 -0700 (PDT) From: John Baldwin To: Doug Rabson Subject: RE: Woohoo! Cc: ia64@freebsd.org Sender: owner-freebsd-ia64@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On 05-Oct-01 Doug Rabson wrote: > Single-user mode on real hardware. The root filesystem is mounted over > NFS. I think I'll go and buy a bottle of wine now :-) You rule. :) -- John Baldwin -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.baldwin.cx/~john/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ia64" in the body of the message From owner-freebsd-ia64 Sun Oct 7 11:13:43 2001 Delivered-To: freebsd-ia64@freebsd.org Received: from anchor-post-33.mail.demon.net (anchor-post-33.mail.demon.net [194.217.242.91]) by hub.freebsd.org (Postfix) with ESMTP id 1968237B401 for ; Sun, 7 Oct 2001 11:13:40 -0700 (PDT) Received: from [62.49.251.130] (helo=herring.nlsystems.com) by anchor-post-33.mail.demon.net with esmtp (Exim 2.12 #1) id 15qIQl-0009UV-0X for ia64@freebsd.org; Sun, 7 Oct 2001 19:13:39 +0100 Received: from salmon.nlsystems.com (salmon [10.0.0.3]) by herring.nlsystems.com (8.11.2/8.11.2) with ESMTP id f97ICN766616 for ; Sun, 7 Oct 2001 19:12:23 +0100 (BST) (envelope-from dfr@nlsystems.com) Date: Sun, 7 Oct 2001 19:10:59 +0100 (BST) From: Doug Rabson To: Subject: Re: Things to do In-Reply-To: <20011007170619.C530-100000@salmon.nlsystems.com> Message-ID: <20011007191004.I530-100000@salmon.nlsystems.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-ia64@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Sun, 7 Oct 2001, Doug Rabson wrote: > A random list of things which need doing: > > DDB 'n' command > Remote GDB support > link_elf backend > rtld-elf > FPSWA support > Workaround ar.itc errata > Figure out why loader.rc hangs the loader > Use AllocatePages in copy.c to make sure we don't step on EFI > Resize VHPT based on physical memory > Unaligned fault handler > ia32 emulation > Write pipelined bcopy/memcpy > Write inline ntohl etc. > Make sure that busdma works on >4GB machines > Make all drivers use busdma > ISA dma > New toolchain > Rewrite db_trace.c to use unwind records > > Thats all I can think of for now. There are probably lots more. Add ptrace support to that list. I think ia64 gdb adds some extra ptrace calls for playing silly games with the register stack. -- Doug Rabson Mail: dfr@nlsystems.com Phone: +44 20 8348 6160 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ia64" in the body of the message From owner-freebsd-ia64 Sun Oct 7 14:41: 9 2001 Delivered-To: freebsd-ia64@freebsd.org Received: from peter3.wemm.org (c1315225-a.plstn1.sfba.home.com [24.14.150.180]) by hub.freebsd.org (Postfix) with ESMTP id 7B55537B405 for ; Sun, 7 Oct 2001 14:41:05 -0700 (PDT) Received: from overcee.netplex.com.au (overcee.wemm.org [10.0.0.3]) by peter3.wemm.org (8.11.0/8.11.0) with ESMTP id f97Lf4M70710 for ; Sun, 7 Oct 2001 14:41:04 -0700 (PDT) (envelope-from peter@wemm.org) Received: from wemm.org (localhost [127.0.0.1]) by overcee.netplex.com.au (Postfix) with ESMTP id C922D3809; Sun, 7 Oct 2001 14:41:04 -0700 (PDT) (envelope-from peter@wemm.org) X-Mailer: exmh version 2.3.1 01/18/2001 with nmh-1.0.4 To: Doug Rabson Cc: ia64@FreeBSD.ORG Subject: Re: Things to do In-Reply-To: <20011007191004.I530-100000@salmon.nlsystems.com> Date: Sun, 07 Oct 2001 14:41:04 -0700 From: Peter Wemm Message-Id: <20011007214104.C922D3809@overcee.netplex.com.au> Sender: owner-freebsd-ia64@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Doug Rabson wrote: > On Sun, 7 Oct 2001, Doug Rabson wrote: > > > A random list of things which need doing: > > > > DDB 'n' command > > Remote GDB support > > link_elf backend > > rtld-elf > > FPSWA support > > Workaround ar.itc errata > > Figure out why loader.rc hangs the loader > > Use AllocatePages in copy.c to make sure we don't step on EFI > > Resize VHPT based on physical memory > > Unaligned fault handler > > ia32 emulation > > Write pipelined bcopy/memcpy > > Write inline ntohl etc. > > Make sure that busdma works on >4GB machines > > Make all drivers use busdma > > ISA dma > > New toolchain > > Rewrite db_trace.c to use unwind records > > > > Thats all I can think of for now. There are probably lots more. > > Add ptrace support to that list. I think ia64 gdb adds some extra ptrace > calls for playing silly games with the register stack. Userland floating point doesn't seem happy. Things get exceptions and other strange messages: %ps -aux USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND ^C BUG: process flushed twice% % %df Filesystem 512-blocks Used Avail Capacity Mounted on pid 51 (df), uid 0: exited on signal 8 (core dumped) Floating exception (core dumped) If userland has a dependency violation, it seems to fatal trap the kernel. (or it used to, the old init and sh certainly did it) Cheers, -Peter -- Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au "All of this is for nothing if we don't go to the stars" - JMS/B5 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ia64" in the body of the message From owner-freebsd-ia64 Sun Oct 7 14:52:17 2001 Delivered-To: freebsd-ia64@freebsd.org Received: from kayak.xcllnt.net (209-128-86-226.bayarea.net [209.128.86.226]) by hub.freebsd.org (Postfix) with ESMTP id 80C3837B405 for ; Sun, 7 Oct 2001 14:52:15 -0700 (PDT) Received: from athlon.pn.xcllnt.net (athlon.pn.xcllnt.net [192.168.4.3]) by kayak.xcllnt.net (8.11.4/8.11.4) with ESMTP id f97LqFI71912; Sun, 7 Oct 2001 14:52:15 -0700 (PDT) (envelope-from marcel@kayak.pn.xcllnt.net) Received: (from marcel@localhost) by athlon.pn.xcllnt.net (8.11.6/8.11.5) id f97LqEQ01222; Sun, 7 Oct 2001 14:52:14 -0700 (PDT) (envelope-from marcel) Date: Sun, 7 Oct 2001 14:52:14 -0700 From: Marcel Moolenaar To: Paul Saab Cc: "Kenneth D. Merry" , freebsd-ia64@FreeBSD.ORG Subject: Re: how much memory does the ia64 port support? Message-ID: <20011007145214.D380@athlon.pn.xcllnt.net> References: <20011006173427.A7880@panzer.kdm.org> <20011006170135.A78250@elvis.mu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20011006170135.A78250@elvis.mu.org> User-Agent: Mutt/1.3.21i Sender: owner-freebsd-ia64@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Sat, Oct 06, 2001 at 05:01:35PM -0700, Paul Saab wrote: > Kenneth D. Merry (ken@kdm.org) wrote: > > > > Just out of curiosity, how much memory does the ia64 port support? > > We all have machines with 1GB of ram right now. I have asked to get > atleast one (hopefully all) machine which > 4GB for testing. The A1 stepping I have @HP has 2GB. I'll try booting on that machine tomorrow. -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ia64" in the body of the message From owner-freebsd-ia64 Sun Oct 7 14:59:51 2001 Delivered-To: freebsd-ia64@freebsd.org Received: from kayak.xcllnt.net (209-128-86-226.bayarea.net [209.128.86.226]) by hub.freebsd.org (Postfix) with ESMTP id CD32A37B405; Sun, 7 Oct 2001 14:59:48 -0700 (PDT) Received: from athlon.pn.xcllnt.net (athlon.pn.xcllnt.net [192.168.4.3]) by kayak.xcllnt.net (8.11.4/8.11.4) with ESMTP id f97LxmI71924; Sun, 7 Oct 2001 14:59:48 -0700 (PDT) (envelope-from marcel@kayak.pn.xcllnt.net) Received: (from marcel@localhost) by athlon.pn.xcllnt.net (8.11.6/8.11.5) id f97Lxm401273; Sun, 7 Oct 2001 14:59:48 -0700 (PDT) (envelope-from marcel) Date: Sun, 7 Oct 2001 14:59:48 -0700 From: Marcel Moolenaar To: Mike Smith Cc: Paul Saab , "Kenneth D. Merry" , freebsd-ia64@FreeBSD.ORG Subject: Re: how much memory does the ia64 port support? Message-ID: <20011007145948.E380@athlon.pn.xcllnt.net> References: <20011006170955.B78250@elvis.mu.org> <200110070434.f974Y4X05778@mass.dis.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200110070434.f974Y4X05778@mass.dis.org> User-Agent: Mutt/1.3.21i Sender: owner-freebsd-ia64@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Sat, Oct 06, 2001 at 09:34:04PM -0700, Mike Smith wrote: > > I dont remember the exact name of them, but they are Intel workstation > > machines which Intel gave to developers during the initial development > > of the ia64. Intel has donated 3 of these so far and there is one more > > on the way which we'll put up in the cluster once its stable enough. > > I think this is the machine referred to as the "Lion", but I may be > mistaken. The ones Intel gives out are mostly "BigSur" machines. The A1 I can use is a "Lion". I should be able to get the exact differences if someone is interested. At this time I simply don't know the details. I think the following holds (correct me if I'm wrong): o The Lion is 19" rack-mounted; BigSurs are desktops that are too big and heavy for normal desktops :-) o BigSurs are 2-way max; Lions can be 4-way max. There's probably a frontside bus or cache difference as well, but I have to check that. -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ia64" in the body of the message From owner-freebsd-ia64 Sun Oct 7 15: 9:12 2001 Delivered-To: freebsd-ia64@freebsd.org Received: from kayak.xcllnt.net (209-128-86-226.bayarea.net [209.128.86.226]) by hub.freebsd.org (Postfix) with ESMTP id AB17837B409 for ; Sun, 7 Oct 2001 15:09:09 -0700 (PDT) Received: from athlon.pn.xcllnt.net (athlon.pn.xcllnt.net [192.168.4.3]) by kayak.xcllnt.net (8.11.4/8.11.4) with ESMTP id f97M99I71949; Sun, 7 Oct 2001 15:09:09 -0700 (PDT) (envelope-from marcel@kayak.pn.xcllnt.net) Received: (from marcel@localhost) by athlon.pn.xcllnt.net (8.11.6/8.11.5) id f97M98O01331; Sun, 7 Oct 2001 15:09:08 -0700 (PDT) (envelope-from marcel) Date: Sun, 7 Oct 2001 15:09:08 -0700 From: Marcel Moolenaar To: Peter Wemm Cc: ia64@FreeBSD.ORG Subject: Re: dependency violations... Message-ID: <20011007150908.F380@athlon.pn.xcllnt.net> References: <20011007022028.B99F43808@overcee.netplex.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20011007022028.B99F43808@overcee.netplex.com.au> User-Agent: Mutt/1.3.21i Sender: owner-freebsd-ia64@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Sat, Oct 06, 2001 at 07:20:28PM -0700, Peter Wemm wrote: > In the current kernel, with a later compiler and toolchain: I've been running around in circles yesterday trying to figure out why I couldn't boot to SU mode. Upgrading the toolchain resolved it. While running I thought about dependency violations. It's known that the GNU assembler doesn't catch all of them and I know that many people have been bitten by it. I'm thinking of writing a standalone hazard checker based on Intel's DVLoc library or otherwise implement hazard checking myself. There's an advantage for HP if I implement it myself. I have to resolve the details as to what works best for everybody (provided I can combine all the advantages), but I definitely want to have aggressive post compile or post link hazard checking. > {standard input}:1079: Warning: Use of 'br.ret.sptk.many' violates RAW dependency 'PSR.tb' (data) > {standard input}:1079: Warning: Only the first path encountering the conflict is reported > {standard input}:1072: Warning: This is the location of the conflicting usage > {standard input}:1079: Warning: Use of 'br.ret.sptk.many' violates RAW dependency 'PSR.lp' (data) > {standard input}:1079: Warning: Only the first path encountering the conflict is reported > {standard input}:1072: Warning: This is the location of the conflicting usage I doubt these are real hazards. I'll see if I have the same and verify them... -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ia64" in the body of the message From owner-freebsd-ia64 Mon Oct 8 0:50:59 2001 Delivered-To: freebsd-ia64@freebsd.org Received: from anchor-post-33.mail.demon.net (anchor-post-33.mail.demon.net [194.217.242.91]) by hub.freebsd.org (Postfix) with ESMTP id B8F3D37B403 for ; Mon, 8 Oct 2001 00:50:56 -0700 (PDT) Received: from [62.49.251.130] (helo=herring.nlsystems.com) by anchor-post-33.mail.demon.net with esmtp (Exim 2.12 #1) id 15qVBb-000HFJ-0X; Mon, 8 Oct 2001 08:50:51 +0100 Received: from salmon.nlsystems.com (salmon [10.0.0.3]) by herring.nlsystems.com (8.11.2/8.11.2) with ESMTP id f987nZ714196; Mon, 8 Oct 2001 08:49:35 +0100 (BST) (envelope-from dfr@nlsystems.com) Date: Mon, 8 Oct 2001 08:48:10 +0100 (BST) From: Doug Rabson To: Peter Wemm Cc: Subject: Re: Things to do In-Reply-To: <20011007214104.C922D3809@overcee.netplex.com.au> Message-ID: <20011008084648.J530-100000@salmon.nlsystems.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-ia64@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Sun, 7 Oct 2001, Peter Wemm wrote: > > Add ptrace support to that list. I think ia64 gdb adds some extra ptrace > > calls for playing silly games with the register stack. > > Userland floating point doesn't seem happy. Things get exceptions and > other strange messages: > > %ps -aux > USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND > ^C > BUG: process flushed twice% > % > %df > Filesystem 512-blocks Used Avail Capacity Mounted on > pid 51 (df), uid 0: exited on signal 8 (core dumped) > Floating exception (core dumped) > > If userland has a dependency violation, it seems to fatal trap the kernel. > (or it used to, the old init and sh certainly did it) The df problem was a broken strtod. I suggest that you rebuild things with a fresh libc. I'm going to upload a new set of binaries RSN. -- Doug Rabson Mail: dfr@nlsystems.com Phone: +44 20 8348 6160 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ia64" in the body of the message From owner-freebsd-ia64 Mon Oct 8 3: 4:43 2001 Delivered-To: freebsd-ia64@freebsd.org Received: from anchor-post-30.mail.demon.net (anchor-post-30.mail.demon.net [194.217.242.88]) by hub.freebsd.org (Postfix) with ESMTP id 2940337B405 for ; Mon, 8 Oct 2001 03:04:39 -0700 (PDT) Received: from [62.49.251.130] (helo=herring.nlsystems.com) by anchor-post-30.mail.demon.net with esmtp (Exim 2.12 #1) id 15qXH3-000Pmd-0U for ia64@freebsd.org; Mon, 8 Oct 2001 11:04:37 +0100 Received: from herring (herring [10.0.0.2]) by herring.nlsystems.com (8.11.2/8.11.2) with ESMTP id f98A3L735170 for ; Mon, 8 Oct 2001 11:03:21 +0100 (BST) (envelope-from dfr@nlsystems.com) Date: Mon, 8 Oct 2001 11:03:21 +0100 (BST) From: Doug Rabson To: Subject: New binaries ... Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-ia64@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org at http://people.freebsd.org/~dfr/ia64-root-08102001.tar.gz I rebuilt /sbin and /bin after fixing strtod and lots of things are much happier now. This set includes a nearly complete set of includes and libs which should replace the ones in your toolchains. There is also a scattering of useful /usr/bin bits like more, vi and tar. -- Doug Rabson Mail: dfr@nlsystems.com Phone: +44 20 8348 6160 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ia64" in the body of the message From owner-freebsd-ia64 Mon Oct 8 12:59:56 2001 Delivered-To: freebsd-ia64@freebsd.org Received: from palrel11.hp.com (palrel11.hp.com [156.153.255.246]) by hub.freebsd.org (Postfix) with ESMTP id 8EBCC37B405 for ; Mon, 8 Oct 2001 12:59:53 -0700 (PDT) Received: from adlmail.cup.hp.com (adlmail.cup.hp.com [15.0.100.30]) by palrel11.hp.com (Postfix) with ESMTP id 4BA871F7C6 for ; Mon, 8 Oct 2001 12:59:48 -0700 (PDT) Received: from dhcp42d165.cup.hp.com (dhcp42d165.cup.hp.com [15.28.101.115]) by adlmail.cup.hp.com (8.9.3 (PHNE_18546)/8.9.3 SMKit7.02) with ESMTP id MAA21256 for ; Mon, 8 Oct 2001 12:59:38 -0700 (PDT) Received: (from marcel@localhost) by dhcp42d165.cup.hp.com (8.11.6/8.11.3) id f98JxAd05267 for ia64@freebsd.org; Mon, 8 Oct 2001 12:59:10 -0700 (PDT) (envelope-from marcel) Date: Mon, 8 Oct 2001 12:59:09 -0700 From: Marcel Moolenaar To: ia64@freebsd.org Subject: JFYI: Lion A1 boot failed Message-ID: <20011008125909.A5214@dhcp42d165.cup.hp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.21i Sender: owner-freebsd-ia64@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Entering /kernel at 0xe00000000050a000... PAL Proc at 0xe00000007ff48010 SAL Proc at 0xe00000007fef1080, GP at 0xe00000007ff299c0 Platform clock frequency 99999200 Hz Processor ratio 10/2, Bus ratio 1/1, ITC ratio 10/2 ptc.e base=0x0, count1=1, count2=1, stride1=0x0, stride2=0x0 ACPI debug layer 0x0 debug level 0x0 Copyright (c) 1992-2001 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD 5.0-CURRENT #12: Mon Oct 8 12:11:37 PDT 2001 marcel@dhcp42d165.cup.hp.com:/usr/src/sys/ia64/compile/HPADL696 panic: get_pv_entry: called too many times before pmap_init is finished panic Stopped at 0xe0000000008f7a41: mov sp=r33 db> I'll keep track of this on the sideline. Since the machine is an A1 stepping, we shouldn't spend too much time on it. I do expect better results than this though. Especially since I don't probe/attach the USB controller (one of the many workarounds in Linux for the A1). FYI, -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ia64" in the body of the message From owner-freebsd-ia64 Mon Oct 8 13:14:26 2001 Delivered-To: freebsd-ia64@freebsd.org Received: from finch-post-10.mail.demon.net (finch-post-10.mail.demon.net [194.217.242.38]) by hub.freebsd.org (Postfix) with ESMTP id B68BD37B409 for ; Mon, 8 Oct 2001 13:14:22 -0700 (PDT) Received: from [62.49.251.130] (helo=herring.nlsystems.com) by finch-post-10.mail.demon.net with esmtp (Exim 2.12 #1) id 15qgn7-00011U-0A for ia64@freebsd.org; Mon, 8 Oct 2001 20:14:21 +0000 Received: from salmon.nlsystems.com (salmon [10.0.0.3]) by herring.nlsystems.com (8.11.2/8.11.2) with ESMTP id f98KD5746254 for ; Mon, 8 Oct 2001 21:13:05 +0100 (BST) (envelope-from dfr@nlsystems.com) Date: Mon, 8 Oct 2001 21:11:39 +0100 (BST) From: Doug Rabson To: Subject: Program startup Message-ID: <20011008210708.C530-100000@salmon.nlsystems.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-ia64@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org I'm thinking of changing the way setregs() passes arguments to the program being execed. Currently, sp points at &argc and r14 contains ps_strings (which is ignored). I figured out how to create an initial register frame for the new process so that we don't need as much assembler hackery in crt1.c. Unfortunately this means that I need to change sp so that it is 16byte aligned and includes a 16 byte scratch area. This will break *all* existing binaries. I'll make a new set of binaries available when I commit the change. -- Doug Rabson Mail: dfr@nlsystems.com Phone: +44 20 8348 6160 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ia64" in the body of the message From owner-freebsd-ia64 Mon Oct 8 13:28: 7 2001 Delivered-To: freebsd-ia64@freebsd.org Received: from finch-post-10.mail.demon.net (finch-post-10.mail.demon.net [194.217.242.38]) by hub.freebsd.org (Postfix) with ESMTP id 5C6E737B409 for ; Mon, 8 Oct 2001 13:28:04 -0700 (PDT) Received: from [62.49.251.130] (helo=herring.nlsystems.com) by finch-post-10.mail.demon.net with esmtp (Exim 2.12 #1) id 15qh0N-00034c-0A; Mon, 8 Oct 2001 20:28:03 +0000 Received: from salmon.nlsystems.com (salmon [10.0.0.3]) by herring.nlsystems.com (8.11.2/8.11.2) with ESMTP id f98KQi748317; Mon, 8 Oct 2001 21:26:44 +0100 (BST) (envelope-from dfr@nlsystems.com) Date: Mon, 8 Oct 2001 21:25:18 +0100 (BST) From: Doug Rabson To: Marcel Moolenaar Cc: Subject: Re: JFYI: Lion A1 boot failed In-Reply-To: <20011008125909.A5214@dhcp42d165.cup.hp.com> Message-ID: <20011008212407.R530-100000@salmon.nlsystems.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-ia64@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Mon, 8 Oct 2001, Marcel Moolenaar wrote: > Entering /kernel at 0xe00000000050a000... > PAL Proc at 0xe00000007ff48010 > SAL Proc at 0xe00000007fef1080, GP at 0xe00000007ff299c0 > Platform clock frequency 99999200 Hz > Processor ratio 10/2, Bus ratio 1/1, ITC ratio 10/2 > ptc.e base=0x0, count1=1, count2=1, stride1=0x0, stride2=0x0 > ACPI debug layer 0x0 debug level 0x0 > Copyright (c) 1992-2001 The FreeBSD Project. > Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 > The Regents of the University of California. All rights reserved. > FreeBSD 5.0-CURRENT #12: Mon Oct 8 12:11:37 PDT 2001 > marcel@dhcp42d165.cup.hp.com:/usr/src/sys/ia64/compile/HPADL696 > panic: get_pv_entry: called too many times before pmap_init is finished > panic > Stopped at 0xe0000000008f7a41: mov sp=r33 > db> > > I'll keep track of this on the sideline. Since the machine is an A1 > stepping, we shouldn't spend too much time on it. I do expect better > results than this though. Especially since I don't probe/attach the > USB controller (one of the many workarounds in Linux for the A1). Try increasing the value of PV_BOOTSTRAP_NEEDED in get_pv_entry(). I really need to think of a better way of handling that. -- Doug Rabson Mail: dfr@nlsystems.com Phone: +44 20 8348 6160 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ia64" in the body of the message From owner-freebsd-ia64 Mon Oct 8 17: 8:57 2001 Delivered-To: freebsd-ia64@freebsd.org Received: from dragon.nuxi.com (trang.nuxi.com [66.92.13.169]) by hub.freebsd.org (Postfix) with ESMTP id 43DF937B40A for ; Mon, 8 Oct 2001 17:08:55 -0700 (PDT) Received: (from obrien@localhost) by dragon.nuxi.com (8.11.6/8.11.1) id f9908pA44766; Mon, 8 Oct 2001 17:08:51 -0700 (PDT) (envelope-from obrien) Date: Mon, 8 Oct 2001 17:08:51 -0700 From: "David O'Brien" To: Doug Rabson Cc: ia64@freebsd.org Subject: Re: Things to do Message-ID: <20011008170851.C43343@dragon.nuxi.com> Reply-To: obrien@freebsd.org References: <20011007170619.C530-100000@salmon.nlsystems.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20011007170619.C530-100000@salmon.nlsystems.com>; from dfr@nlsystems.com on Sun, Oct 07, 2001 at 05:15:46PM +0100 X-Operating-System: FreeBSD 5.0-CURRENT Organization: The NUXI BSD group X-Pgp-Rsa-Fingerprint: B7 4D 3E E9 11 39 5F A3 90 76 5D 69 58 D9 98 7A X-Pgp-Rsa-Keyid: 1024/34F9F9D5 Sender: owner-freebsd-ia64@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Sun, Oct 07, 2001 at 05:15:46PM +0100, Doug Rabson wrote: > A random list of things which need doing: > New toolchain I don't recall, how did the real FreeBSD 2.11.2 Binutils I sent you work out? Later this week I can commit the tweaks for IA64 into the CVS repo. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ia64" in the body of the message From owner-freebsd-ia64 Mon Oct 8 17:21:30 2001 Delivered-To: freebsd-ia64@freebsd.org Received: from palrel2.hp.com (palrel2.hp.com [156.153.255.234]) by hub.freebsd.org (Postfix) with ESMTP id CEE3937B403 for ; Mon, 8 Oct 2001 17:21:27 -0700 (PDT) Received: from adlmail.cup.hp.com (adlmail.cup.hp.com [15.0.100.30]) by palrel2.hp.com (Postfix) with ESMTP id A05A1CA5; Mon, 8 Oct 2001 17:21:27 -0700 (PDT) Received: from dhcp42d165.cup.hp.com (dhcp42d165.cup.hp.com [15.28.101.115]) by adlmail.cup.hp.com (8.9.3 (PHNE_18546)/8.9.3 SMKit7.02) with ESMTP id RAA29616; Mon, 8 Oct 2001 17:21:27 -0700 (PDT) Received: (from marcel@localhost) by dhcp42d165.cup.hp.com (8.11.6/8.11.3) id f990L3d00670; Mon, 8 Oct 2001 17:21:03 -0700 (PDT) (envelope-from marcel) Date: Mon, 8 Oct 2001 17:21:03 -0700 From: Marcel Moolenaar To: Doug Rabson Cc: ia64@freebsd.org Subject: Re: JFYI: Lion A1 boot failed Message-ID: <20011008172103.A659@dhcp42d165.cup.hp.com> References: <20011008125909.A5214@dhcp42d165.cup.hp.com> <20011008212407.R530-100000@salmon.nlsystems.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20011008212407.R530-100000@salmon.nlsystems.com> User-Agent: Mutt/1.3.21i Sender: owner-freebsd-ia64@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Mon, Oct 08, 2001 at 09:25:18PM +0100, Doug Rabson wrote: > On Mon, 8 Oct 2001, Marcel Moolenaar wrote: > > > Entering /kernel at 0xe00000000050a000... > > PAL Proc at 0xe00000007ff48010 > > SAL Proc at 0xe00000007fef1080, GP at 0xe00000007ff299c0 > > Platform clock frequency 99999200 Hz > > Processor ratio 10/2, Bus ratio 1/1, ITC ratio 10/2 > > ptc.e base=0x0, count1=1, count2=1, stride1=0x0, stride2=0x0 > > ACPI debug layer 0x0 debug level 0x0 > > Copyright (c) 1992-2001 The FreeBSD Project. > > Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 > > The Regents of the University of California. All rights reserved. > > FreeBSD 5.0-CURRENT #12: Mon Oct 8 12:11:37 PDT 2001 > > marcel@dhcp42d165.cup.hp.com:/usr/src/sys/ia64/compile/HPADL696 > > panic: get_pv_entry: called too many times before pmap_init is finished > > panic > > Stopped at 0xe0000000008f7a41: mov sp=r33 > > db> > > > > I'll keep track of this on the sideline. Since the machine is an A1 > > stepping, we shouldn't spend too much time on it. I do expect better > > results than this though. Especially since I don't probe/attach the > > USB controller (one of the many workarounds in Linux for the A1). > > Try increasing the value of PV_BOOTSTRAP_NEEDED in get_pv_entry(). I > really need to think of a better way of handling that. Doubling the value works. I now see the behaviour I do expect with the machine: : Timecounter "IA64 ITC" frequency 499996000 Hz bpf: lo0 attached ata0-master: ata_command: timeout waiting for intr ata0-master: ATAPI identify failed ata1-slave: ata_command: timeout waiting for intr ata1-slave: ATAPI identify failed ata1-master: ata_command: timeout waiting for intr ata1-master: ATAPI identify failed Waiting 5 seconds for SCSI devices to settle isp0: driver initiated bus reset of bus 0 isp0: driver initiated bus reset of bus 1 isp0: Interrupting Mailbox Command (0x38) Timeout isp0: Mailbox Command 'SET TARGET PARAMS' failed (TIMEOUT) -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ia64" in the body of the message From owner-freebsd-ia64 Mon Oct 8 17:28:56 2001 Delivered-To: freebsd-ia64@freebsd.org Received: from mail5.speakeasy.net (mail5.speakeasy.net [216.254.0.205]) by hub.freebsd.org (Postfix) with ESMTP id 2783837B407 for ; Mon, 8 Oct 2001 17:28:54 -0700 (PDT) Received: (qmail 54243 invoked from network); 9 Oct 2001 00:28:53 -0000 Received: from unknown (HELO laptop.baldwin.cx) ([64.81.54.73]) (envelope-sender ) by mail5.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 9 Oct 2001 00:28:53 -0000 Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 Date: Mon, 08 Oct 2001 17:28:22 -0700 (PDT) From: John Baldwin To: ia64@FreeBSD.org Subject: ast() patch Sender: owner-freebsd-ia64@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Ok, now that you all have gotten ia64 farther along, perhaps one of you can test and fix this patch to make the kernel call ast() when returing to userland. This should fix things like SIGARLM, userland profiling, and a few other nits: http://www.freebsd.org/~jhb/ia64_ast.patch Index: ia64/ia64/exception.s =================================================================== RCS file: /usr/cvs/src/sys/ia64/ia64/exception.s,v retrieving revision 1.21 diff -u -r1.21 exception.s --- ia64/ia64/exception.s 7 Oct 2001 18:40:01 -0000 1.21 +++ ia64/ia64/exception.s 8 Oct 2001 20:20:27 -0000 @@ -887,9 +887,18 @@ ;; cmp.eq p1,p2=r0,r16 // test for return to kernel mode ;; -(p2) add r16=SIZEOF_TRAPFRAME+16,sp // restore ar.k6 (kernel sp) +(p1) br.cond.dpnt.few 2f + alloc r14=ar.pfs,0,0,1,0 + ;; + add out0=16,sp + ;; + // XXX: do we need to reset p1 to zero after this? + // XXX: do we need to save any other state? + br.call.sptk.many rp=ast + add r16=SIZEOF_TRAPFRAME+16,sp // restore ar.k6 (kernel sp) ;; -(p2) mov ar.k6=r16 + mov ar.k6=r16 +2: add r1=SIZEOF_TRAPFRAME-16,r3 // r1=&tf_f[FRAME_F15] add r2=SIZEOF_TRAPFRAME-32,r3 // r2=&tf_f[FRAME_F14] ;; -- John Baldwin -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.baldwin.cx/~john/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ia64" in the body of the message From owner-freebsd-ia64 Mon Oct 8 17:49: 4 2001 Delivered-To: freebsd-ia64@freebsd.org Received: from peter3.wemm.org (c1315225-a.plstn1.sfba.home.com [24.14.150.180]) by hub.freebsd.org (Postfix) with ESMTP id BBAC037B403; Mon, 8 Oct 2001 17:49:00 -0700 (PDT) Received: from overcee.netplex.com.au (overcee.wemm.org [10.0.0.3]) by peter3.wemm.org (8.11.0/8.11.0) with ESMTP id f990n0M74896; Mon, 8 Oct 2001 17:49:00 -0700 (PDT) (envelope-from peter@wemm.org) Received: from wemm.org (localhost [127.0.0.1]) by overcee.netplex.com.au (Postfix) with ESMTP id 6177C380F; Mon, 8 Oct 2001 17:49:00 -0700 (PDT) (envelope-from peter@wemm.org) X-Mailer: exmh version 2.3.1 01/18/2001 with nmh-1.0.4 To: obrien@FreeBSD.ORG Cc: Doug Rabson , ia64@FreeBSD.ORG Subject: Re: Things to do In-Reply-To: <20011008170851.C43343@dragon.nuxi.com> Date: Mon, 08 Oct 2001 17:49:00 -0700 From: Peter Wemm Message-Id: <20011009004900.6177C380F@overcee.netplex.com.au> Sender: owner-freebsd-ia64@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org "David O'Brien" wrote: > On Sun, Oct 07, 2001 at 05:15:46PM +0100, Doug Rabson wrote: > > A random list of things which need doing: > > New toolchain > > I don't recall, how did the real FreeBSD 2.11.2 Binutils I sent you work > out? Later this week I can commit the tweaks for IA64 into the CVS repo. Over the weekend I tinkered with building a 3.0.1 cross compiler. It generated asm syntax that the old gas did *not* like. So I connected it up with your binutils backend and built a kernel eventually. That was the combination that was screaming about dependency violations. Anyway, it spectaculatly didn't work [froze on startup, not a single printf], but this is not definative for several reasons. First, I used GENERIC and I think I may have forgotten the hints and/or other kernel patches. Secondly, I changed so many things at once and used an untested cross compiler. Finally, I managed to corrupt the binary install, so I ended up tossing it all out and starting again with a clean set from dfr. I think we can safely ignore this particular misadventure. I will try it again - just the new binutils this time - and let you know how it goes. Cheers, -Peter -- Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au "All of this is for nothing if we don't go to the stars" - JMS/B5 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ia64" in the body of the message From owner-freebsd-ia64 Mon Oct 8 21: 4:57 2001 Delivered-To: freebsd-ia64@freebsd.org Received: from peter3.wemm.org (c1315225-a.plstn1.sfba.home.com [24.14.150.180]) by hub.freebsd.org (Postfix) with ESMTP id 5174137B40A; Mon, 8 Oct 2001 21:04:47 -0700 (PDT) Received: from overcee.netplex.com.au (overcee.wemm.org [10.0.0.3]) by peter3.wemm.org (8.11.0/8.11.0) with ESMTP id f9944kM75313; Mon, 8 Oct 2001 21:04:46 -0700 (PDT) (envelope-from peter@wemm.org) Received: from wemm.org (localhost [127.0.0.1]) by overcee.netplex.com.au (Postfix) with ESMTP id C1025380F; Mon, 8 Oct 2001 21:04:46 -0700 (PDT) (envelope-from peter@wemm.org) X-Mailer: exmh version 2.3.1 01/18/2001 with nmh-1.0.4 To: John Baldwin Cc: ia64@FreeBSD.ORG Subject: Re: ast() patch In-Reply-To: Date: Mon, 08 Oct 2001 21:04:46 -0700 From: Peter Wemm Message-Id: <20011009040446.C1025380F@overcee.netplex.com.au> Sender: owner-freebsd-ia64@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org John Baldwin wrote: > Ok, now that you all have gotten ia64 farther along, perhaps one of you can > test and fix this patch to make the kernel call ast() when returing to > userland. This should fix things like SIGARLM, userland profiling, and a few > other nits: > > http://www.freebsd.org/~jhb/ia64_ast.patch > > Index: ia64/ia64/exception.s > =================================================================== > RCS file: /usr/cvs/src/sys/ia64/ia64/exception.s,v > retrieving revision 1.21 > diff -u -r1.21 exception.s > --- ia64/ia64/exception.s 7 Oct 2001 18:40:01 -0000 1.21 > +++ ia64/ia64/exception.s 8 Oct 2001 20:20:27 -0000 > @@ -887,9 +887,18 @@ > ;; > cmp.eq p1,p2=r0,r16 // test for return to kernel mode > ;; > -(p2) add r16=SIZEOF_TRAPFRAME+16,sp // restore ar.k6 (kernel sp) > +(p1) br.cond.dpnt.few 2f > + alloc r14=ar.pfs,0,0,1,0 > + ;; > + add out0=16,sp > + ;; > + // XXX: do we need to reset p1 to zero after this? > + // XXX: do we need to save any other state? > + br.call.sptk.many rp=ast > + add r16=SIZEOF_TRAPFRAME+16,sp // restore ar.k6 (kernel sp) > ;; > -(p2) mov ar.k6=r16 > + mov ar.k6=r16 > +2: > add r1=SIZEOF_TRAPFRAME-16,r3 // r1=&tf_f[FRAME_F15] > add r2=SIZEOF_TRAPFRAME-32,r3 // r2=&tf_f[FRAME_F14] > ;; Sorry to say so, but it explodes... mountroot> ufs:da1c Mounting root from ufs:da1c da0 at isp0 bus 0 target 0 lun 0 da0: Fixed Direct Access SCSI-3 device da0: 80.000MB/s transfers (40.000MHz, offset 8, 16bit), Tagged Queueing Enabled da0: 8761MB (17942584 512 byte sectors: 255H 63S/T 1116C) da1 at isp0 bus 0 target 1 lun 0 da1: Fixed Direct Access SCSI-3 device da1: 80.000MB/s transfers (40.000MHz, offset 8, 16bit), Tagged Queueing Enabled da1: 17501MB (35843670 512 byte sectors: 255H 63S/T 2231C) da1c: raw partition size != slice size da1c: start 0, end 35843669, size 35843670 da1cc: start 0, end 524287, size 524288 fatal kernel trap: trap vector = 0x18 (General Exception) cr.iip = 0xe000000000962a60 cr.ipsr = 0x121008026010 (mfl,ic,i,dt,rt,cpl=0,it,ri=1,bn) cr.isr = 0x8400000030 (r,ni,ei=0) cr.ifa = 0x9ffffffffffffeb0 cr.iim = 0xcf curthread = 0xa00000001288fb60 pid = 1, comm = init Stopped at ovbcopy+0xe1: st8 [r33]=r15,8 db> trace ovbcopy(0xe0000000000156d0) at ovbcopy+0xe0 exception_restore() at exception_restore+0x70 db> Cheers, -Peter -- Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au "All of this is for nothing if we don't go to the stars" - JMS/B5 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ia64" in the body of the message From owner-freebsd-ia64 Mon Oct 8 23:37:42 2001 Delivered-To: freebsd-ia64@freebsd.org Received: from anchor-post-33.mail.demon.net (anchor-post-33.mail.demon.net [194.217.242.91]) by hub.freebsd.org (Postfix) with ESMTP id 1A5ED37B405; Mon, 8 Oct 2001 23:37:39 -0700 (PDT) Received: from [62.49.251.130] (helo=herring.nlsystems.com) by anchor-post-33.mail.demon.net with esmtp (Exim 2.12 #1) id 15qqWH-0009gt-0X; Tue, 9 Oct 2001 07:37:37 +0100 Received: from salmon.nlsystems.com (salmon [10.0.0.3]) by herring.nlsystems.com (8.11.2/8.11.2) with ESMTP id f996aM754175; Tue, 9 Oct 2001 07:36:22 +0100 (BST) (envelope-from dfr@nlsystems.com) Date: Tue, 9 Oct 2001 07:34:55 +0100 (BST) From: Doug Rabson To: "David O'Brien" Cc: Subject: Re: Things to do In-Reply-To: <20011008170851.C43343@dragon.nuxi.com> Message-ID: <20011009073338.R530-100000@salmon.nlsystems.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-ia64@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Mon, 8 Oct 2001, David O'Brien wrote: > On Sun, Oct 07, 2001 at 05:15:46PM +0100, Doug Rabson wrote: > > A random list of things which need doing: > > New toolchain > > I don't recall, how did the real FreeBSD 2.11.2 Binutils I sent you work > out? Later this week I can commit the tweaks for IA64 into the CVS repo. I seem to remember that ld cored itself when I tried to link a kernel with it. I don't think I managed to get your new copy of gas to be used by gcc which might not have helped. -- Doug Rabson Mail: dfr@nlsystems.com Phone: +44 20 8348 6160 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ia64" in the body of the message From owner-freebsd-ia64 Tue Oct 9 0:41: 2 2001 Delivered-To: freebsd-ia64@freebsd.org Received: from finch-post-11.mail.demon.net (finch-post-11.mail.demon.net [194.217.242.39]) by hub.freebsd.org (Postfix) with ESMTP id F220937B408; Tue, 9 Oct 2001 00:40:59 -0700 (PDT) Received: from [62.49.251.130] (helo=herring.nlsystems.com) by finch-post-11.mail.demon.net with esmtp (Exim 2.12 #1) id 15qrVa-000Jho-0B; Tue, 9 Oct 2001 07:40:58 +0000 Received: from salmon.nlsystems.com (salmon [10.0.0.3]) by herring.nlsystems.com (8.11.2/8.11.2) with ESMTP id f997dh755117; Tue, 9 Oct 2001 08:39:43 +0100 (BST) (envelope-from dfr@nlsystems.com) Date: Tue, 9 Oct 2001 08:38:16 +0100 (BST) From: Doug Rabson To: John Baldwin Cc: Subject: Re: ast() patch In-Reply-To: Message-ID: <20011009083627.G530-100000@salmon.nlsystems.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-ia64@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Mon, 8 Oct 2001, John Baldwin wrote: > Ok, now that you all have gotten ia64 farther along, perhaps one of you can > test and fix this patch to make the kernel call ast() when returing to > userland. This should fix things like SIGARLM, userland profiling, and a few > other nits: > > http://www.freebsd.org/~jhb/ia64_ast.patch This can't possibly work. At this point, the processor is running with interrupts and interrupt collection disabled. It also has data translation turned off. In this state, we can't risk calling any normal code because we can't cope with any exceptions. You will have to arrange to call ast() before the 'rsm psr.ic|...' line. -- Doug Rabson Mail: dfr@nlsystems.com Phone: +44 20 8348 6160 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ia64" in the body of the message From owner-freebsd-ia64 Tue Oct 9 10:29:46 2001 Delivered-To: freebsd-ia64@freebsd.org Received: from mail11.speakeasy.net (mail11.speakeasy.net [216.254.0.211]) by hub.freebsd.org (Postfix) with ESMTP id 07D6837B403 for ; Tue, 9 Oct 2001 10:29:39 -0700 (PDT) Received: (qmail 16869 invoked from network); 9 Oct 2001 17:29:38 -0000 Received: from unknown (HELO laptop.baldwin.cx) ([64.81.54.73]) (envelope-sender ) by mail11.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 9 Oct 2001 17:29:38 -0000 Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20011009083627.G530-100000@salmon.nlsystems.com> Date: Tue, 09 Oct 2001 10:29:05 -0700 (PDT) From: John Baldwin To: Doug Rabson Subject: Re: ast() patch Cc: ia64@FreeBSD.org Sender: owner-freebsd-ia64@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On 09-Oct-01 Doug Rabson wrote: > On Mon, 8 Oct 2001, John Baldwin wrote: > >> Ok, now that you all have gotten ia64 farther along, perhaps one of you can >> test and fix this patch to make the kernel call ast() when returing to >> userland. This should fix things like SIGARLM, userland profiling, and a >> few >> other nits: >> >> http://www.freebsd.org/~jhb/ia64_ast.patch > > This can't possibly work. At this point, the processor is running with > interrupts and interrupt collection disabled. It also has data translation > turned off. In this state, we can't risk calling any normal code because > we can't cope with any exceptions. > > You will have to arrange to call ast() before the 'rsm psr.ic|...' line. Ah, hmm, ok. ast() should return with interrupts disabled btw. (It returns inside of a critical section.) Hmmm. I'm a bit out of my depth here. :( > -- > Doug Rabson Mail: dfr@nlsystems.com > Phone: +44 20 8348 6160 > > -- John Baldwin -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.baldwin.cx/~john/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ia64" in the body of the message From owner-freebsd-ia64 Tue Oct 9 10:44:34 2001 Delivered-To: freebsd-ia64@freebsd.org Received: from anchor-post-32.mail.demon.net (anchor-post-32.mail.demon.net [194.217.242.90]) by hub.freebsd.org (Postfix) with ESMTP id C95F337B407; Tue, 9 Oct 2001 10:44:26 -0700 (PDT) Received: from [62.49.251.130] (helo=herring.nlsystems.com) by anchor-post-32.mail.demon.net with esmtp (Exim 2.12 #1) id 15r0vZ-000CLC-0W; Tue, 9 Oct 2001 18:44:25 +0100 Received: from herring (herring [10.0.0.2]) by herring.nlsystems.com (8.11.2/8.11.2) with ESMTP id f99Hh9782323; Tue, 9 Oct 2001 18:43:09 +0100 (BST) (envelope-from dfr@nlsystems.com) Date: Tue, 9 Oct 2001 18:43:09 +0100 (BST) From: Doug Rabson To: John Baldwin Cc: Subject: Re: ast() patch In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-ia64@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Tue, 9 Oct 2001, John Baldwin wrote: > > On 09-Oct-01 Doug Rabson wrote: > > On Mon, 8 Oct 2001, John Baldwin wrote: > > > >> Ok, now that you all have gotten ia64 farther along, perhaps one of you can > >> test and fix this patch to make the kernel call ast() when returing to > >> userland. This should fix things like SIGARLM, userland profiling, and a > >> few > >> other nits: > >> > >> http://www.freebsd.org/~jhb/ia64_ast.patch > > > > This can't possibly work. At this point, the processor is running with > > interrupts and interrupt collection disabled. It also has data translation > > turned off. In this state, we can't risk calling any normal code because > > we can't cope with any exceptions. > > > > You will have to arrange to call ast() before the 'rsm psr.ic|...' line. > > Ah, hmm, ok. ast() should return with interrupts disabled btw. (It returns > inside of a critical section.) Hmmm. I'm a bit out of my depth here. :( Its ok for it to return with interrupts disabled. We would disable them anyway during the body of exception_restore and the rfi instruction will enable them when it copies cr.ipsr to psr. -- Doug Rabson Mail: dfr@nlsystems.com Phone: +44 20 8348 6160 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ia64" in the body of the message From owner-freebsd-ia64 Tue Oct 9 11:30: 2 2001 Delivered-To: freebsd-ia64@freebsd.org Received: from mail12.speakeasy.net (mail12.speakeasy.net [216.254.0.212]) by hub.freebsd.org (Postfix) with ESMTP id 20B7937B409 for ; Tue, 9 Oct 2001 11:29:56 -0700 (PDT) Received: (qmail 67897 invoked from network); 9 Oct 2001 18:29:55 -0000 Received: from unknown (HELO laptop.baldwin.cx) ([64.81.54.73]) (envelope-sender ) by mail12.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 9 Oct 2001 18:29:55 -0000 Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: Date: Tue, 09 Oct 2001 11:29:22 -0700 (PDT) From: John Baldwin To: Doug Rabson Subject: Re: ast() patch Cc: ia64@FreeBSD.org Sender: owner-freebsd-ia64@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On 09-Oct-01 Doug Rabson wrote: > On Tue, 9 Oct 2001, John Baldwin wrote: > >> >> On 09-Oct-01 Doug Rabson wrote: >> > On Mon, 8 Oct 2001, John Baldwin wrote: >> > >> >> Ok, now that you all have gotten ia64 farther along, perhaps one of you >> >> can >> >> test and fix this patch to make the kernel call ast() when returing to >> >> userland. This should fix things like SIGARLM, userland profiling, and a >> >> few >> >> other nits: >> >> >> >> http://www.freebsd.org/~jhb/ia64_ast.patch >> > >> > This can't possibly work. At this point, the processor is running with >> > interrupts and interrupt collection disabled. It also has data translation >> > turned off. In this state, we can't risk calling any normal code because >> > we can't cope with any exceptions. >> > >> > You will have to arrange to call ast() before the 'rsm psr.ic|...' line. >> >> Ah, hmm, ok. ast() should return with interrupts disabled btw. (It returns >> inside of a critical section.) Hmmm. I'm a bit out of my depth here. :( > > Its ok for it to return with interrupts disabled. We would disable them > anyway during the body of exception_restore and the rfi instruction will > enable them when it copies cr.ipsr to psr. Yeah, that's exactly the intention. I'll just have to wrap my head around this asm. I suppose I'll have to duplicate the kernel/user return check before the rsm since we only call ast() if returning to userland. Either that or save the results of the test so I can use it later on where it's used now. -- John Baldwin -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.baldwin.cx/~john/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ia64" in the body of the message From owner-freebsd-ia64 Wed Oct 10 2:19:18 2001 Delivered-To: freebsd-ia64@freebsd.org Received: from finch-post-10.mail.demon.net (finch-post-10.mail.demon.net [194.217.242.38]) by hub.freebsd.org (Postfix) with ESMTP id 0107C37B407 for ; Wed, 10 Oct 2001 02:18:44 -0700 (PDT) Received: from [62.49.251.130] (helo=herring.nlsystems.com) by finch-post-10.mail.demon.net with esmtp (Exim 2.12 #1) id 15rFVh-000GtL-0A for ia64@freebsd.org; Wed, 10 Oct 2001 09:18:41 +0000 Received: from salmon.nlsystems.com (salmon [10.0.0.3]) by herring.nlsystems.com (8.11.2/8.11.2) with ESMTP id f9A9HQ788207 for ; Wed, 10 Oct 2001 10:17:26 +0100 (BST) (envelope-from dfr@nlsystems.com) Date: Wed, 10 Oct 2001 10:15:56 +0100 (BST) From: Doug Rabson To: Subject: rtld Message-ID: <20011010100824.Y549-100000@salmon.nlsystems.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-ia64@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Some patches to get rtld working, for your amusement. I'll commit them as soon as jdp takes a look. Be warned that the new toolchain will generate objects which are totally incompatible with the old toolchain due to a change in the format of the .hash section. Also, this set of patches assumes that the kernel is using my new calling convention for execve (a three entry register frame containing &args, ps_strings and NULL cleanup value). It could be changed to work with the existing convention (sp points at &argv, r14 at ps_strings, sp needs to be realigned and have 16 subtracted from it for scratch space) but I'm going to commit the new calling convention soon anyway. Index: rtld.c =================================================================== RCS file: /home/ncvs/src/libexec/rtld-elf/rtld.c,v retrieving revision 1.53 diff -u -r1.53 rtld.c --- rtld.c 2001/07/26 11:02:32 1.53 +++ rtld.c 2001/10/10 08:54:15 @@ -437,9 +437,19 @@ defobj->strtab + def->st_name, basename(obj->path), (void *)target, basename(defobj->path)); +#ifdef __ia64__ + /* + * On ia64 we need to return an @fptr for the target. + * Conveniently, the jmpslot serves this purpose nicely. + */ + reloc_jmpslot(where, target, defobj); + rlock_release(); + return (Elf_Addr) where; +#else reloc_jmpslot(where, target); rlock_release(); return target; +#endif } /* @@ -572,7 +582,7 @@ case DT_HASH: { - const Elf_Addr *hashtab = (const Elf_Addr *) + const Elf_Hashelt *hashtab = (const Elf_Hashelt *) (obj->relocbase + dynp->d_un.d_ptr); obj->nbuckets = hashtab[0]; obj->nchains = hashtab[1]; Index: rtld.h =================================================================== RCS file: /home/ncvs/src/libexec/rtld-elf/rtld.h,v retrieving revision 1.22 diff -u -r1.22 rtld.h --- rtld.h 2001/05/05 23:20:59 1.22 +++ rtld.h 2001/10/09 19:19:50 @@ -137,9 +137,9 @@ const char *strtab; /* String table */ unsigned long strsize; /* Size in bytes of string table */ - const Elf_Addr *buckets; /* Hash table buckets array */ + const Elf_Hashelt *buckets; /* Hash table buckets array */ unsigned long nbuckets; /* Number of buckets */ - const Elf_Addr *chains; /* Hash table chain array */ + const Elf_Hashelt *chains; /* Hash table chain array */ unsigned long nchains; /* Number of chains */ const char *rpath; /* Search path specified in object */ Index: ia64/lockdflt.c =================================================================== RCS file: lockdflt.c diff -N lockdflt.c --- /dev/null Wed Oct 10 10:02:46 2001 +++ lockdflt.c Wed Oct 10 09:50:32 2001 @@ -0,0 +1,181 @@ +/*- + * Copyright 1999, 2000 John D. Polstra. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/* + * Thread locking implementation for the dynamic linker. + * + * We use the "simple, non-scalable reader-preference lock" from: + * + * J. M. Mellor-Crummey and M. L. Scott. "Scalable Reader-Writer + * Synchronization for Shared-Memory Multiprocessors." 3rd ACM Symp. on + * Principles and Practice of Parallel Programming, April 1991. + * + * In this algorithm the lock is a single word. Its low-order bit is + * set when a writer holds the lock. The remaining high-order bits + * contain a count of readers desiring the lock. The algorithm requires + * atomic "compare_and_store" and "add" operations, which we implement + * using assembly language sequences in "rtld_start.S". + * + * These are spinlocks. When spinning we call nanosleep() for 1 + * microsecond each time around the loop. This will most likely yield + * the CPU to other threads (including, we hope, the lockholder) allowing + * them to make some progress. + */ + +#include +#include +#include + +#include "debug.h" +#include "rtld.h" + +/* + * This value of CACHE_LINE_SIZE is conservative. The actual size + * is 32 on the 21064, 21064A, 21066, 21066A, and 21164. It is 64 + * on the 21264. Compaq recommends sequestering each lock in its own + * 128-byte block to allow for future implementations with larger + * cache lines. + */ +#define CACHE_LINE_SIZE 128 + +#define WAFLAG 0x1 /* A writer holds the lock */ +#define RC_INCR 0x2 /* Adjusts count of readers desiring lock */ + +typedef struct Struct_Lock { + volatile int lock; + void *base; +} Lock; + +static const struct timespec usec = { 0, 1000 }; /* 1 usec. */ +static sigset_t fullsigmask, oldsigmask; + +static void * +lock_create(void *context) +{ + void *base; + char *p; + uintptr_t r; + Lock *l; + + /* + * Arrange for the lock to occupy its own cache line. First, we + * optimistically allocate just a cache line, hoping that malloc + * will give us a well-aligned block of memory. If that doesn't + * work, we allocate a larger block and take a well-aligned cache + * line from it. + */ + base = xmalloc(CACHE_LINE_SIZE); + p = (char *)base; + if ((uintptr_t)p % CACHE_LINE_SIZE != 0) { + free(base); + base = xmalloc(2 * CACHE_LINE_SIZE); + p = (char *)base; + if ((r = (uintptr_t)p % CACHE_LINE_SIZE) != 0) + p += CACHE_LINE_SIZE - r; + } + l = (Lock *)p; + l->base = base; + l->lock = 0; + return l; +} + +static void +lock_destroy(void *lock) +{ + Lock *l = (Lock *)lock; + + free(l->base); +} + +static void +rlock_acquire(void *lock) +{ + Lock *l = (Lock *)lock; + + atomic_add_int(&l->lock, RC_INCR); + while (l->lock & WAFLAG) + nanosleep(&usec, NULL); +} + +static void +wlock_acquire(void *lock) +{ + Lock *l = (Lock *)lock; + sigset_t tmp_oldsigmask; + + for ( ; ; ) { + sigprocmask(SIG_BLOCK, &fullsigmask, &tmp_oldsigmask); + if (cmp0_and_store_int(&l->lock, WAFLAG) == 0) + break; + sigprocmask(SIG_SETMASK, &tmp_oldsigmask, NULL); + nanosleep(&usec, NULL); + } + oldsigmask = tmp_oldsigmask; +} + +static void +rlock_release(void *lock) +{ + Lock *l = (Lock *)lock; + + atomic_add_int(&l->lock, -RC_INCR); +} + +static void +wlock_release(void *lock) +{ + Lock *l = (Lock *)lock; + + atomic_add_int(&l->lock, -WAFLAG); + sigprocmask(SIG_SETMASK, &oldsigmask, NULL); +} + +void +lockdflt_init(LockInfo *li) +{ + li->context = NULL; + li->lock_create = lock_create; + li->rlock_acquire = rlock_acquire; + li->wlock_acquire = wlock_acquire; + li->rlock_release = rlock_release; + li->wlock_release = wlock_release; + li->lock_destroy = lock_destroy; + li->context_destroy = NULL; + /* + * Construct a mask to block all signals except traps which might + * conceivably be generated within the dynamic linker itself. + */ + sigfillset(&fullsigmask); + sigdelset(&fullsigmask, SIGILL); + sigdelset(&fullsigmask, SIGTRAP); + sigdelset(&fullsigmask, SIGABRT); + sigdelset(&fullsigmask, SIGEMT); + sigdelset(&fullsigmask, SIGFPE); + sigdelset(&fullsigmask, SIGBUS); + sigdelset(&fullsigmask, SIGSEGV); + sigdelset(&fullsigmask, SIGSYS); +} Index: ia64/reloc.c =================================================================== RCS file: reloc.c diff -N reloc.c --- /dev/null Wed Oct 10 10:02:46 2001 +++ reloc.c Wed Oct 10 09:58:10 2001 @@ -0,0 +1,391 @@ +/*- + * Copyright 1996, 1997, 1998, 1999 John D. Polstra. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/* + * Dynamic linker for ELF. + * + * John Polstra . + */ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "debug.h" +#include "rtld.h" + +extern Elf_Dyn _DYNAMIC; + +/* + * Macros for cracking ia64 function pointers. + */ +struct fptr { + Elf_Addr target; + Elf_Addr gp; +}; + +#define FPTR_TARGET(f) (((struct fptr *) (f))->target) +#define FPTR_GP(f) (((struct fptr *) (f))->gp) + +/* + * Macros for loading/storing unaligned 64-bit values. These are + * needed because relocations can point to unaligned data. This + * occurs in the DWARF2 exception frame tables generated by the + * compiler, for instance. + * + * We don't use these when relocating jump slots and GOT entries, + * since they are guaranteed to be aligned. + * + * XXX dfr stub for now. + */ +#define load64(p) (*(u_int64_t *) (p)) +#define store64(p, v) (*(u_int64_t *) (p) = (v)) + +/* Allocate an @fptr. */ + +#define FPTR_CHUNK_SIZE 64 + +struct fptr_chunk { + struct fptr fptrs[FPTR_CHUNK_SIZE]; +}; + +static struct fptr_chunk first_chunk; +static struct fptr_chunk *current_chunk = &first_chunk; +static struct fptr *next_fptr = &first_chunk.fptrs[0]; +static struct fptr *last_fptr = &first_chunk.fptrs[FPTR_CHUNK_SIZE]; + +/* + * We use static storage initially so that we don't have to call + * malloc during init_rtld(). + */ +static struct fptr * +alloc_fptr(Elf_Addr target, Elf_Addr gp) +{ + struct fptr* fptr; + + if (next_fptr == last_fptr) { + current_chunk = malloc(sizeof(struct fptr_chunk)); + next_fptr = ¤t_chunk->fptrs[0]; + last_fptr = ¤t_chunk->fptrs[FPTR_CHUNK_SIZE]; + } + fptr = next_fptr; + next_fptr++; + fptr->target = target; + fptr->gp = gp; + return fptr; +} + +/* Relocate a non-PLT object with addend. */ +static int +reloc_non_plt_obj(Obj_Entry *obj_rtld, Obj_Entry *obj, const Elf_Rela *rela, + SymCache *cache, struct fptr **fptrs) +{ + Elf_Addr *where = (Elf_Addr *) (obj->relocbase + rela->r_offset); + + switch (ELF_R_TYPE(rela->r_info)) { + case R_IA64_REL64LSB: + /* + * We handle rtld's relocations in rtld_start.S + */ + if (obj != obj_rtld) + store64(where, + load64(where) + (Elf_Addr) obj->relocbase); + break; + + case R_IA64_DIR64LSB: { + const Elf_Sym *def; + const Obj_Entry *defobj; + Elf_Addr target; + + def = find_symdef(ELF_R_SYM(rela->r_info), obj, &defobj, + false, cache); + if (def == NULL) + return -1; + target = (Elf_Addr) (defobj->relocbase + def->st_value); + store64(where, target + rela->r_addend); + break; + } + + case R_IA64_FPTR64LSB: { + /* + * We have to make sure that all @fptr references to + * the same function are identical so that code can + * compare function pointers. We actually only bother + * to ensure this within a single object. If the + * caller's alloca failed, we don't even ensure that. + */ + const Elf_Sym *def; + const Obj_Entry *defobj; + struct fptr *fptr = 0; + Elf_Addr target, gp; + + /* + * Not sure why the call to find_symdef() doesn't work + * properly (it fails if the symbol is local). Perhaps + * this is a toolchain issue - revisit after we + * upgrade the ia64 toolchain. + */ +#if 0 + def = find_symdef(ELF_R_SYM(rela->r_info), obj, &defobj, + false, cache); + if (def == NULL) + return -1; +#else + def = &obj->symtab[ELF_R_SYM(rela->r_info)]; + defobj = obj; +#endif + target = (Elf_Addr) (defobj->relocbase + def->st_value); + gp = (Elf_Addr) defobj->pltgot; + + /* + * Find the @fptr, using fptrs as a helper. + */ + if (fptrs) + fptr = fptrs[ELF_R_SYM(rela->r_info)]; + if (!fptr) { + fptr = alloc_fptr(target, gp); + if (fptrs) + fptrs[ELF_R_SYM(rela->r_info)] = fptr; + } + store64(where, (Elf_Addr) fptr); + break; + } + + default: + _rtld_error("%s: Unsupported relocation type %d" + " in non-PLT relocations\n", obj->path, + ELF_R_TYPE(rela->r_info)); + return -1; + } + + return(0); +} + +/* Process the non-PLT relocations. */ +int +reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld) +{ + const Elf_Rel *rellim; + const Elf_Rel *rel; + const Elf_Rela *relalim; + const Elf_Rela *rela; + SymCache *cache; + struct fptr **fptrs; + + cache = (SymCache *)alloca(obj->nchains * sizeof(SymCache)); + if (cache != NULL) + memset(cache, 0, obj->nchains * sizeof(SymCache)); + fptrs = (struct fptr **)alloca(obj->nchains * sizeof(struct fptr *)); + if (fptrs != NULL) + memset(fptrs, 0, obj->nchains * sizeof(struct fptr *)); + + /* Perform relocations without addend if there are any: */ + rellim = (const Elf_Rel *) ((caddr_t) obj->rel + obj->relsize); + for (rel = obj->rel; obj->rel != NULL && rel < rellim; rel++) { + Elf_Rela locrela; + + locrela.r_info = rel->r_info; + locrela.r_offset = rel->r_offset; + locrela.r_addend = 0; + if (reloc_non_plt_obj(obj_rtld, obj, &locrela, cache, fptrs)) + return -1; + } + + /* Perform relocations with addend if there are any: */ + relalim = (const Elf_Rela *) ((caddr_t) obj->rela + obj->relasize); + for (rela = obj->rela; obj->rela != NULL && rela < relalim; rela++) { + if (reloc_non_plt_obj(obj_rtld, obj, rela, cache, fptrs)) + return -1; + } + return 0; +} + +/* Process the PLT relocations. */ +int +reloc_plt(Obj_Entry *obj) +{ + /* All PLT relocations are the same kind: Elf_Rel or Elf_Rela. */ + if (obj->pltrelsize != 0) { + const Elf_Rel *rellim; + const Elf_Rel *rel; + + rellim = (const Elf_Rel *) + ((char *)obj->pltrel + obj->pltrelsize); + for (rel = obj->pltrel; rel < rellim; rel++) { + Elf_Addr *where; + + assert(ELF_R_TYPE(rel->r_info) == R_IA64_IPLTLSB); + + /* Relocate the @fptr pointing into the PLT. */ + where = (Elf_Addr *)(obj->relocbase + rel->r_offset); + *where += (Elf_Addr)obj->relocbase; + } + } else { + const Elf_Rela *relalim; + const Elf_Rela *rela; + + relalim = (const Elf_Rela *) + ((char *)obj->pltrela + obj->pltrelasize); + for (rela = obj->pltrela; rela < relalim; rela++) { + Elf_Addr *where; + + assert(ELF_R_TYPE(rela->r_info) == R_IA64_IPLTLSB); + + /* Relocate the @fptr pointing into the PLT. */ + where = (Elf_Addr *)(obj->relocbase + rela->r_offset); + *where += (Elf_Addr)obj->relocbase; + } + } + return 0; +} + +/* Relocate the jump slots in an object. */ +int +reloc_jmpslots(Obj_Entry *obj) +{ + if (obj->jmpslots_done) + return 0; + /* All PLT relocations are the same kind: Elf_Rel or Elf_Rela. */ + if (obj->pltrelsize != 0) { + const Elf_Rel *rellim; + const Elf_Rel *rel; + + rellim = (const Elf_Rel *) + ((char *)obj->pltrel + obj->pltrelsize); + for (rel = obj->pltrel; rel < rellim; rel++) { + Elf_Addr *where; + const Elf_Sym *def; + const Obj_Entry *defobj; + + assert(ELF_R_TYPE(rel->r_info) == R_IA64_IPLTLSB); + where = (Elf_Addr *)(obj->relocbase + rel->r_offset); + def = find_symdef(ELF_R_SYM(rel->r_info), obj, + &defobj, true, NULL); + if (def == NULL) + return -1; + reloc_jmpslot(where, + (Elf_Addr)(defobj->relocbase + + def->st_value), + defobj); + } + } else { + const Elf_Rela *relalim; + const Elf_Rela *rela; + + relalim = (const Elf_Rela *) + ((char *)obj->pltrela + obj->pltrelasize); + for (rela = obj->pltrela; rela < relalim; rela++) { + Elf_Addr *where; + const Elf_Sym *def; + const Obj_Entry *defobj; + + /* assert(ELF_R_TYPE(rela->r_info) == R_ALPHA_JMP_SLOT); */ + where = (Elf_Addr *)(obj->relocbase + rela->r_offset); + def = find_symdef(ELF_R_SYM(rela->r_info), obj, + &defobj, true, NULL); + if (def == NULL) + return -1; + reloc_jmpslot(where, + (Elf_Addr)(defobj->relocbase + + def->st_value), + defobj); + } + } + obj->jmpslots_done = true; + return 0; +} + +/* Fixup the jump slot at "where" to transfer control to "target". */ +void +reloc_jmpslot(Elf_Addr *where, Elf_Addr target, const Obj_Entry *obj) +{ + Elf_Addr stubaddr; + + dbg(" reloc_jmpslot: where=%p, target=%p, gp=%p", + (void *)where, (void *)target, (void *)obj->pltgot); + stubaddr = *where; + if (stubaddr != target) { + + /* + * Point this @fptr directly at the target. Update the + * gp value first so that we don't break another cpu + * which is currently executing the PLT entry. + */ + where[1] = (Elf_Addr) obj->pltgot; + ia64_mf(); + where[0] = target; + ia64_mf(); + } +} + +/* + * XXX ia64 doesn't seem to have copy relocations. + * + * Returns 0 on success, -1 on failure. + */ +int +do_copy_relocations(Obj_Entry *dstobj) +{ + + return 0; +} + +/* Initialize the special PLT entries. */ +void +init_pltgot(Obj_Entry *obj) +{ + const Elf_Dyn *dynp; + Elf_Addr *pltres = 0; + + /* + * Find the PLT RESERVE section. + */ + for (dynp = obj->dynamic; dynp->d_tag != DT_NULL; dynp++) { + if (dynp->d_tag == DT_IA64_PLT_RESERVE) + pltres = (u_int64_t *) + (obj->relocbase + dynp->d_un.d_ptr); + } + if (!pltres) + errx(1, "Can't find DT_IA64_PLT_RESERVE entry"); + + /* + * The PLT RESERVE section is used to get values to pass to + * _rtld_bind when lazy binding. + */ + pltres[0] = (Elf_Addr) obj; + pltres[1] = FPTR_TARGET(_rtld_bind_start); + pltres[2] = FPTR_GP(_rtld_bind_start); +} Index: ia64/rtld_machdep.h =================================================================== RCS file: rtld_machdep.h diff -N rtld_machdep.h --- /dev/null Wed Oct 10 10:02:46 2001 +++ rtld_machdep.h Wed Oct 10 09:50:58 2001 @@ -0,0 +1,45 @@ +/*- + * Copyright (c) 1999, 2000 John D. Polstra. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef RTLD_MACHDEP_H +#define RTLD_MACHDEP_H 1 + +/* Return the address of the .dynamic section in the dynamic linker. */ +#define rtld_dynamic(obj) (&_DYNAMIC) + +struct Struct_Obj_Entry; + +void reloc_jmpslot(Elf_Addr *, Elf_Addr, const struct Struct_Obj_Entry *); + +/* Atomic operations. */ +int cmp0_and_store_int(volatile int *, int); +void atomic_add_int(volatile int *, int); +void atomic_incr_int(volatile int *); +void atomic_decr_int(volatile int *); + +#endif Index: ia64/rtld_start.S =================================================================== RCS file: rtld_start.S diff -N rtld_start.S --- /dev/null Wed Oct 10 10:02:46 2001 +++ rtld_start.S Wed Oct 10 10:01:12 2001 @@ -0,0 +1,291 @@ +/* $FreeBSD$ */ +/* From: NetBSD: rtld_start.S,v 1.1 1996/12/16 20:38:09 cgd Exp */ + +/* + * Copyright 1996 Matt Thomas + * Copyright 2000 John D. Polstra + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include + +ENTRY(_rtld_start, 0) + alloc r2=ar.pfs,3,0,3,0 + ;; +1: mov r14=ip // calculate gp + movl r15=@gprel(1b) + ;; + sub gp=r14,r15 + ;; + .section .sdata +2: data4 @ltv(1b) // unrelocated address of 1b + .align 8 + .previous + add r15=@gprel(2b),gp + ;; + ld8 r15=[r15] + ;; + sub out0=r14,r15 // out0 is image base address + br.call.sptk.many rp=_rtld_reloc // fixup image + + add sp=-16,sp // 16 bytes for us, 16 for _rtld + ;; + mov out0=in0 + add out1=16,sp // address for exit proc + add out2=24,sp // address for obj_main + + br.call.sptk.many rp=_rtld // r8=_rtld(sp, &exit_proc, &obj_main) + + add r16=16,sp // address for exit proc + ;; + ld8 r15=[r16] // read exit proc + add sp=16,sp // readjust stack + mov b7=r8 // address of real _start + ;; + alloc r2=ar.pfs,0,0,3,0 // dump register frame + mov out2=r15 + + br.call.sptk.many rp=b7 // transfer to main program + br.call.sptk.many rp=exit // die +END(_rtld_start) + +/* + * _rtld_bind_start: lookup a lazy binding and transfer to real target + * + * Arguments: + * r1 gp value for rtld + * r15 Index in plt + * r16 Obj_Entry of caller + * in0-in7 Arguments for target procedure + * rp Return address back to caller + */ +ENTRY(_rtld_bind_start, 0) + alloc loc0=ar.pfs,8,6,3,0 // space to save r8-r11 + add sp=-8*16,sp // space to save f8-f15 + mov loc1=rp + ;; + add r17=16,sp // leave 16 bytes for _rtld_bind + add r18=32,sp + ;; + mov loc2=r8 // structure return address + mov loc3=r9 // language specific + mov loc4=r10 // language specific + mov loc5=r11 // language specific + ;; + stf.spill [r17]=f8,32 // save float arguments + stf.spill [r18]=f9,32 + mov out0=r16 // Obj_Entry for caller + ;; + stf.spill [r17]=f10,32 + stf.spill [r18]=f11,32 + shl out1=r15,4 // 16 * index + ;; + stf.spill [r17]=f12,32 + stf.spill [r18]=f13,32 + shladd out1=r15,3,out1 // rela offset = 24 * index + ;; + stf.spill [r17]=f14,32 + stf.spill [r18]=f15,32 + ;; + br.call.sptk.many rp=_rtld_bind + ;; + add r17=16,sp + add r18=32,sp + ld8 r14=[r8],8 // target address + ;; + ldf.fill f8=[r17],32 + ldf.fill f9=[r18],32 + ld8 r1=[r8] // target gp + ;; + ldf.fill f10=[r17],32 // restore float arguments + ldf.fill f11=[r18],32 + mov r8=loc2 // and structure pointer + ;; + ldf.fill f12=[r17],32 // etc. + ldf.fill f13=[r18],32 + mov r9=loc3 + ;; + ldf.fill f14=[r17],32 + ldf.fill f15=[r18],32 + mov r10=loc4 + ;; + mov r11=loc5 + mov b7=r14 + mov ar.pfs=loc0 // clean up + mov rp=loc1 + add sp=8*16,sp + ;; + alloc r14=ar.pfs,0,0,8,0 // drop our register frame + br.sptk.many b7 // jump to target +END(_rtld_bind_start) + +/* + * int cmp0_and_store_int(volatile int *p, int newval); + * + * If an int holds 0, store newval into it; else do nothing. Returns + * the previous value. + */ +ENTRY(cmp0_and_store_int, 2) + mov ar.ccv=0 + ;; + cmpxchg4.acq r8=[in0],in1,ar.ccv + br.ret.sptk.many rp +END(cmp0_and_store_int) + +ENTRY(atomic_add_int, 2) +1: ld4 r14=[in0] + ;; + mov ar.ccv=r14 + add r15=in1,r14 + ;; + cmpxchg4.acq r16=[in0],r15,ar.ccv + ;; + cmp.ne p6,p0=r14,r16 +(p6) br.cond.spnt.few 1b + br.ret.sptk.many rp +END(atomic_add_int) + +/* Atomically increment an int. */ +ENTRY(atomic_incr_int, 1) +1: ld4 r14=[in0] + ;; + mov ar.ccv=r14 + add r15=1,r14 + ;; + cmpxchg4.acq r16=[in0],r15,ar.ccv + ;; + cmp.ne p6,p0=r14,r16 +(p6) br.cond.spnt.few 1b + br.ret.sptk.many rp +END(atomic_incr_int) + +/* Atomically decrement an int. */ +ENTRY(atomic_decr_int, 1) +1: ld4 r14=[in0] + ;; + mov ar.ccv=r14 + add r15=-1,r14 + ;; + cmpxchg4.acq r16=[in0],r15,ar.ccv + ;; + cmp.ne p6,p0=r14,r16 +(p6) br.cond.spnt.few 1b + br.ret.sptk.many rp +END(atomic_decr_int) + +#define DT_NULL 0 /* Terminating entry. */ +#define DT_RELA 7 /* Address of ElfNN_Rela relocations. */ +#define DT_RELASZ 8 /* Total size of ElfNN_Rela relocations. */ +#define DT_RELAENT 9 /* Size of each ElfNN_Rela relocation entry. */ + +#define R_IA64_NONE 0 /* None */ +#define R_IA64_DIR64LSB 0x27 /* word64 LSB S + A */ +#define R_IA64_REL64LSB 0x6f /* word64 LSB BD + A */ + +/* + * _rtld_reloc: relocate the rtld image, apart from @fptrs. + * + * Assumes that rtld was linked at zero and that we only need to + * handle REL64LSB and DIR64LSB relocations. + * + * Arguments: + * r1 gp value for rtld + * in0 rtld base address + */ +STATIC_ENTRY(_rtld_reloc, 1) + alloc loc0=ar.pfs,1,2,0,0 + mov loc1=rp + ;; + movl r15=@gprel(_DYNAMIC) // find _DYNAMIC etc. + ;; + add r15=r15,gp // relocate _DYNAMIC etc. + ;; +1: ld8 r16=[r15],8 // read r15->d_tag + ;; + ld8 r17=[r15],8 // and r15->d_val + ;; + cmp.eq p6,p0=DT_NULL,r16 // done? +(p6) br.cond.dpnt.few 2f + ;; + cmp.eq p6,p0=DT_RELA,r16 + ;; +(p6) add r18=r17,in0 // found rela section + ;; + cmp.eq p6,p0=DT_RELASZ,r16 + ;; +(p6) mov r19=r17 // found rela size + ;; + cmp.eq p6,p0=DT_RELAENT,r16 + ;; +(p6) mov r22=r17 // found rela entry size + ;; + br.sptk.few 1b + +2: + ld8 r15=[r18],8 // read r_offset + ;; + ld8 r16=[r18],8 // read r_info + add r15=r15,in0 // relocate r_offset + ;; + ld8 r17=[r18],8 // read r_addend + sub r19=r19,r22 // update relasz + + extr.u r23=r16,0,32 // ELF64_R_TYPE(r16) + ;; + cmp.eq p6,p0=R_IA64_NONE,r23 +(p6) br.cond.dpnt.few 3f + ;; + cmp.eq p6,p0=R_IA64_DIR64LSB,r23 + ;; +(p6) br.cond.dptk.few 4f + ;; + cmp.eq p6,p0=R_IA64_REL64LSB,r23 + ;; +(p6) br.cond.dptk.few 4f + ;; + +3: cmp.ltu p6,p0=0,r19 // more? +(p6) br.cond.dptk.few 2b // loop + + mov r8=0 // success return value + ;; + br.cond.sptk.few 9f // done + +4: + ld8 r16=[r15] // read value + ;; + add r16=r16,in0 // relocate it + ;; + st8 [r15]=r16 // and store it back + br.cond.sptk.few 3b + +9: + mov ar.pfs=loc0 + mov rp=loc1 + ;; + br.ret.sptk.few rp + +END(_rtld_reloc) -- Doug Rabson Mail: dfr@nlsystems.com Phone: +44 20 8348 6160 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ia64" in the body of the message From owner-freebsd-ia64 Wed Oct 10 10:17:48 2001 Delivered-To: freebsd-ia64@freebsd.org Received: from mail12.speakeasy.net (mail12.speakeasy.net [216.254.0.212]) by hub.freebsd.org (Postfix) with ESMTP id 2E4BC37B40C for ; Wed, 10 Oct 2001 10:17:45 -0700 (PDT) Received: (qmail 91178 invoked from network); 10 Oct 2001 17:17:44 -0000 Received: from unknown (HELO laptop.baldwin.cx) ([64.81.54.73]) (envelope-sender ) by mail12.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 10 Oct 2001 17:17:44 -0000 Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20011010100824.Y549-100000@salmon.nlsystems.com> Date: Wed, 10 Oct 2001 10:17:10 -0700 (PDT) From: John Baldwin To: Doug Rabson , jdp@FreeBSD.org Subject: RE: rtld -- atomic ops Cc: ia64@freebsd.org Sender: owner-freebsd-ia64@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On 10-Oct-01 Doug Rabson wrote: > +/* > + * Thread locking implementation for the dynamic linker. > + * > + * We use the "simple, non-scalable reader-preference lock" from: > + * > + * J. M. Mellor-Crummey and M. L. Scott. "Scalable Reader-Writer > + * Synchronization for Shared-Memory Multiprocessors." 3rd ACM Symp. on > + * Principles and Practice of Parallel Programming, April 1991. > + * > + * In this algorithm the lock is a single word. Its low-order bit is > + * set when a writer holds the lock. The remaining high-order bits > + * contain a count of readers desiring the lock. The algorithm requires > + * atomic "compare_and_store" and "add" operations, which we implement > + * using assembly language sequences in "rtld_start.S". > + * > + * These are spinlocks. When spinning we call nanosleep() for 1 > + * microsecond each time around the loop. This will most likely yield > + * the CPU to other threads (including, we hope, the lockholder) allowing > + * them to make some progress. > + */ One quick question. Now that we have a MI atomic operation interface one can get from that includes atomic_cmpset_acq_int(), atomic_add_acq_int(), and atomic_add_rel_int(), why not use these instead of re-rolling the atomic operations each time? I realize that do to the quirky nature of the 386, you would still have to have a hack for the x86 platform, but at least for 486+ and other arch's you could just use the pre-existent API so that we only have to code up atomic ops in one place. Comments? -- John Baldwin -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.baldwin.cx/~john/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ia64" in the body of the message From owner-freebsd-ia64 Wed Oct 10 10:23:54 2001 Delivered-To: freebsd-ia64@freebsd.org Received: from wall.polstra.com (wall-gw.polstra.com [206.213.73.130]) by hub.freebsd.org (Postfix) with ESMTP id 1A37E37B405; Wed, 10 Oct 2001 10:23:51 -0700 (PDT) Received: from vashon.polstra.com (vashon.polstra.com [206.213.73.13]) by wall.polstra.com (8.11.3/8.11.3) with ESMTP id f9AHNo805885; Wed, 10 Oct 2001 10:23:50 -0700 (PDT) (envelope-from jdp@polstra.com) Message-ID: X-Mailer: XFMail 1.3 [p0] on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: Date: Wed, 10 Oct 2001 10:23:50 -0700 (PDT) Organization: Polstra & Co., Inc. From: John Polstra To: John Baldwin Subject: RE: rtld -- atomic ops Cc: ia64@FreeBSD.org, Doug Rabson Sender: owner-freebsd-ia64@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org John Baldwin wrote: > > One quick question. Now that we have a MI atomic operation interface one can > get from that includes atomic_cmpset_acq_int(), > atomic_add_acq_int(), and atomic_add_rel_int(), why not use these instead of > re-rolling the atomic operations each time? I realize that do to the quirky > nature of the 386, you would still have to have a hack for the x86 platform, > but at least for 486+ and other arch's you could just use the pre-existent API > so that we only have to code up atomic ops in one place. > > Comments? That would be great, as far as I'm concerned. Note, the reader/writer locks used by the dynamic linker require something resembling an atomic compare and exchange operation. John To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ia64" in the body of the message From owner-freebsd-ia64 Wed Oct 10 10:27:20 2001 Delivered-To: freebsd-ia64@freebsd.org Received: from tele-post-20.mail.demon.net (tele-post-20.mail.demon.net [194.217.242.20]) by hub.freebsd.org (Postfix) with ESMTP id 9B6F437B407; Wed, 10 Oct 2001 10:27:14 -0700 (PDT) Received: from [62.49.251.130] (helo=herring.nlsystems.com) by tele-post-20.mail.demon.net with esmtp (Exim 2.12 #2) id 15rN8T-000Kh2-0K; Wed, 10 Oct 2001 17:27:13 +0000 Received: from herring (herring [10.0.0.2]) by herring.nlsystems.com (8.11.2/8.11.2) with ESMTP id f9AHPv761194; Wed, 10 Oct 2001 18:25:57 +0100 (BST) (envelope-from dfr@nlsystems.com) Date: Wed, 10 Oct 2001 18:25:57 +0100 (BST) From: Doug Rabson To: John Baldwin Cc: , Subject: RE: rtld -- atomic ops In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-ia64@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Wed, 10 Oct 2001, John Baldwin wrote: > > On 10-Oct-01 Doug Rabson wrote: > > +/* > > + * Thread locking implementation for the dynamic linker. > > + * > > + * We use the "simple, non-scalable reader-preference lock" from: > > + * > > + * J. M. Mellor-Crummey and M. L. Scott. "Scalable Reader-Writer > > + * Synchronization for Shared-Memory Multiprocessors." 3rd ACM Symp. on > > + * Principles and Practice of Parallel Programming, April 1991. > > + * > > + * In this algorithm the lock is a single word. Its low-order bit is > > + * set when a writer holds the lock. The remaining high-order bits > > + * contain a count of readers desiring the lock. The algorithm requires > > + * atomic "compare_and_store" and "add" operations, which we implement > > + * using assembly language sequences in "rtld_start.S". > > + * > > + * These are spinlocks. When spinning we call nanosleep() for 1 > > + * microsecond each time around the loop. This will most likely yield > > + * the CPU to other threads (including, we hope, the lockholder) allowing > > + * them to make some progress. > > + */ > > One quick question. Now that we have a MI atomic operation interface one can > get from that includes atomic_cmpset_acq_int(), > atomic_add_acq_int(), and atomic_add_rel_int(), why not use these instead of > re-rolling the atomic operations each time? I realize that do to the quirky > nature of the 386, you would still have to have a hack for the x86 platform, > but at least for 486+ and other arch's you could just use the pre-existent API > so that we only have to code up atomic ops in one place. > > Comments? Thats a pretty good idea. It should be possible to provide a completely MI version of lockdflt.c using , possibly with an i386-specific override for old times sake. Personally, I would prefer to de-support i386-class machines. -- Doug Rabson Mail: dfr@nlsystems.com Phone: +44 20 8348 6160 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ia64" in the body of the message From owner-freebsd-ia64 Wed Oct 10 12: 4:16 2001 Delivered-To: freebsd-ia64@freebsd.org Received: from mail5.speakeasy.net (mail5.speakeasy.net [216.254.0.205]) by hub.freebsd.org (Postfix) with ESMTP id 6FAD937B411 for ; Wed, 10 Oct 2001 12:04:06 -0700 (PDT) Received: (qmail 98167 invoked from network); 10 Oct 2001 19:04:05 -0000 Received: from unknown (HELO laptop.baldwin.cx) ([64.81.54.73]) (envelope-sender ) by mail5.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 10 Oct 2001 19:04:05 -0000 Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: Date: Wed, 10 Oct 2001 12:03:32 -0700 (PDT) From: John Baldwin To: Doug Rabson Subject: RE: rtld -- atomic ops Cc: ia64@freebsd.org, jdp@FreeBSD.org Sender: owner-freebsd-ia64@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On 10-Oct-01 Doug Rabson wrote: > On Wed, 10 Oct 2001, John Baldwin wrote: > >> >> On 10-Oct-01 Doug Rabson wrote: >> > +/* >> > + * Thread locking implementation for the dynamic linker. >> > + * >> > + * We use the "simple, non-scalable reader-preference lock" from: >> > + * >> > + * J. M. Mellor-Crummey and M. L. Scott. "Scalable Reader-Writer >> > + * Synchronization for Shared-Memory Multiprocessors." 3rd ACM Symp. on >> > + * Principles and Practice of Parallel Programming, April 1991. >> > + * >> > + * In this algorithm the lock is a single word. Its low-order bit is >> > + * set when a writer holds the lock. The remaining high-order bits >> > + * contain a count of readers desiring the lock. The algorithm requires >> > + * atomic "compare_and_store" and "add" operations, which we implement >> > + * using assembly language sequences in "rtld_start.S". >> > + * >> > + * These are spinlocks. When spinning we call nanosleep() for 1 >> > + * microsecond each time around the loop. This will most likely yield >> > + * the CPU to other threads (including, we hope, the lockholder) allowing >> > + * them to make some progress. >> > + */ >> >> One quick question. Now that we have a MI atomic operation interface one >> can >> get from that includes atomic_cmpset_acq_int(), >> atomic_add_acq_int(), and atomic_add_rel_int(), why not use these instead of >> re-rolling the atomic operations each time? I realize that do to the quirky >> nature of the 386, you would still have to have a hack for the x86 platform, >> but at least for 486+ and other arch's you could just use the pre-existent >> API >> so that we only have to code up atomic ops in one place. >> >> Comments? > > Thats a pretty good idea. It should be possible to provide a completely MI > version of lockdflt.c using , possibly with an > i386-specific override for old times sake. Personally, I would prefer to > de-support i386-class machines. So would I. -- John Baldwin -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.baldwin.cx/~john/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ia64" in the body of the message From owner-freebsd-ia64 Wed Oct 10 12: 4:13 2001 Delivered-To: freebsd-ia64@freebsd.org Received: from mail5.speakeasy.net (mail5.speakeasy.net [216.254.0.205]) by hub.freebsd.org (Postfix) with ESMTP id 4CE8537B410 for ; Wed, 10 Oct 2001 12:04:05 -0700 (PDT) Received: (qmail 98147 invoked from network); 10 Oct 2001 19:04:04 -0000 Received: from unknown (HELO laptop.baldwin.cx) ([64.81.54.73]) (envelope-sender ) by mail5.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 10 Oct 2001 19:04:04 -0000 Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: Date: Wed, 10 Oct 2001 12:03:30 -0700 (PDT) From: John Baldwin To: John Polstra Subject: RE: rtld -- atomic ops Cc: Doug Rabson , ia64@FreeBSD.org Sender: owner-freebsd-ia64@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On 10-Oct-01 John Polstra wrote: > John Baldwin wrote: >> >> One quick question. Now that we have a MI atomic operation interface one >> can >> get from that includes atomic_cmpset_acq_int(), >> atomic_add_acq_int(), and atomic_add_rel_int(), why not use these instead of >> re-rolling the atomic operations each time? I realize that do to the quirky >> nature of the 386, you would still have to have a hack for the x86 platform, >> but at least for 486+ and other arch's you could just use the pre-existent >> API >> so that we only have to code up atomic ops in one place. >> >> Comments? > > That would be great, as far as I'm concerned. Note, the reader/writer > locks used by the dynamic linker require something resembling an > atomic compare and exchange operation. That's exactly what atomic_cmpset() is. :) Although it doesn't guarantee an exchange (i.e., it doesn't return the old value if the cmp succeeds). > John -- John Baldwin -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.baldwin.cx/~john/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ia64" in the body of the message From owner-freebsd-ia64 Wed Oct 10 12: 7:33 2001 Delivered-To: freebsd-ia64@freebsd.org Received: from wall.polstra.com (wall-gw.polstra.com [206.213.73.130]) by hub.freebsd.org (Postfix) with ESMTP id 3C5BE37B405; Wed, 10 Oct 2001 12:07:29 -0700 (PDT) Received: from vashon.polstra.com (vashon.polstra.com [206.213.73.13]) by wall.polstra.com (8.11.3/8.11.3) with ESMTP id f9AJ7S806530; Wed, 10 Oct 2001 12:07:28 -0700 (PDT) (envelope-from jdp@polstra.com) Message-ID: X-Mailer: XFMail 1.3 [p0] on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: Date: Wed, 10 Oct 2001 12:07:28 -0700 (PDT) Organization: Polstra & Co., Inc. From: John Polstra To: John Baldwin Subject: RE: rtld -- atomic ops Cc: ia64@FreeBSD.org, Doug Rabson Sender: owner-freebsd-ia64@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org John Baldwin wrote: > On 10-Oct-01 John Polstra wrote: >>> >> That would be great, as far as I'm concerned. Note, the reader/writer >> locks used by the dynamic linker require something resembling an >> atomic compare and exchange operation. > > That's exactly what atomic_cmpset() is. :) Although it doesn't guarantee an > exchange (i.e., it doesn't return the old value if the cmp succeeds). That's not a problem. John To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ia64" in the body of the message From owner-freebsd-ia64 Thu Oct 11 5:36:25 2001 Delivered-To: freebsd-ia64@freebsd.org Received: from finch-post-10.mail.demon.net (finch-post-10.mail.demon.net [194.217.242.38]) by hub.freebsd.org (Postfix) with ESMTP id 031EF37B403 for ; Thu, 11 Oct 2001 05:36:22 -0700 (PDT) Received: from [62.49.251.130] (helo=herring.nlsystems.com) by finch-post-10.mail.demon.net with esmtp (Exim 2.12 #1) id 15rf4W-00049u-0A for ia64@freebsd.org; Thu, 11 Oct 2001 12:36:20 +0000 Received: from herring (herring [10.0.0.2]) by herring.nlsystems.com (8.11.2/8.11.2) with ESMTP id f9BCZ5795688 for ; Thu, 11 Oct 2001 13:35:05 +0100 (BST) (envelope-from dfr@nlsystems.com) Date: Thu, 11 Oct 2001 13:35:04 +0100 (BST) From: Doug Rabson To: Subject: Re: Program startup In-Reply-To: <20011008210708.C530-100000@salmon.nlsystems.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-ia64@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Mon, 8 Oct 2001, Doug Rabson wrote: > I'm thinking of changing the way setregs() passes arguments to the program > being execed. Currently, sp points at &argc and r14 contains ps_strings > (which is ignored). > > I figured out how to create an initial register frame for the new process > so that we don't need as much assembler hackery in crt1.c. Unfortunately > this means that I need to change sp so that it is 16byte aligned and > includes a 16 byte scratch area. This will break *all* existing binaries. > > I'll make a new set of binaries available when I commit the change. I've just committed this change to the program startup conventions. New binaries are available at http://people.freebsd.org/~/dfr/ia64-root-11102001.tar.gz. Highlights of this binary set include shared libraries, and a reasonably complete set of /usr binaries. -- Doug Rabson Mail: dfr@nlsystems.com Phone: +44 20 8348 6160 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ia64" in the body of the message From owner-freebsd-ia64 Thu Oct 11 17:44:27 2001 Delivered-To: freebsd-ia64@freebsd.org Received: from vlmfg.com (w194.z064000243.lax-ca.dsl.cnc.net [64.0.243.194]) by hub.freebsd.org (Postfix) with ESMTP id 9E27C37B407 for ; Thu, 11 Oct 2001 17:44:24 -0700 (PDT) Received: from localhost [64.225.124.232] by vlmfg.com (SMTPD32-6.00) id AE848D01D4; Thu, 11 Oct 2001 17:51:16 -0700 To: freebsd-ia64@FreeBSD.org From: friends@openxxx.net X-Mailer: Perl+Mail::Sender 0.7.08 by Jan Krynicky Subject: Hello, your friend recommended openxxx to you Message-Id: <200110111751677.SM00207@localhost> Date: Thu, 11 Oct 2001 17:51:30 -0700 Sender: owner-freebsd-ia64@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org You have been invited to check out this adult site by one of your friends who visited us. click here , our URL is: http://www.openxxx.net/ enjoy, OpenXXX TEAM 2001 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ia64" in the body of the message From owner-freebsd-ia64 Thu Oct 11 18: 1:19 2001 Delivered-To: freebsd-ia64@freebsd.org Received: from peter3.wemm.org (c1315225-a.plstn1.sfba.home.com [24.14.150.180]) by hub.freebsd.org (Postfix) with ESMTP id AB6AA37B406 for ; Thu, 11 Oct 2001 18:01:11 -0700 (PDT) Received: from overcee.netplex.com.au (overcee.wemm.org [10.0.0.3]) by peter3.wemm.org (8.11.0/8.11.0) with ESMTP id f9C11BM85908 for ; Thu, 11 Oct 2001 18:01:11 -0700 (PDT) (envelope-from peter@wemm.org) Received: from wemm.org (localhost [127.0.0.1]) by overcee.netplex.com.au (Postfix) with ESMTP id 2AF62380F; Thu, 11 Oct 2001 18:01:11 -0700 (PDT) (envelope-from peter@wemm.org) X-Mailer: exmh version 2.3.1 01/18/2001 with nmh-1.0.4 To: Doug Rabson Cc: ia64@FreeBSD.ORG Subject: Re: Program startup In-Reply-To: Date: Thu, 11 Oct 2001 18:01:11 -0700 From: Peter Wemm Message-Id: <20011012010111.2AF62380F@overcee.netplex.com.au> Sender: owner-freebsd-ia64@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Doug Rabson wrote: > On Mon, 8 Oct 2001, Doug Rabson wrote: > > > I'm thinking of changing the way setregs() passes arguments to the program > > being execed. Currently, sp points at &argc and r14 contains ps_strings > > (which is ignored). > > > > I figured out how to create an initial register frame for the new process > > so that we don't need as much assembler hackery in crt1.c. Unfortunately > > this means that I need to change sp so that it is 16byte aligned and > > includes a 16 byte scratch area. This will break *all* existing binaries. > > > > I'll make a new set of binaries available when I commit the change. > > I've just committed this change to the program startup conventions. New > binaries are available at > http://people.freebsd.org/~/dfr/ia64-root-11102001.tar.gz. Highlights of > this binary set include shared libraries, and a reasonably complete set of > /usr binaries. I'm having trouble with dynamic linked binaries going into 100% spin loops. It seems they fail when they fork: 97 rwhod RET read 337/0x151 97 rwhod CALL close(0x3) 97 rwhod RET close 0 97 rwhod CALL fork 98 rwhod RET fork 0 97 rwhod RET fork 98/0x62 ^C 98 rwhod PSIG SIGINT SIG_DFL 97 rwhod PSIG SIGINT SIG_DFL Or, with relative timestamps: 102 rwhod 0.000080 RET read 337/0x151 102 rwhod 0.000409 CALL close(0x3) 102 rwhod 0.000138 RET close 0 102 rwhod 0.000208 CALL fork 103 rwhod 0.001151 RET fork 0 102 rwhod 0.000578 RET fork 103/0x67 103 rwhod 8.568529 PSIG SIGINT SIG_DFL 102 rwhod 0.000306 PSIG SIGINT SIG_DFL Or absolute: 102 rwhod 1002477739.925525 RET read 337/0x151 102 rwhod 1002477739.925934 CALL close(0x3) 102 rwhod 1002477739.926072 RET close 0 102 rwhod 1002477739.926280 CALL fork 103 rwhod 1002477739.927431 RET fork 0 102 rwhod 1002477739.928009 RET fork 103/0x67 103 rwhod 1002477748.496538 PSIG SIGINT SIG_DFL 102 rwhod 1002477748.496844 PSIG SIGINT SIG_DFL It looks like they're not making it back to userland. More info: # LD_BIND_NOW=1 # export LD_BIND_NOW # rwhod # pid 108 (rwhod), uid 1: exited on signal 11 or, a ktrace with this: 110 rwhod RET read 337/0x151 110 rwhod CALL close(0x3) 110 rwhod RET close 0 111 rwhod RET fork 0 111 rwhod CALL setsid 111 rwhod RET setsid 111/0x6f 111 rwhod CALL open(0x60000000401b4c20,0x2,0) 111 rwhod NAMI "/dev/null" 110 rwhod RET fork 111/0x6f 110 rwhod CALL exit(0) 111 rwhod RET open 3 111 rwhod CALL dup2(0x3,0) 111 rwhod RET dup2 0 111 rwhod CALL dup2(0x3,0x1) 111 rwhod RET dup2 1 111 rwhod CALL dup2(0x3,0x2) 111 rwhod RET dup2 2 I'm assuming that the lazy binding trampoline is not safe for the fork syscall. Cheers, -Peter -- Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au "All of this is for nothing if we don't go to the stars" - JMS/B5 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ia64" in the body of the message From owner-freebsd-ia64 Fri Oct 12 0:29: 6 2001 Delivered-To: freebsd-ia64@freebsd.org Received: from anchor-post-30.mail.demon.net (anchor-post-30.mail.demon.net [194.217.242.88]) by hub.freebsd.org (Postfix) with ESMTP id D94F337B401 for ; Fri, 12 Oct 2001 00:29:02 -0700 (PDT) Received: from [62.49.251.130] (helo=herring.nlsystems.com) by anchor-post-30.mail.demon.net with esmtp (Exim 2.12 #1) id 15rwke-0001Wp-0U; Fri, 12 Oct 2001 08:29:00 +0100 Received: from salmon.nlsystems.com (salmon [10.0.0.3]) by herring.nlsystems.com (8.11.2/8.11.2) with ESMTP id f9C7Rj704704; Fri, 12 Oct 2001 08:27:45 +0100 (BST) (envelope-from dfr@nlsystems.com) Date: Fri, 12 Oct 2001 08:26:11 +0100 (BST) From: Doug Rabson To: Peter Wemm Cc: Subject: Re: Program startup In-Reply-To: <20011012010111.2AF62380F@overcee.netplex.com.au> Message-ID: <20011012082426.H549-100000@salmon.nlsystems.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-ia64@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Thu, 11 Oct 2001, Peter Wemm wrote: > Doug Rabson wrote: > > On Mon, 8 Oct 2001, Doug Rabson wrote: > > > > > I'm thinking of changing the way setregs() passes arguments to the program > > > being execed. Currently, sp points at &argc and r14 contains ps_strings > > > (which is ignored). > > > > > > I figured out how to create an initial register frame for the new process > > > so that we don't need as much assembler hackery in crt1.c. Unfortunately > > > this means that I need to change sp so that it is 16byte aligned and > > > includes a 16 byte scratch area. This will break *all* existing binaries. > > > > > > I'll make a new set of binaries available when I commit the change. > > > > I've just committed this change to the program startup conventions. New > > binaries are available at > > http://people.freebsd.org/~/dfr/ia64-root-11102001.tar.gz. Highlights of > > this binary set include shared libraries, and a reasonably complete set of > > /usr binaries. > > I'm having trouble with dynamic linked binaries going into 100% spin loops. > > It seems they fail when they fork: > > It looks like they're not making it back to userland. > > I'm assuming that the lazy binding trampoline is not safe for the fork > syscall. Interesting. I noticed a few problems, particularly with ldd but I hadn't narrowed it down to fork. I'll take a look more closely at that case. -- Doug Rabson Mail: dfr@nlsystems.com Phone: +44 20 8348 6160 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ia64" in the body of the message From owner-freebsd-ia64 Fri Oct 12 13:23: 3 2001 Delivered-To: freebsd-ia64@freebsd.org Received: from peter3.wemm.org (c1315225-a.plstn1.sfba.home.com [24.14.150.180]) by hub.freebsd.org (Postfix) with ESMTP id C9D6637B406 for ; Fri, 12 Oct 2001 13:22:57 -0700 (PDT) Received: from overcee.netplex.com.au (overcee.wemm.org [10.0.0.3]) by peter3.wemm.org (8.11.0/8.11.0) with ESMTP id f9CKMvM88497 for ; Fri, 12 Oct 2001 13:22:57 -0700 (PDT) (envelope-from peter@wemm.org) Received: from wemm.org (localhost [127.0.0.1]) by overcee.netplex.com.au (Postfix) with ESMTP id 5EBF03808; Fri, 12 Oct 2001 13:22:57 -0700 (PDT) (envelope-from peter@wemm.org) X-Mailer: exmh version 2.3.1 01/18/2001 with nmh-1.0.4 To: Doug Rabson Cc: ia64@FreeBSD.ORG Subject: Re: Program startup In-Reply-To: <20011012082426.H549-100000@salmon.nlsystems.com> Date: Fri, 12 Oct 2001 13:22:56 -0700 From: Peter Wemm Message-Id: <20011012202257.5EBF03808@overcee.netplex.com.au> Sender: owner-freebsd-ia64@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Doug Rabson wrote: > On Thu, 11 Oct 2001, Peter Wemm wrote: > > > Doug Rabson wrote: > > > On Mon, 8 Oct 2001, Doug Rabson wrote: > > > > > > > I'm thinking of changing the way setregs() passes arguments to the prog ram > > > > being execed. Currently, sp points at &argc and r14 contains ps_strings > > > > (which is ignored). > > > > > > > > I figured out how to create an initial register frame for the new proce ss > > > > so that we don't need as much assembler hackery in crt1.c. Unfortunatel y > > > > this means that I need to change sp so that it is 16byte aligned and > > > > includes a 16 byte scratch area. This will break *all* existing binarie s. > > > > > > > > I'll make a new set of binaries available when I commit the change. > > > > > > I've just committed this change to the program startup conventions. New > > > binaries are available at > > > http://people.freebsd.org/~/dfr/ia64-root-11102001.tar.gz. Highlights of > > > this binary set include shared libraries, and a reasonably complete set o f > > > /usr binaries. > > > > I'm having trouble with dynamic linked binaries going into 100% spin loops. > > > > It seems they fail when they fork: > > > > It looks like they're not making it back to userland. > > > > I'm assuming that the lazy binding trampoline is not safe for the fork > > syscall. > > Interesting. I noticed a few problems, particularly with ldd but I hadn't > narrowed it down to fork. I'll take a look more closely at that case. Your commits seem to have resolved it. My box here makes it to multi-user now. oops. I spoke too soon.. it was sitting idle for a few minutes after login and: # panic: item is not free panic Stopped at Debugger+0x31: mov sp=r33 db> db> trace Debugger(0xe000000000a18fd0, 0xe000000001cd54f0, 0xe0000000007697c0, 0x712) at Debugger+0x30 panic(0xe000000000a27908, 0x0, 0xe000000000a27830, 0x1d9) at panic+0x1c0 zalloc(0xe000000000b69bb8) at zalloc+0x140 get_pv_entry(0x0, 0xe000000001cd5560) at get_pv_entry+0x190 pmap_make_pv(0xa000000012894430, 0x4000000000078000, 0xe000000001cd5570, 0xe000000000cc8000, 0x4000000000078000) at pmap_make_pv+0x30 pmap_enter_quick(0xa000000012894430, 0x4000000000078000, 0xe00000003e0fdd80) at pmap_enter_quick+0x80 pmap_prefault(0xa000000012894430, 0x400000000007a000, 0xa0000000147dd900, 0xe000000000cc8000, 0xe000000000b3d698, 0xe00000003e0fdd80, 0x3c, 0x4000000000078000) at pmap_prefault+0x4a0 vm_fault1(0xa000000012894380, 0x400000000007a000, 0x4, 0x0) at vm_fault1+0x2090 vm_fault(0xa000000012894380, 0x400000000007a000, 0x4, 0x0, 0xe000000000cc8000) at vm_fault+0x90 trap(0x14, 0x100000, 0xe000000001cd56d0) at trap+0x7e0 kernel_text(0x14, 0x100000, 0xe000000001cd56d0, 0xe000000000cc8000, 0xa000000013382770, 0x400000000007a000, 0xa000000013382580, 0xa000000012894380, 0x4, 0xa0000000133823e0) at kernel_text+0x5f0 db> db> ps pid proc addr uid ppid pgrp flag stat wmesg wchan cmd 264 a0000000133823e0 e000000001cb2000 0 263 263 000000 2 sh 263 a000000013382900 e000000001cb0000 0 262 263 004000 2 sh 262 a000000013382e20 e000000001ca6000 0 207 207 000000 3 piperd a000000014707900 cron ... I wonder if it is related to this during boot: acquiring duplicate lock of same type: "zone" 1st @ ../../../vm/vm_zone.c:473 2nd @ ../../../vm/vm_zone.c:473 I'll check it out some more. Cheers, -Peter -- Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au "All of this is for nothing if we don't go to the stars" - JMS/B5 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ia64" in the body of the message From owner-freebsd-ia64 Sat Oct 13 1:22: 6 2001 Delivered-To: freebsd-ia64@freebsd.org Received: from peter3.wemm.org (c1315225-a.plstn1.sfba.home.com [24.14.150.180]) by hub.freebsd.org (Postfix) with ESMTP id C7F8E37B40F; Sat, 13 Oct 2001 01:22:01 -0700 (PDT) Received: from overcee.netplex.com.au (overcee.wemm.org [10.0.0.3]) by peter3.wemm.org (8.11.0/8.11.0) with ESMTP id f9D8M1M90449; Sat, 13 Oct 2001 01:22:01 -0700 (PDT) (envelope-from peter@wemm.org) Received: from wemm.org (localhost [127.0.0.1]) by overcee.netplex.com.au (Postfix) with ESMTP id 41D123808; Sat, 13 Oct 2001 01:22:01 -0700 (PDT) (envelope-from peter@wemm.org) X-Mailer: exmh version 2.3.1 01/18/2001 with nmh-1.0.4 To: dfr@freebsd.org, jhb@freebsd.org Cc: ia64@freebsd.org Subject: non recursive lock reaquired.. Date: Sat, 13 Oct 2001 01:22:01 -0700 From: Peter Wemm Message-Id: <20011013082201.41D123808@overcee.netplex.com.au> Sender: owner-freebsd-ia64@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org This doesn't look too healthy. I wonder if this is what caused my zone allocation panic before: acquiring duplicate lock of same type: "zone" 1st @ ../../../vm/vm_zone.c:473 2nd @ ../../../vm/vm_zone.c:473 witness_lock Stopped at Debugger+0x31: mov sp=r33 db> trace Debugger(0xe000000000a1b6a8, 0xe0000000011135a0, 0xe0000000007b5930, 0xa9a, 0xe000000000a2ad98) at Debugger+0x30 witness_lock(0xe000000000b69bb8, 0x8, 0xe000000000a27910, 0x1d9) at witness_lock+0x1000 _mtx_lock_flags(0xe000000000b69bb8, 0x0, 0xe000000000a27910, 0x1d9) at _mtx_lock_flags+0x170 zalloc(0xe000000000b69bb8) at zalloc+0x80 ^^^^^ get_pv_entry(0xe0000000011135f0, 0xe0000000011135e0) at get_pv_entry+0x190 pmap_make_pv(0xe000000000b69b78, 0xa00000001315c000, 0xe0000000011135f0, 0xe000000000cc8000, 0xa00000001315c000) at pmap_make_pv+0x30 pmap_kenter(0xa00000001315c000, 0x11d8000, 0xe000000000cc8000, 0xe000000000ada6d8) at pmap_kenter+0x80 _zget(0xa00000000135ff00, 0xa00000001315c000, 0xe000000000cc8000, 0xa00000000135ff80) at _zget+0x1b0 zalloc(0xa00000000135ff00, 0xa00000000135ff00) at zalloc+0xc0 ^^^^ soalloc(0x1, 0xe000000000cc8000, 0xe000000000ada288) at soalloc+0x40 socreate(0x2, 0xe000000001113658, 0x2, 0x0, 0xa0000000133886e0) at socreate+0x200 socket(0xa0000000133886e0, 0xe000000001113690, 0xe000000001113690, 0xe000000000cc8000) at socket+0x120 syscall(0x61, 0xe000000001113690, 0xe0000000011136d0) at syscall+0x4e0 do_syscall(0x61, 0xe0000000011136d0, 0x600000000000e3e0, 0x61, 0xe000000001113690, 0xe0000000011136d0, 0xe000000000cc8000, 0xe000000000cc8000, 0xa000000013388540, 0xe0000000011136d0, 0xe000000000a97210, 0xa0000000133886e0, 0x61, 0xe000000001113690, 0x4000000000010ff0, 0x20000000000, 0x1, 0xe000000001113680, 0xe0000000009540d0, 0x186, 0xa0000000133886e0, 0xe000000001113690, 0xe000000001113690, 0xe000000000cc8000, 0x0) at do_syscall+0x260 __gp() at 0xe0000000011136d0 db> db> show locks exclusive (sleep mutex) zone (0xa00000000135ff00) locked @ ../../../vm/vm_zone.c:473 exclusive (sleep mutex) Giant (0xe000000000b71058) locked @ ../../../kern/uipc_syscalls.c:129 db> Cheers, -Peter -- Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au "All of this is for nothing if we don't go to the stars" - JMS/B5 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ia64" in the body of the message From owner-freebsd-ia64 Sat Oct 13 1:54:55 2001 Delivered-To: freebsd-ia64@freebsd.org Received: from peter3.wemm.org (c1315225-a.plstn1.sfba.home.com [24.14.150.180]) by hub.freebsd.org (Postfix) with ESMTP id 513CC37B40A; Sat, 13 Oct 2001 01:54:50 -0700 (PDT) Received: from overcee.netplex.com.au (overcee.wemm.org [10.0.0.3]) by peter3.wemm.org (8.11.0/8.11.0) with ESMTP id f9D8soM90513; Sat, 13 Oct 2001 01:54:50 -0700 (PDT) (envelope-from peter@wemm.org) Received: from wemm.org (localhost [127.0.0.1]) by overcee.netplex.com.au (Postfix) with ESMTP id E26933808; Sat, 13 Oct 2001 01:54:49 -0700 (PDT) (envelope-from peter@wemm.org) X-Mailer: exmh version 2.3.1 01/18/2001 with nmh-1.0.4 To: dfr@FreeBSD.ORG, jhb@FreeBSD.ORG, ia64@FreeBSD.ORG Subject: Re: non recursive lock reaquired.. In-Reply-To: <20011013082201.41D123808@overcee.netplex.com.au> Date: Sat, 13 Oct 2001 01:54:49 -0700 From: Peter Wemm Message-Id: <20011013085449.E26933808@overcee.netplex.com.au> Sender: owner-freebsd-ia64@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Peter Wemm wrote: > This doesn't look too healthy. I wonder if this is what caused my > zone allocation panic before: Actually I take this back.. it seems witness is upset about having two different mutexes with the same *name*... zinitna(vm_zone_t z, vm_object_t obj, char *name, int size, { mtx_init(&(z)->zmtx, "zone", MTX_DEF); } zbootinit(vm_zone_t z, char *name, int size, void *item, int nitems) { mtx_init(&(z)->zmtx, "zone", MTX_DEF); } Should "zone" be added here in subr_witness.c? static const char *dup_list[] = { "process lock", NULL }; > acquiring duplicate lock of same type: "zone" > 1st @ ../../../vm/vm_zone.c:473 > 2nd @ ../../../vm/vm_zone.c:473 > witness_lock > Stopped at Debugger+0x31: mov sp=r33 > db> trace > Debugger(0xe000000000a1b6a8, 0xe0000000011135a0, 0xe0000000007b5930, 0xa9a, 0 xe000000000a2ad98) at Debugger+0x30 > witness_lock(0xe000000000b69bb8, 0x8, 0xe000000000a27910, 0x1d9) at witness_l ock+0x1000 > _mtx_lock_flags(0xe000000000b69bb8, 0x0, 0xe000000000a27910, 0x1d9) at _mtx_l ock_flags+0x170 > zalloc(0xe000000000b69bb8) at zalloc+0x80 > ^^^^^ > get_pv_entry(0xe0000000011135f0, 0xe0000000011135e0) at get_pv_entry+0x190 > pmap_make_pv(0xe000000000b69b78, 0xa00000001315c000, 0xe0000000011135f0, 0xe0 00000000cc8000, 0xa00000001315c000) at pmap_make_pv+0x30 > pmap_kenter(0xa00000001315c000, 0x11d8000, 0xe000000000cc8000, 0xe000000000ad a6d8) at pmap_kenter+0x80 > _zget(0xa00000000135ff00, 0xa00000001315c000, 0xe000000000cc8000, 0xa00000000 135ff80) at _zget+0x1b0 > zalloc(0xa00000000135ff00, 0xa00000000135ff00) at zalloc+0xc0 > ^^^^ > soalloc(0x1, 0xe000000000cc8000, 0xe000000000ada288) at soalloc+0x40 > socreate(0x2, 0xe000000001113658, 0x2, 0x0, 0xa0000000133886e0) at socreate+0 x200 > socket(0xa0000000133886e0, 0xe000000001113690, 0xe000000001113690, 0xe0000000 00cc8000) at socket+0x120 > syscall(0x61, 0xe000000001113690, 0xe0000000011136d0) at syscall+0x4e0 > do_syscall(0x61, 0xe0000000011136d0, 0x600000000000e3e0, 0x61, 0xe00000000111 3690, 0xe0000000011136d0, 0xe000000000cc8000, 0xe000000000cc8000, 0xa000000 013388540, 0xe0000000011136d0, 0xe000000000a97210, 0xa0000000133886e0, 0x61 , 0xe000000001113690, 0x4000000000010ff0, 0x20000000000, 0x1, 0xe0000000011 13680, 0xe0000000009540d0, 0x186, 0xa0000000133886e0, 0xe000000001113690, 0 xe000000001113690, 0xe000000000cc8000, 0x0) at do_syscall+0x260 > __gp() at 0xe0000000011136d0 > db> > db> show locks > exclusive (sleep mutex) zone (0xa00000000135ff00) locked @ ../../../vm/vm_zon e.c:473 > exclusive (sleep mutex) Giant (0xe000000000b71058) locked @ ../../../kern/uip c_syscalls.c:129 > db> > > Cheers, > -Peter > -- > Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au > "All of this is for nothing if we don't go to the stars" - JMS/B5 > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-ia64" in the body of the message > > Cheers, -Peter -- Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au "All of this is for nothing if we don't go to the stars" - JMS/B5 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ia64" in the body of the message From owner-freebsd-ia64 Sat Oct 13 2:32:58 2001 Delivered-To: freebsd-ia64@freebsd.org Received: from peter3.wemm.org (c1315225-a.plstn1.sfba.home.com [24.14.150.180]) by hub.freebsd.org (Postfix) with ESMTP id 9D76837B40E; Sat, 13 Oct 2001 02:32:50 -0700 (PDT) Received: from overcee.netplex.com.au (overcee.wemm.org [10.0.0.3]) by peter3.wemm.org (8.11.0/8.11.0) with ESMTP id f9D9WoM90878; Sat, 13 Oct 2001 02:32:50 -0700 (PDT) (envelope-from peter@wemm.org) Received: from wemm.org (localhost [127.0.0.1]) by overcee.netplex.com.au (Postfix) with ESMTP id 134163808; Sat, 13 Oct 2001 02:32:50 -0700 (PDT) (envelope-from peter@wemm.org) X-Mailer: exmh version 2.3.1 01/18/2001 with nmh-1.0.4 To: dfr@FreeBSD.ORG, jhb@FreeBSD.ORG, ia64@FreeBSD.ORG Subject: Re: non recursive lock reaquired.. In-Reply-To: <20011013085449.E26933808@overcee.netplex.com.au> Date: Sat, 13 Oct 2001 02:32:50 -0700 From: Peter Wemm Message-Id: <20011013093250.134163808@overcee.netplex.com.au> Sender: owner-freebsd-ia64@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Peter Wemm wrote: > Peter Wemm wrote: > > This doesn't look too healthy. I wonder if this is what caused my > > zone allocation panic before: > > Actually I take this back.. it seems witness is upset about having > two different mutexes with the same *name*... > > zinitna(vm_zone_t z, vm_object_t obj, char *name, int size, > { > mtx_init(&(z)->zmtx, "zone", MTX_DEF); > } > > zbootinit(vm_zone_t z, char *name, int size, void *item, int nitems) > { > mtx_init(&(z)->zmtx, "zone", MTX_DEF); > } > > Should "zone" be added here in subr_witness.c? > > static const char *dup_list[] = { > "process lock", > NULL > }; Argh! And now all my old kernels and loaders dont want to work: ok load /kernel.1210 /kernel.1210 data=0x5d9070+0x980a0 syms=[0x8+0x43920+0x8+0x37574] ok boot -sa Entering /kernel.1210 at 0xe00000000050a000... WARNING: 32768 bytes not available for msgbuf in last cluster (8192 used) ACPI debug layer 0x0 debug level 0x0 Copyright (c) 1992-2001 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD 5.0-CURRENT #7: Fri Oct 12 12:51:50 PDT 2001 peter@overcee.netplex.com.au:/home/src/sys/ia64/compile/SMALL CPU: Itanium (733.36-Mhz) Origin = "GenuineIntel" Model = 0 Revision = 4 Features = 0x0 real memory = 1056210944 (1031456K bytes) avail memory = 2078253056 (2029544K bytes) Preloaded elf kernel "/kernel.1210" at 0xe000000000bee000. panic: vm_page_insert: already inserted panic Stopped at Debugger+0x31: mov sp=r33 db> avail > real ?? I booted linux again and it worked ok. I'll check it out again when I get home. Cheers, -Peter -- Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au "All of this is for nothing if we don't go to the stars" - JMS/B5 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ia64" in the body of the message From owner-freebsd-ia64 Sat Oct 13 21:50:33 2001 Delivered-To: freebsd-ia64@freebsd.org Received: from kayak.xcllnt.net (209-128-86-226.bayarea.net [209.128.86.226]) by hub.freebsd.org (Postfix) with ESMTP id 9279937B407 for ; Sat, 13 Oct 2001 21:50:31 -0700 (PDT) Received: from dhcp01.pn.xcllnt.net (dhcp01.pn.xcllnt.net [192.168.4.201]) by kayak.xcllnt.net (8.11.4/8.11.4) with ESMTP id f9E4oVI93221 for ; Sat, 13 Oct 2001 21:50:31 -0700 (PDT) (envelope-from marcel@kayak.pn.xcllnt.net) Received: (from marcel@localhost) by dhcp01.pn.xcllnt.net (8.11.6/8.11.3) id f9E4ort05695 for ia64@FreeBSD.org; Sat, 13 Oct 2001 21:50:53 -0700 (PDT) (envelope-from marcel) Date: Sat, 13 Oct 2001 21:50:53 -0700 From: Marcel Moolenaar To: ia64@FreeBSD.org Subject: vfprintf.c Message-ID: <20011013215052.A1551@dhcp01.pn.xcllnt.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.21i Sender: owner-freebsd-ia64@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Guys, Do we already have a "formal" solution for libc/stdio/vfprintf.c? I experimented with changing argtable to not store the addresses of the varargs (which fails on ia64), but to hold the values themselves and that works good. This is probably a pessimisation on i386; more so than on Alpha. An alternative is to not use the argtable at all. Is anybody taking a look at this? -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ia64" in the body of the message From owner-freebsd-ia64 Sat Oct 13 23:14:16 2001 Delivered-To: freebsd-ia64@freebsd.org Received: from peter3.wemm.org (c1315225-a.plstn1.sfba.home.com [24.14.150.180]) by hub.freebsd.org (Postfix) with ESMTP id 8FFFE37B406 for ; Sat, 13 Oct 2001 23:14:13 -0700 (PDT) Received: from overcee.netplex.com.au (overcee.wemm.org [10.0.0.3]) by peter3.wemm.org (8.11.0/8.11.0) with ESMTP id f9E6EDM95641 for ; Sat, 13 Oct 2001 23:14:13 -0700 (PDT) (envelope-from peter@wemm.org) Received: from wemm.org (localhost [127.0.0.1]) by overcee.netplex.com.au (Postfix) with ESMTP id 4A1F73810; Sat, 13 Oct 2001 23:14:13 -0700 (PDT) (envelope-from peter@wemm.org) X-Mailer: exmh version 2.3.1 01/18/2001 with nmh-1.0.4 To: Marcel Moolenaar Cc: ia64@FreeBSD.ORG Subject: Re: vfprintf.c In-Reply-To: <20011013215052.A1551@dhcp01.pn.xcllnt.net> Date: Sat, 13 Oct 2001 23:14:13 -0700 From: Peter Wemm Message-Id: <20011014061413.4A1F73810@overcee.netplex.com.au> Sender: owner-freebsd-ia64@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Marcel Moolenaar wrote: > Guys, > > Do we already have a "formal" solution for libc/stdio/vfprintf.c? > I experimented with changing argtable to not store the addresses > of the varargs (which fails on ia64), but to hold the values > themselves and that works good. This is probably a pessimisation > on i386; more so than on Alpha. An alternative is to not use the > argtable at all. > > Is anybody taking a look at this? Doug already posted a patch which fixes it.. It should be committed. ==== Date: Wed, 5 Sep 2001 11:31:15 +0100 (BST) Subject: Making printf work on ia64 From: Doug Rabson Message-id: Since the ia64 architecture has significantly different means for passing arguments than most others, it has an implementation of stdarg.h which doesn't work with our printf. In particular, you cannot take a pointer to the values returned by va_arg(). To get things to work, I had to change printf to copy the arguments instead of pointing to them. I have extensively tested this on ia64 and i386 and can't think of any problems with it. Still, it would be nice to have a few other eyes look over it. The QUAD_MAX part is down to a limitation with my ia64 build environment and should be harmless. .... ==== Cheers, -Peter -- Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au "All of this is for nothing if we don't go to the stars" - JMS/B5 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ia64" in the body of the message