From owner-freebsd-ia64@FreeBSD.ORG Sun Jun 1 13:16:05 2003 Return-Path: Delivered-To: freebsd-ia64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E540E37B401; Sun, 1 Jun 2003 13:16:05 -0700 (PDT) Received: from cueball.rtp.FreeBSD.org (cueball.rtp.FreeBSD.org [192.58.184.37]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3C15543F3F; Sun, 1 Jun 2003 13:16:05 -0700 (PDT) (envelope-from des+tinderbox@freebsd.org) Received: from cueball.rtp.FreeBSD.org (localhost [127.0.0.1]) h51KFfkF067988; Sun, 1 Jun 2003 16:15:41 -0400 (EDT) (envelope-from des+tinderbox@freebsd.org) Received: (from des@localhost) by cueball.rtp.FreeBSD.org (8.12.9/8.12.9/Submit) id h51KFeL7067987; Sun, 1 Jun 2003 20:15:40 GMT (envelope-from des+tinderbox@freebsd.org) Date: Sun, 1 Jun 2003 20:15:40 GMT Message-Id: <200306012015.h51KFeL7067987@cueball.rtp.FreeBSD.org> X-Authentication-Warning: cueball.rtp.FreeBSD.org: des set sender to Tinderbox using -f Sender: Tinderbox From: Tinderbox To: current@freebsd.org, ia64@freebsd.org Subject: [-CURRENT tinderbox] failure on ia64/ia64 X-BeenThere: freebsd-ia64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting FreeBSD to the IA-64 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jun 2003 20:16:06 -0000 TB --- 2003-06-01 20:12:52 - starting CURRENT tinderbox run for ia64/ia64 TB --- 2003-06-01 20:12:52 - checking out the source tree TB --- cd /home/des/tinderbox/CURRENT/ia64/ia64 TB --- /usr/bin/cvs -f -R -q -d/home/ncvs update -Pd -A src TB --- 2003-06-01 20:15:32 - building world TB --- cd /home/des/tinderbox/CURRENT/ia64/ia64/src TB --- /usr/bin/make -B buildworld >>> Rebuilding the temporary build tree >>> stage 1: legacy release compatibility shims >>> stage 1: bootstrap tools [...] error before `:' token In file included from /vol/vol0/users/des/tinderbox/CURRENT/ia64/ia64/src/contrib/gperf/src/bool-array.h:59, from /vol/vol0/users/des/tinderbox/CURRENT/ia64/ia64/src/contrib/gperf/src/bool-array.cc:21: /vol/vol0/users/des/tinderbox/CURRENT/ia64/ia64/src/contrib/gperf/src/options.h:150:1: unterminated #ifdef /vol/vol0/users/des/tinderbox/CURRENT/ia64/ia64/src/contrib/gperf/src/options.h:32:1: unterminated #ifndef In file included from /vol/vol0/users/des/tinderbox/CURRENT/ia64/ia64/src/contrib/gperf/src/bool-array.cc:21: /vol/vol0/users/des/tinderbox/CURRENT/ia64/ia64/src/contrib/gperf/src/bool-array.h:55:1: unterminated #ifdef /vol/vol0/users/des/tinderbox/CURRENT/ia64/ia64/src/contrib/gperf/src/bool-array.h:27:1: unterminated #ifndef *** Error code 1 Stop in /vol/vol0/users/des/tinderbox/CURRENT/ia64/ia64/src/gnu/usr.bin/gperf. *** Error code 1 Stop in /vol/vol0/users/des/tinderbox/CURRENT/ia64/ia64/src. *** Error code 1 Stop in /vol/vol0/users/des/tinderbox/CURRENT/ia64/ia64/src. *** Error code 1 Stop in /vol/vol0/users/des/tinderbox/CURRENT/ia64/ia64/src. TB --- 2003-06-01 20:15:40 - /usr/bin/make returned exit code 1 TB --- 2003-06-01 20:15:40 - ERROR: failed to build world TB --- 2003-06-01 20:15:40 - tinderbox aborted From owner-freebsd-ia64@FreeBSD.ORG Sun Jun 1 22:21:00 2003 Return-Path: Delivered-To: freebsd-ia64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DC77F37B401; Sun, 1 Jun 2003 22:21:00 -0700 (PDT) Received: from cueball.rtp.FreeBSD.org (cueball.rtp.FreeBSD.org [192.58.184.37]) by mx1.FreeBSD.org (Postfix) with ESMTP id 18F9C43F75; Sun, 1 Jun 2003 22:21:00 -0700 (PDT) (envelope-from des+tinderbox@freebsd.org) Received: from cueball.rtp.FreeBSD.org (localhost [127.0.0.1]) h525KYkF016179; Mon, 2 Jun 2003 01:20:34 -0400 (EDT) (envelope-from des+tinderbox@freebsd.org) Received: (from des@localhost) by cueball.rtp.FreeBSD.org (8.12.9/8.12.9/Submit) id h525KYmB016178; Mon, 2 Jun 2003 05:20:34 GMT (envelope-from des+tinderbox@freebsd.org) Date: Mon, 2 Jun 2003 05:20:34 GMT Message-Id: <200306020520.h525KYmB016178@cueball.rtp.FreeBSD.org> X-Authentication-Warning: cueball.rtp.FreeBSD.org: des set sender to Tinderbox using -f Sender: Tinderbox From: Tinderbox To: current@freebsd.org, ia64@freebsd.org Subject: [-CURRENT tinderbox] failure on ia64/ia64 X-BeenThere: freebsd-ia64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting FreeBSD to the IA-64 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jun 2003 05:21:01 -0000 TB --- 2003-06-02 04:25:20 - starting CURRENT tinderbox run for ia64/ia64 TB --- 2003-06-02 04:25:20 - checking out the source tree TB --- cd /home/des/tinderbox/CURRENT/ia64/ia64 TB --- /usr/bin/cvs -f -R -q -d/home/ncvs update -Pd -A src TB --- 2003-06-02 04:26:47 - building world TB --- cd /home/des/tinderbox/CURRENT/ia64/ia64/src TB --- /usr/bin/make -B buildworld >>> Rebuilding the temporary build tree >>> stage 1: legacy release compatibility shims >>> stage 1: bootstrap tools >>> stage 2: cleaning up the object tree >>> stage 2: rebuilding the object tree >>> stage 2: build tools >>> stage 3: cross tools >>> stage 4: populating /home/des/tinderbox/CURRENT/ia64/ia64/obj/ia64/vol/vol0/users/des/tinderbox/CURRENT/ia64/ia64/src/i386/usr/include >>> stage 4: building libraries >>> stage 4: make dependencies >>> stage 4: building everything.. [...] /home/des/tinderbox/CURRENT/ia64/ia64/obj/ia64/vol/vol0/users/des/tinderbox/CURRENT/ia64/ia64/src/i386/usr/include/stdlib.h:135: warning: ISO C89 does not support `long long' /home/des/tinderbox/CURRENT/ia64/ia64/obj/ia64/vol/vol0/users/des/tinderbox/CURRENT/ia64/ia64/src/i386/usr/include/stdlib.h:140: warning: ISO C89 does not support `long long' /home/des/tinderbox/CURRENT/ia64/ia64/obj/ia64/vol/vol0/users/des/tinderbox/CURRENT/ia64/ia64/src/i386/usr/include/stdlib.h:143: warning: ISO C89 does not support `long long' /home/des/tinderbox/CURRENT/ia64/ia64/obj/ia64/vol/vol0/users/des/tinderbox/CURRENT/ia64/ia64/src/i386/usr/include/stdlib.h:143: warning: ISO C89 does not support `long long' /home/des/tinderbox/CURRENT/ia64/ia64/obj/ia64/vol/vol0/users/des/tinderbox/CURRENT/ia64/ia64/src/i386/usr/include/stdlib.h:145: warning: ISO C89 does not support `long long' /home/des/tinderbox/CURRENT/ia64/ia64/obj/ia64/vol/vol0/users/des/tinderbox/CURRENT/ia64/ia64/src/i386/usr/include/stdlib.h:145: warning: ISO C89 does not support `long long' /home/des/tinderbox/CURRENT/ia64/ia64/obj/ia64/vol/vol0/users/des/tinderbox/CURRENT/ia64/ia64/src/i386/usr/include/stdlib.h:148: warning: ISO C89 does not support `long long' /home/des/tinderbox/CURRENT/ia64/ia64/obj/ia64/vol/vol0/users/des/tinderbox/CURRENT/ia64/ia64/src/i386/usr/include/stdlib.h:151: warning: ISO C89 does not support `long long' *** Error code 1 Stop in /vol/vol0/users/des/tinderbox/CURRENT/ia64/ia64/src/sbin/nfsiod. *** Error code 1 Stop in /vol/vol0/users/des/tinderbox/CURRENT/ia64/ia64/src/sbin. *** Error code 1 Stop in /vol/vol0/users/des/tinderbox/CURRENT/ia64/ia64/src. *** Error code 1 Stop in /vol/vol0/users/des/tinderbox/CURRENT/ia64/ia64/src. *** Error code 1 Stop in /vol/vol0/users/des/tinderbox/CURRENT/ia64/ia64/src. TB --- 2003-06-02 05:20:34 - /usr/bin/make returned exit code 1 TB --- 2003-06-02 05:20:34 - ERROR: failed to build world TB --- 2003-06-02 05:20:34 - tinderbox aborted From owner-freebsd-ia64@FreeBSD.ORG Mon Jun 2 04:31:20 2003 Return-Path: Delivered-To: freebsd-ia64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 23E5F37B404 for ; Mon, 2 Jun 2003 04:31:20 -0700 (PDT) Received: from plim.fujitsu-siemens.com (plim.fujitsu-siemens.com [217.115.66.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id B8DD043FDD for ; Mon, 2 Jun 2003 04:31:17 -0700 (PDT) (envelope-from alan.robinson@fujitsu-siemens.com) Received: from trulli.pdb.fsc.net (new-trulli.pdb.fsc.net [172.25.96.53]) h52BVFv32287; Mon, 2 Jun 2003 13:31:15 +0200 Received: from athen.mch.fsc.net (backbay.mch.fsc.net [172.25.94.188]) by trulli.pdb.fsc.net (8.11.6/8.11.6) with ESMTP id h52BVFV14866; Mon, 2 Jun 2003 13:31:15 +0200 Received: from sanpedro.mch.fsc.net (sanpedro [172.25.95.234]) by athen.mch.fsc.net (8.11.6/8.11.6) with ESMTP id h52BVEI02093; Mon, 2 Jun 2003 13:31:14 +0200 (MDT) Received: (from robin@localhost) by sanpedro.mch.fsc.net (8.9.3p2/8.9.3/Debian 8.9.3-21) id NAA29129; Mon, 2 Jun 2003 13:31:13 +0200 From: Alan Robinson Date: Mon, 2 Jun 2003 13:31:12 +0200 To: Marcel Moolenaar Message-ID: <20030602133112.A3892@fujitsu-siemens.com> References: <20030530132408.A3690@fujitsu-siemens.com> <20030530173029.GB568@dhcp01.pn.xcllnt.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20030530173029.GB568@dhcp01.pn.xcllnt.net>; from marcel@xcllnt.net on Fri, May 30, 2003 at 10:30:29AM -0700 X-sent-by-me: robin@sanpedro cc: freebsd-ia64@freebsd.org Subject: Re: /dev/kmem read return value is double requested value X-BeenThere: freebsd-ia64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Alan.Robinson@fujitsu-siemens.com List-Id: Porting FreeBSD to the IA-64 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jun 2003 11:31:20 -0000 On Fri, May 30, 2003 at 10:30:29AM -0700, Marcel Moolenaar wrote: > > On Fri, May 30, 2003 at 01:24:08PM +0200, Alan Robinson wrote: > > > > I was playing with a user-land program that read some data out > > of the kernel memory and noticed that the read() return value was > > twice what I was expecting. I think the error is in the mmrw() function > > in file sys/ia64/ia64/mem.c, removing the following lines seems to > > fix the problem. > > > > iov->iov_base = (char *)iov->iov_base + c; > > iov->iov_len -= c; > > uio->uio_offset += c; > > uio->uio_resid -= c; > > > > I had a little look at some of the other sys/ARCH/ARCH/mem.c and some others > > seem to contain the same code so I might be wrong, then again so might the > > ARCHs. > > If you see behaviour that's not particular to ia64, it's probably better > to post to arch@ or current@. More people hang out there, so there's a > bigger chance you get replies. > Maybe I framed my statement incorrectly: I only have access to an i386 (4.6) and an ia64(5.0), the ia64 is the only system that shows the problem. The i386 with 4.6 does NOT have this problem. While looking arround I also saw that the same code is in various ARCH/ARCH/mem.c files, if they really have a problem or not I cannot say. > I don't think there's anything wrong with the lines you think we need to > remove. > I still think they are wrong, there is a uiomove() call which does exactly this fixup for uio several lines before and the iov gets reset at the top. > > Note that the actual data transfered is OK, just the read() return value > > and the /dev/kmem file offset are wrong after returning from the read(). > > It helps if you demonstrate the behaviour with some trivial test program > that people can run too. > You are quite correct. I didn't even say the problem only seems to show up when trying to read info from kld loaded drivers, an example. (I have added the trymem.c source below) madison# kldstat Id Refs Address Size Name 1 3 0xe000000000500000 639448 kernel 2 1 0xa000000004768000 24000 if_fxp.ko read some stuff from the kernel: madison# ./trymem 0xe000000000500000 8 o=e000000000500000, sz=8 lseek xe000000000500000 read(,,x8) rc=x8 lseek(,0,SEEK_CUR) p=xe000000000500008 madison# This seems to be OK. read some stuff from the if_fxp.ko module: madison# ./trymem 0xa000000004768000 8 o=a000000004768000, sz=8 lseek xa000000004768000 read(,,x8) rc=x10 read rc=x10, sz=x8 ! lseek(,0,SEEK_CUR) p=xa000000004768010 lseek(,0,SEEK_CUR) p=xa000000004768010, !=xa000000004768008 ! madison# This is WRONG, the read returns twice the length and the lseek offset is also wrong but consistent with the incorrect rc. After removing the said lines from mem.c trymem works OK for both kernel and if_fxp.ko addresses. Alan -trymem.c-------trymem.c-------trymem.c--------trymem.c--------trymem.c------- #include #include #include #include #include #include #include #define FN "/dev/kmem" int main(int argc, char *argv[]) { int fd, rc; unsigned long o,p; int sz; char buf[16 * 1024]; if (argc < 2) { printf("usage: %s
\n", argv[0]); exit(1); } o = strtoull(argv[1], NULL, 0); sz = strtol(argv[2], NULL, 0); printf("o=%lx, sz=%x\n",o,sz); if (sz > (16 *1024)) { printf("size to large\n"); exit(-1); } fd = open(FN, O_RDONLY); if ( fd < 0) { perror("cannot open " FN); exit(-1); } printf("lseek x%lx\n",o); p = lseek(fd,o,SEEK_SET); if ( o != p ) { printf("lseek x%lx error\n",o); } rc = read(fd,buf,sz); printf("read(,,x%x) rc=x%x\n",sz,rc); if ( rc != sz ) { printf("read rc=x%x, sz=x%x !\n",rc,sz); } p = lseek(fd,(unsigned long)0,SEEK_CUR); printf("lseek(,0,SEEK_CUR) p=x%lx\n",p); if (p != (o + (unsigned long)sz)) { printf("lseek(,0,SEEK_CUR) p=x%lx, !=x%lx !\n",p,(o + (unsigned long)sz)); } close(fd); return (0); } ------------------------------------------------------------------------------- From owner-freebsd-ia64@FreeBSD.ORG Mon Jun 2 14:43:25 2003 Return-Path: Delivered-To: freebsd-ia64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8AB9B37B41D; Mon, 2 Jun 2003 14:43:25 -0700 (PDT) Received: from ns1.xcllnt.net (209-128-86-226.BAYAREA.NET [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 69B0443F3F; Mon, 2 Jun 2003 14:43:24 -0700 (PDT) (envelope-from marcel@xcllnt.net) Received: from dhcp01.pn.xcllnt.net (dhcp01.pn.xcllnt.net [192.168.4.201]) by ns1.xcllnt.net (8.12.9/8.12.9) with ESMTP id h52LhOwk003856; Mon, 2 Jun 2003 14:43:24 -0700 (PDT) (envelope-from marcel@piii.pn.xcllnt.net) Received: from dhcp01.pn.xcllnt.net (localhost [127.0.0.1]) by dhcp01.pn.xcllnt.net (8.12.9/8.12.9) with ESMTP id h52LhOfA001403; Mon, 2 Jun 2003 14:43:24 -0700 (PDT) (envelope-from marcel@dhcp01.pn.xcllnt.net) Received: (from marcel@localhost) by dhcp01.pn.xcllnt.net (8.12.9/8.12.9/Submit) id h52LhNA3001402; Mon, 2 Jun 2003 14:43:23 -0700 (PDT) Date: Mon, 2 Jun 2003 14:43:23 -0700 From: Marcel Moolenaar To: hubs@FreeBSD.org Message-ID: <20030602214323.GA1345@dhcp01.pn.xcllnt.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.4i cc: ia64@FreeBSD.org Subject: 5.1-RC1 for ia64 in the works X-BeenThere: freebsd-ia64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting FreeBSD to the IA-64 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jun 2003 21:43:26 -0000 Gang, This is an advance notice that ia64 will be joining the 5.1-RC1 circus if all goes well. A release is currently being built and I expect it to be finished this evening. This means that if all goes well, I can have the ISOs uploaded some time tomorrow. As for ia64 packages: the machines that build the packages lock up every couple of hours for reasons yet unknown. Unless Kris decides differently: no packages. I'll send out a final notice when the ISOs are uploaded (to hubs@) or when I give up on it (to both hubs@ and ia64@). Whichever comes first. As for the contents: the ia64 release will come from the official 5.1 branch, with kernel patches applied. The patches will allow the release to be usable on both Intel and HP machines (among other things). FYI, -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net From owner-freebsd-ia64@FreeBSD.ORG Mon Jun 2 14:51:58 2003 Return-Path: Delivered-To: freebsd-ia64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 28A6F37B401 for ; Mon, 2 Jun 2003 14:51:58 -0700 (PDT) Received: from ns1.xcllnt.net (209-128-86-226.BAYAREA.NET [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3E0F343F75 for ; Mon, 2 Jun 2003 14:51:57 -0700 (PDT) (envelope-from marcel@xcllnt.net) Received: from dhcp01.pn.xcllnt.net (dhcp01.pn.xcllnt.net [192.168.4.201]) by ns1.xcllnt.net (8.12.9/8.12.9) with ESMTP id h52Lpvwk003934; Mon, 2 Jun 2003 14:51:57 -0700 (PDT) (envelope-from marcel@piii.pn.xcllnt.net) Received: from dhcp01.pn.xcllnt.net (localhost [127.0.0.1]) by dhcp01.pn.xcllnt.net (8.12.9/8.12.9) with ESMTP id h52LpufA001432; Mon, 2 Jun 2003 14:51:56 -0700 (PDT) (envelope-from marcel@dhcp01.pn.xcllnt.net) Received: (from marcel@localhost) by dhcp01.pn.xcllnt.net (8.12.9/8.12.9/Submit) id h52Lpuqs001431; Mon, 2 Jun 2003 14:51:56 -0700 (PDT) Date: Mon, 2 Jun 2003 14:51:56 -0700 From: Marcel Moolenaar To: Alan Robinson Message-ID: <20030602215156.GB1345@dhcp01.pn.xcllnt.net> References: <20030530132408.A3690@fujitsu-siemens.com> <20030530173029.GB568@dhcp01.pn.xcllnt.net> <20030602133112.A3892@fujitsu-siemens.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030602133112.A3892@fujitsu-siemens.com> User-Agent: Mutt/1.5.4i cc: freebsd-ia64@freebsd.org Subject: Re: /dev/kmem read return value is double requested value X-BeenThere: freebsd-ia64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting FreeBSD to the IA-64 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jun 2003 21:51:58 -0000 On Mon, Jun 02, 2003 at 01:31:12PM +0200, Alan Robinson wrote: > > > > It helps if you demonstrate the behaviour with some trivial test program > > that people can run too. > > > You are quite correct. I didn't even say the problem only seems to show > up when trying to read info from kld loaded drivers, an example. That's odd. And yes, that can't be right :-) I'll take a look at it when I have a spare cycle. Thanks, -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net From owner-freebsd-ia64@FreeBSD.ORG Mon Jun 2 23:50:56 2003 Return-Path: Delivered-To: freebsd-ia64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E823A37B404 for ; Mon, 2 Jun 2003 23:50:56 -0700 (PDT) Received: from plim.fujitsu-siemens.com (plim.fujitsu-siemens.com [217.115.66.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id 412B943F75 for ; Mon, 2 Jun 2003 23:50:55 -0700 (PDT) (envelope-from alan.robinson@fujitsu-siemens.com) Received: from trulli.pdb.fsc.net (new-trulli.pdb.fsc.net [172.25.96.53]) h536osv13859; Tue, 3 Jun 2003 08:50:54 +0200 Received: from athen.mch.fsc.net (backbay.mch.fsc.net [172.25.94.188]) by trulli.pdb.fsc.net (8.11.6/8.11.6) with ESMTP id h536orV28974; Tue, 3 Jun 2003 08:50:53 +0200 Received: from sanpedro.mch.fsc.net (sanpedro [172.25.95.234]) by athen.mch.fsc.net (8.11.6/8.11.6) with ESMTP id h536oqI00613; Tue, 3 Jun 2003 08:50:52 +0200 (MDT) Received: (from robin@localhost) by sanpedro.mch.fsc.net (8.9.3p2/8.9.3/Debian 8.9.3-21) id IAA16264; Tue, 3 Jun 2003 08:50:52 +0200 From: Alan Robinson Date: Tue, 3 Jun 2003 08:50:52 +0200 To: Marcel Moolenaar Message-ID: <20030603085052.A2520@fujitsu-siemens.com> References: <20030530132408.A3690@fujitsu-siemens.com> <20030530173029.GB568@dhcp01.pn.xcllnt.net> <20030602133112.A3892@fujitsu-siemens.com> <20030602215156.GB1345@dhcp01.pn.xcllnt.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20030602215156.GB1345@dhcp01.pn.xcllnt.net>; from marcel@xcllnt.net on Mon, Jun 02, 2003 at 02:51:56PM -0700 X-sent-by-me: robin@sanpedro cc: freebsd-ia64@freebsd.org Subject: Re: /dev/kmem read return value is double requested value X-BeenThere: freebsd-ia64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Alan.Robinson@fujitsu-siemens.com List-Id: Porting FreeBSD to the IA-64 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2003 06:50:57 -0000 On Mon, Jun 02, 2003 at 02:51:56PM -0700, Marcel Moolenaar wrote: > On Mon, Jun 02, 2003 at 01:31:12PM +0200, Alan Robinson wrote: > > > > > > It helps if you demonstrate the behaviour with some trivial test program > > > that people can run too. > > > > > You are quite correct. I didn't even say the problem only seems to show > > up when trying to read info from kld loaded drivers, an example. > > That's odd. And yes, that can't be right :-) > It's a special offer, buy one byte get a second one free > I'll take a look at it when I have a spare cycle. > I compared the ia64/i386 mmrw() and another answer is to add a 'continue' after the /dev/kmem uiomove just like in i386. I bet the 4 lines are still junk left over from a previous life when the uiomove was a copyout? Alan From owner-freebsd-ia64@FreeBSD.ORG Tue Jun 3 01:04:15 2003 Return-Path: Delivered-To: freebsd-ia64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 570B737B405 for ; Tue, 3 Jun 2003 01:04:15 -0700 (PDT) Received: from ns1.xcllnt.net (209-128-86-226.BAYAREA.NET [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 357A243F3F for ; Tue, 3 Jun 2003 01:04:14 -0700 (PDT) (envelope-from marcel@xcllnt.net) Received: from dhcp01.pn.xcllnt.net (dhcp01.pn.xcllnt.net [192.168.4.201]) by ns1.xcllnt.net (8.12.9/8.12.9) with ESMTP id h5384Dwk007387; Tue, 3 Jun 2003 01:04:13 -0700 (PDT) (envelope-from marcel@piii.pn.xcllnt.net) Received: from dhcp01.pn.xcllnt.net (localhost [127.0.0.1]) by dhcp01.pn.xcllnt.net (8.12.9/8.12.9) with ESMTP id h5384DfA003511; Tue, 3 Jun 2003 01:04:13 -0700 (PDT) (envelope-from marcel@dhcp01.pn.xcllnt.net) Received: (from marcel@localhost) by dhcp01.pn.xcllnt.net (8.12.9/8.12.9/Submit) id h5384DrB003510; Tue, 3 Jun 2003 01:04:13 -0700 (PDT) Date: Tue, 3 Jun 2003 01:04:13 -0700 From: Marcel Moolenaar To: Alan Robinson Message-ID: <20030603080413.GA3382@dhcp01.pn.xcllnt.net> References: <20030530132408.A3690@fujitsu-siemens.com> <20030530173029.GB568@dhcp01.pn.xcllnt.net> <20030602133112.A3892@fujitsu-siemens.com> <20030602215156.GB1345@dhcp01.pn.xcllnt.net> <20030603085052.A2520@fujitsu-siemens.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="45Z9DzgjV8m4Oswq" Content-Disposition: inline In-Reply-To: <20030603085052.A2520@fujitsu-siemens.com> User-Agent: Mutt/1.5.4i cc: freebsd-ia64@freebsd.org Subject: Re: /dev/kmem read return value is double requested value X-BeenThere: freebsd-ia64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting FreeBSD to the IA-64 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2003 08:04:15 -0000 --45Z9DzgjV8m4Oswq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Jun 03, 2003 at 08:50:52AM +0200, Alan Robinson wrote: > > I'll take a look at it when I have a spare cycle. > > > I compared the ia64/i386 mmrw() and another answer is to add > a 'continue' after the /dev/kmem uiomove just like in i386. Spot on. See sys/alpha/alpha/mem.c rev. 1.32. And also rev 1.24. mmrw() has a history of double counting :-( > I bet the 4 lines are still junk left over from a previous life > when the uiomove was a copyout? Dunno. It may be leftovers from when //mem.c had to handle /dev/zero, /dev/urandom and the likes. There's another bug in sys/ia64/ia64/mem.c: we're missing a default case for the minor device number... I have a cleaned version ready to be committed. I need to wait for my box to free up. Thanks! PS: attached the (untested) patch currently in my tree. -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net --45Z9DzgjV8m4Oswq Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="mem.diff" Index: mem.c =================================================================== RCS file: /home/ncvs/src/sys/ia64/ia64/mem.c,v retrieving revision 1.13 diff -u -r1.13 mem.c --- mem.c 25 Mar 2003 00:07:03 -0000 1.13 +++ mem.c 3 Jun 2003 07:52:40 -0000 @@ -139,12 +139,11 @@ static int mmrw(dev_t dev, struct uio *uio, int flags) { - vm_offset_t o, v; - int c = 0; struct iovec *iov; - int error = 0, rw; - vm_offset_t addr, eaddr; + vm_offset_t addr, eaddr, o, v; + int c, error, rw; + error = 0; while (uio->uio_resid > 0 && !error) { iov = uio->uio_iov; if (iov->iov_len == 0) { @@ -154,6 +153,7 @@ panic("mmrw"); continue; } + switch (minor(dev)) { /* minor device 0 is physical memory */ @@ -161,7 +161,8 @@ v = uio->uio_offset; kmemphys: /* Allow reads only in RAM. */ - rw = (uio->uio_rw == UIO_READ) ? VM_PROT_READ : VM_PROT_WRITE; + rw = (uio->uio_rw == UIO_READ) + ? VM_PROT_READ : VM_PROT_WRITE; if ((ia64_pa_access(v) & rw) != rw) { error = EFAULT; c = 0; @@ -170,8 +171,7 @@ o = uio->uio_offset & PAGE_MASK; c = min(uio->uio_resid, (int)(PAGE_SIZE - o)); - error = - uiomove((caddr_t)IA64_PHYS_TO_RR7(v), c, uio); + error = uiomove((caddr_t)IA64_PHYS_TO_RR7(v), c, uio); continue; /* minor device 1 is kernel memory */ @@ -184,22 +184,26 @@ } c = min(iov->iov_len, MAXPHYS); + /* - * Make sure that all of the pages are currently resident so - * that we don't create any zero-fill pages. + * Make sure that all of the pages are currently + * resident so that we don't create any zero-fill + * pages. */ addr = trunc_page(v); eaddr = round_page(v + c); - for (; addr < eaddr; addr += PAGE_SIZE) - if (pmap_extract(kernel_pmap, addr) == 0) { - return EFAULT; - } - if (!kernacc((caddr_t)v, c, - uio->uio_rw == UIO_READ ? - VM_PROT_READ : VM_PROT_WRITE)) { - return (EFAULT); + for (; addr < eaddr; addr += PAGE_SIZE) { + if (pmap_extract(kernel_pmap, addr) == 0) + return (EFAULT); } + if (!kernacc((caddr_t)v, c, (uio->uio_rw == UIO_READ) + ? VM_PROT_READ : VM_PROT_WRITE)) + return (EFAULT); error = uiomove((caddr_t)v, c, uio); + continue; + + default: + return (ENODEV); } if (error) --45Z9DzgjV8m4Oswq-- From owner-freebsd-ia64@FreeBSD.ORG Tue Jun 3 02:01:17 2003 Return-Path: Delivered-To: freebsd-ia64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B538A37B401; Tue, 3 Jun 2003 02:01:17 -0700 (PDT) Received: from cueball.rtp.FreeBSD.org (cueball.rtp.FreeBSD.org [192.58.184.37]) by mx1.FreeBSD.org (Postfix) with ESMTP id BA2D143F85; Tue, 3 Jun 2003 02:01:16 -0700 (PDT) (envelope-from des+tinderbox@freebsd.org) Received: from cueball.rtp.FreeBSD.org (localhost [127.0.0.1]) h5390jkF044578; Tue, 3 Jun 2003 05:00:45 -0400 (EDT) (envelope-from des+tinderbox@freebsd.org) Received: (from des@localhost) by cueball.rtp.FreeBSD.org (8.12.9/8.12.9/Submit) id h5390jva044577; Tue, 3 Jun 2003 09:00:45 GMT (envelope-from des+tinderbox@freebsd.org) Date: Tue, 3 Jun 2003 09:00:45 GMT Message-Id: <200306030900.h5390jva044577@cueball.rtp.FreeBSD.org> X-Authentication-Warning: cueball.rtp.FreeBSD.org: des set sender to Tinderbox using -f Sender: Tinderbox From: Tinderbox To: current@freebsd.org, ia64@freebsd.org Subject: [-CURRENT tinderbox] failure on ia64/ia64 X-BeenThere: freebsd-ia64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting FreeBSD to the IA-64 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2003 09:01:18 -0000 TB --- 2003-06-03 08:15:43 - starting CURRENT tinderbox run for ia64/ia64 TB --- 2003-06-03 08:15:43 - checking out the source tree TB --- cd /home/des/tinderbox/CURRENT/ia64/ia64 TB --- /usr/bin/cvs -f -R -q -d/home/ncvs update -Pd -A src TB --- 2003-06-03 08:23:12 - building world TB --- cd /home/des/tinderbox/CURRENT/ia64/ia64/src TB --- /usr/bin/make -B buildworld >>> Rebuilding the temporary build tree >>> stage 1: legacy release compatibility shims >>> stage 1: bootstrap tools >>> stage 2: cleaning up the object tree >>> stage 2: rebuilding the object tree >>> stage 2: build tools >>> stage 3: cross tools >>> stage 4: populating /home/des/tinderbox/CURRENT/ia64/ia64/obj/ia64/vol/vol0/users/des/tinderbox/CURRENT/ia64/ia64/src/i386/usr/include >>> stage 4: building libraries [...] cc -O -pipe -DPTHREAD_KERNEL -D_THREAD_SAFE -I/vol/vol0/users/des/tinderbox/CURRENT/ia64/ia64/src/lib/libthr/../libc/include -I/vol/vol0/users/des/tinderbox/CURRENT/ia64/ia64/src/lib/libthr/thread -I/vol/vol0/users/des/tinderbox/CURRENT/ia64/ia64/src/lib/libthr/../../include -D_PTHREADS_INVARIANTS -g -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -c /vol/vol0/users/des/tinderbox/CURRENT/ia64/ia64/src/lib/libthr/thread/thr_getprio.c -o thr_getprio.o cc -O -pipe -DPTHREAD_KERNEL -D_THREAD_SAFE -I/vol/vol0/users/des/tinderbox/CURRENT/ia64/ia64/src/lib/libthr/../libc/include -I/vol/vol0/users/des/tinderbox/CURRENT/ia64/ia64/src/lib/libthr/thread -I/vol/vol0/users/des/tinderbox/CURRENT/ia64/ia64/src/lib/libthr/../../include -D_PTHREADS_INVARIANTS -g -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -c /vol/vol0/users/des/tinderbox/CURRENT/ia64/ia64/src/lib/libthr/thread/thr_getschedparam.c -o thr_getschedparam.o cc -O -pipe -DPTHREAD_KERNEL -D_THREAD_SAFE -I/vol/vol0/users/des/tinderbox/CURRENT/ia64/ia64/src/lib/libthr/../libc/include -I/vol/vol0/users/des/tinderbox/CURRENT/ia64/ia64/src/lib/libthr/thread -I/vol/vol0/users/des/tinderbox/CURRENT/ia64/ia64/src/lib/libthr/../../include -D_PTHREADS_INVARIANTS -g -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -c /vol/vol0/users/des/tinderbox/CURRENT/ia64/ia64/src/lib/libthr/thread/thr_info.c -o thr_info.o cc -O -pipe -DPTHREAD_KERNEL -D_THREAD_SAFE -I/vol/vol0/users/des/tinderbox/CURRENT/ia64/ia64/src/lib/libthr/../libc/include -I/vol/vol0/users/des/tinderbox/CURRENT/ia64/ia64/src/lib/libthr/thread -I/vol/vol0/users/des/tinderbox/CURRENT/ia64/ia64/src/lib/libthr/../../include -D_PTHREADS_INVARIANTS -g -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -c /vol/vol0/users/des/tinderbox/CURRENT/ia64/ia64/src/lib/libthr/thread/thr_init.c -o thr_init.o cc1: warnings being treated as errors In file included from /vol/vol0/users/des/tinderbox/CURRENT/ia64/ia64/src/lib/libthr/thread/thr_init.c:67: /vol/vol0/users/des/tinderbox/CURRENT/ia64/ia64/src/lib/libthr/thread/thr_private.h:677: warning: excess elements in struct initializer /vol/vol0/users/des/tinderbox/CURRENT/ia64/ia64/src/lib/libthr/thread/thr_private.h:677: warning: (near initialization for `_giant_mutex') *** Error code 1 Stop in /vol/vol0/users/des/tinderbox/CURRENT/ia64/ia64/src/lib/libthr. *** Error code 1 Stop in /vol/vol0/users/des/tinderbox/CURRENT/ia64/ia64/src/lib. *** Error code 1 Stop in /vol/vol0/users/des/tinderbox/CURRENT/ia64/ia64/src. *** Error code 1 Stop in /vol/vol0/users/des/tinderbox/CURRENT/ia64/ia64/src. *** Error code 1 Stop in /vol/vol0/users/des/tinderbox/CURRENT/ia64/ia64/src. *** Error code 1 Stop in /vol/vol0/users/des/tinderbox/CURRENT/ia64/ia64/src. TB --- 2003-06-03 09:00:45 - /usr/bin/make returned exit code 1 TB --- 2003-06-03 09:00:45 - ERROR: failed to build world TB --- 2003-06-03 09:00:45 - tinderbox aborted From owner-freebsd-ia64@FreeBSD.ORG Tue Jun 3 15:11:25 2003 Return-Path: Delivered-To: freebsd-ia64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9DCFC37B401 for ; Tue, 3 Jun 2003 15:11:25 -0700 (PDT) Received: from hermes.sc.intel.com (fmr03.intel.com [143.183.121.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id 04DFF43FBD for ; Tue, 3 Jun 2003 15:11:25 -0700 (PDT) (envelope-from arun.sharma@intel.com) Received: from petasus.sc.intel.com (petasus.sc.intel.com [10.3.253.4]) 21:17:36 rfjohns1 Exp $) with ESMTP id h53M7d428986; Tue, 3 Jun 2003 22:07:39 GMT Received: from unix-os.sc.intel.com (unix-os.sc.intel.com [143.183.96.244]) 2003/05/22 21:18:01 rfjohns1 Exp $) with ESMTP id h53MA3620752; Tue, 3 Jun 2003 22:10:03 GMT Received: from intel.com (arun-desktop.sc.intel.com [143.183.85.194]) by unix-os.sc.intel.com (8.11.6/8.11.2) with ESMTP id h53MBH116017; Tue, 3 Jun 2003 15:11:18 -0700 Message-ID: <3EDD1CF9.9050202@intel.com> Date: Tue, 03 Jun 2003 15:11:05 -0700 From: Arun Sharma User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Marcel Moolenaar References: <20030530173827.GD90937@dragon.nuxi.com> <20030530180807.GD568@dhcp01.pn.xcllnt.net> In-Reply-To: <20030530180807.GD568@dhcp01.pn.xcllnt.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-ia64@freebsd.org Subject: Re: (FWD) Does gcc violate the ia64 ABI? X-BeenThere: freebsd-ia64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting FreeBSD to the IA-64 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2003 22:11:25 -0000 Marcel Moolenaar wrote: >>https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=91056 > > I don't think gcc violates the runtime. There's no requirement to > save and restore gp in a function if that function does not need > or use gp itself. Suppose we have the following call-graph: > > foo->bar->baz > > foo() cannot assume that when bar() returns, gp has the value that > corresponds to bar(). If foo and bar are in the same load module, then an ia64 ABI compliant compiler might want to optimize the call, by not restoring the gp, because the ABI guarantees that the gp is valid for bar (and hence valid for foo), on exit from bar. If most of your call/return sequences are local, that's a win. -Arun From owner-freebsd-ia64@FreeBSD.ORG Wed Jun 4 15:01:59 2003 Return-Path: Delivered-To: freebsd-ia64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6D46237B401 for ; Wed, 4 Jun 2003 15:01:59 -0700 (PDT) Received: from ns1.xcllnt.net (209-128-86-226.bayarea.net [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 99CF843FBF for ; Wed, 4 Jun 2003 15:01:58 -0700 (PDT) (envelope-from marcel@xcllnt.net) Received: from athlon.pn.xcllnt.net (athlon.pn.xcllnt.net [192.168.4.3]) by ns1.xcllnt.net (8.12.9/8.12.9) with ESMTP id h54M1wwk019651; Wed, 4 Jun 2003 15:01:58 -0700 (PDT) (envelope-from marcel@piii.pn.xcllnt.net) Received: from athlon.pn.xcllnt.net (localhost [127.0.0.1]) by athlon.pn.xcllnt.net (8.12.9/8.12.9) with ESMTP id h54M1wK2002423; Wed, 4 Jun 2003 15:01:58 -0700 (PDT) (envelope-from marcel@athlon.pn.xcllnt.net) Received: (from marcel@localhost) by athlon.pn.xcllnt.net (8.12.9/8.12.9/Submit) id h54M1vek002422; Wed, 4 Jun 2003 15:01:57 -0700 (PDT) Date: Wed, 4 Jun 2003 15:01:57 -0700 From: Marcel Moolenaar To: Alan Robinson Message-ID: <20030604220157.GA2368@athlon.pn.xcllnt.net> References: <20030530132408.A3690@fujitsu-siemens.com> <20030530173029.GB568@dhcp01.pn.xcllnt.net> <20030602133112.A3892@fujitsu-siemens.com> <20030602215156.GB1345@dhcp01.pn.xcllnt.net> <20030603085052.A2520@fujitsu-siemens.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030603085052.A2520@fujitsu-siemens.com> User-Agent: Mutt/1.5.4i cc: freebsd-ia64@freebsd.org Subject: Re: /dev/kmem read return value is double requested value X-BeenThere: freebsd-ia64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting FreeBSD to the IA-64 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2003 22:01:59 -0000 On Tue, Jun 03, 2003 at 08:50:52AM +0200, Alan Robinson wrote: > > > I'll take a look at it when I have a spare cycle. > > > I compared the ia64/i386 mmrw() and another answer is to add > a 'continue' after the /dev/kmem uiomove just like in i386. Fix committed. Thanks. BTW: don't try to read from the direct mapped regions (region 6 or region 7) with an address that uses the unimplemented phys. address bits. Instant machine check. I don't know what happens if the physical address is valid (from an architectural POV), but there's no memory installed at that address. Also, I don't know what happens if we access UC memory through region 7 (WB). In short: the direct mapped case is extremely buggy. -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net From owner-freebsd-ia64@FreeBSD.ORG Fri Jun 6 09:31:36 2003 Return-Path: Delivered-To: freebsd-ia64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1579C37B401 for ; Fri, 6 Jun 2003 09:31:36 -0700 (PDT) Received: from plim.fujitsu-siemens.com (plim.fujitsu-siemens.com [217.115.66.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id E2F8143F3F for ; Fri, 6 Jun 2003 09:31:33 -0700 (PDT) (envelope-from alan.robinson@fujitsu-siemens.com) Received: from trulli.pdb.fsc.net (this.is.a.RFC1918.address [172.25.96.53] (may be forged))h56GVWF29620 for ; Fri, 6 Jun 2003 18:31:32 +0200 Received: from athen.mch.fsc.net (backbay.mch.fsc.net [172.25.94.188]) by trulli.pdb.fsc.net (8.11.6/8.11.6) with ESMTP id h56GVVg15005; Fri, 6 Jun 2003 18:31:32 +0200 Received: from sanpedro.mch.fsc.net (sanpedro [172.25.95.234]) by athen.mch.fsc.net (8.11.6/8.11.6) with ESMTP id h56GVUI08466; Fri, 6 Jun 2003 18:31:31 +0200 (MDT) Received: (from robin@localhost) by sanpedro.mch.fsc.net (8.9.3p2/8.9.3/Debian 8.9.3-21) id SAA19851; Fri, 6 Jun 2003 18:31:30 +0200 From: Alan Robinson Date: Fri, 6 Jun 2003 18:31:30 +0200 To: freebsd-ia64@freebsd.org Message-ID: <20030606183130.A19592@fujitsu-siemens.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i X-sent-by-me: robin@sanpedro Subject: DDB and SMP causes Unaligned Reference X-BeenThere: freebsd-ia64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Alan.Robinson@fujitsu-siemens.com List-Id: Porting FreeBSD to the IA-64 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2003 16:31:36 -0000 Using the manual escape to debugger with an SMP kernel causes an unaligned reference while stopping the other CPU, the system then hangs. # # CPU1 stopping CPUs: 0x00000001... # fatal kernel trap (cpu 0): # # trap vector = 0x1e (Unaligned Reference) # cr.iip = 0xe0000000009a1320 # cr.ipsr = 0x1210080a6010 (mfl,ic,i,dt,dfh,rt,cpl=0,it,ri=1,bn) # cr.isr = 0x20200000000 (code=0,vector=0,w,ei=1) # cr.ifa = 0xe000000000004228 # curthread = 0xe00000003d9bb080 # pid = 12, comm = idle: cpu0 # CPU0 stopping CPUs: 0x00000002... # (The self built kernel was built using projects/ia64 cvsup'd sources which are now a day or two old) The cr.iip points into swapctx (or savectx) which was called from from interrupt() as follows.... } else if (vector == ipi_vector[IPI_STOP]) { u_int32_t mybit = PCPU_GET(cpumask); CTR1(KTR_SMP, "IPI_STOP, cpuid=%d", PCPU_GET(cpuid)); savectx(PCPU_GET(pcb)); stopped_cpus |= mybit; while ((started_cpus & mybit) == 0) /* spin */; started_cpus &= ~mybit; stopped_cpus &= ~mybit; if (PCPU_GET(cpuid) == 0 && cpustop_restartfunc != NULL) { void (*f)(void) = cpustop_restartfunc; cpustop_restartfunc = NULL; (*f)(); } I cannot find a place where PCU_SET(pcb) is used nor can I find a direct setting of pc_pcb :-( The following 2 line change in sys/ia64/ia64/mp_machdep.c fixes the problem for me. +static struct pcb ia64_intr_pcb[MAXCPU]; void cpu_mp_start() { struct pcpu *pc; ap_spin = 1; SLIST_FOREACH(pc, &cpuhead, pc_allcpu) { pc->pc_current_pmap = kernel_pmap; pc->pc_other_cpus = all_cpus & ~pc->pc_cpumask; + pc->pc_pcb = &(ia64_intr_pcb[pc->pc_cpuid]); if (pc->pc_cpuid > 0) { ap_stack = malloc(KSTACK_PAGES * PAGE_SIZE, M_PMAP, M_WAITOK); ap_pcpu = pc; ap_delay = 2000; ap_awake = 0; I can now get the following: # manual escape to debugger # CPU1 stopping CPUs: 0x00000001... stopped. # Stopped at Debugger+0x31: nop.m 0x0 # db> trace # Debugger(0xe000000000a10a78, 0xe000000000990bf0, 0x692) at Debugger+0x30 # scgetc(0xe0000000002ae800, 0x2, 0xe0000000011f2cb0) at scgetc+0xbe0 # sckbdevent(0xe000000000b232e8, 0x0, 0xe0000000002ae800) at sckbdevent+0x640 # ukbd_interrupt(0xe000000000b232e8, 0x0) at ukbd_interrupt+0x850 # ukbd_intr(0xe000000001167a00, 0xe000000000b232e8, 0x0) at ukbd_intr+0x80 # usb_transfer_complete(0xe000000001167a00, 0xe000000000ae6110) at usb_transfer_complete+0x400 # ohci_softintr(0xe0000000010ab000) at ohci_softintr+0x240 # usb_schedsoftintr(0xe0000000010ab000, 0xe000000000ae6110, 0xe0000000006728f0, 0x30a) at usb_schedsoftintr+0x50 # ohci_intr1(0xe0000000010ab000) at ohci_intr1+0x440 # ohci_intr(0xe0000000010ab000, 0xe0000000006f97b0, 0x1024) at ohci_intr+0x80 # ithread_loop(0xe0000000011a8200, 0xe000000001118100, 0xe000000000ae6110, 0xe000000000ab5590) at ithread_loop+0x460 # fork_exit(0xe000000000a1d4d8, 0xe0000000011a8200, 0xa000000000019580) at fork_exit+0x1b0 # enter_userland() at enter_userland # db> c # CPU1 restarting CPUs: 0x00000001... restarted. # manual escape to debugger # CPU0 stopping CPUs: 0x00000002... stopped. # Stopped at Debugger+0x31: nop.m 0x0 # db> c # CPU0 restarting CPUs: 0x00000002... restarted. # is the double continue normal ? Alan From owner-freebsd-ia64@FreeBSD.ORG Fri Jun 6 11:20:17 2003 Return-Path: Delivered-To: freebsd-ia64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 364A437B41D for ; Fri, 6 Jun 2003 11:20:17 -0700 (PDT) Received: from ns1.xcllnt.net (209-128-86-226.bayarea.net [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 572E243F93 for ; Fri, 6 Jun 2003 11:20:16 -0700 (PDT) (envelope-from marcel@xcllnt.net) Received: from dhcp01.pn.xcllnt.net (dhcp01.pn.xcllnt.net [192.168.4.201]) by ns1.xcllnt.net (8.12.9/8.12.9) with ESMTP id h56IKGwk032179; Fri, 6 Jun 2003 11:20:16 -0700 (PDT) (envelope-from marcel@piii.pn.xcllnt.net) Received: from dhcp01.pn.xcllnt.net (localhost [127.0.0.1]) by dhcp01.pn.xcllnt.net (8.12.9/8.12.9) with ESMTP id h56IKFa0000725; Fri, 6 Jun 2003 11:20:15 -0700 (PDT) (envelope-from marcel@dhcp01.pn.xcllnt.net) Received: (from marcel@localhost) by dhcp01.pn.xcllnt.net (8.12.9/8.12.9/Submit) id h56IKF0m000724; Fri, 6 Jun 2003 11:20:15 -0700 (PDT) Date: Fri, 6 Jun 2003 11:20:15 -0700 From: Marcel Moolenaar To: Alan Robinson Message-ID: <20030606182015.GC569@dhcp01.pn.xcllnt.net> References: <20030606183130.A19592@fujitsu-siemens.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030606183130.A19592@fujitsu-siemens.com> User-Agent: Mutt/1.5.4i cc: freebsd-ia64@freebsd.org Subject: Re: DDB and SMP causes Unaligned Reference X-BeenThere: freebsd-ia64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting FreeBSD to the IA-64 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2003 18:20:17 -0000 On Fri, Jun 06, 2003 at 06:31:30PM +0200, Alan Robinson wrote: > Using the manual escape to debugger with an SMP kernel > causes an unaligned reference while stopping the other > CPU, the system then hangs. > > # > # CPU1 stopping CPUs: 0x00000001... > # fatal kernel trap (cpu 0): > # > # trap vector = 0x1e (Unaligned Reference) > # cr.iip = 0xe0000000009a1320 > # cr.ipsr = 0x1210080a6010 (mfl,ic,i,dt,dfh,rt,cpl=0,it,ri=1,bn) > # cr.isr = 0x20200000000 (code=0,vector=0,w,ei=1) > # cr.ifa = 0xe000000000004228 > # curthread = 0xe00000003d9bb080 > # pid = 12, comm = idle: cpu0 > # CPU0 stopping CPUs: 0x00000002... > # > (The self built kernel was built using projects/ia64 cvsup'd sources > which are now a day or two old) > > The cr.iip points into swapctx (or savectx) which was called from > from interrupt() as follows.... > > } else if (vector == ipi_vector[IPI_STOP]) { > u_int32_t mybit = PCPU_GET(cpumask); > > CTR1(KTR_SMP, "IPI_STOP, cpuid=%d", PCPU_GET(cpuid)); > savectx(PCPU_GET(pcb)); We don't set pc_pcb on ia64. The line above should read: savectx(curthread->td_pcb); Try it and let me know if it works. I'll commit it then. > # enter_userland() at enter_userland > # db> c > # CPU1 restarting CPUs: 0x00000001... restarted. > # manual escape to debugger > # CPU0 stopping CPUs: 0x00000002... stopped. > # Stopped at Debugger+0x31: nop.m 0x0 > # db> c > # CPU0 restarting CPUs: 0x00000002... restarted. > # > > is the double continue normal ? I don't think so. I've never seen it before, but that's probably because I haven't had the time yet to work on SMP in general and also because I generally don't manually break to the debugger. -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net From owner-freebsd-ia64@FreeBSD.ORG Sat Jun 7 10:01:08 2003 Return-Path: Delivered-To: freebsd-ia64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A8BBF37B401 for ; Sat, 7 Jun 2003 10:01:08 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7E22943FDD for ; Sat, 7 Jun 2003 10:01:05 -0700 (PDT) (envelope-from fenner+portsurvey@FreeBSD.org) Received: from freefall.freebsd.org (fenner@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h57H15Up033796 for ; Sat, 7 Jun 2003 10:01:05 -0700 (PDT) (envelope-from fenner+portsurvey@freefall.freebsd.org) Received: (from fenner@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h57H15lq033795; Sat, 7 Jun 2003 10:01:05 -0700 (PDT) Date: Sat, 7 Jun 2003 10:01:05 -0700 (PDT) Message-Id: <200306071701.h57H15lq033795@freefall.freebsd.org> From: fenner@freebsd.org (Bill "distfiles" Fenner) To: freebsd-ia64@freebsd.org Subject: FreeBSD ports: 1 unfetchable distfiles: emulators/ski X-BeenThere: freebsd-ia64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: ports@freebsd.org List-Id: Porting FreeBSD to the IA-64 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jun 2003 17:01:08 -0000 Dear freebsd-ia64@freebsd.org, You are listed as the FreeBSD port maintainer for 1 port whose distfiles [or main web pages] are not fetchable from their MASTER_SITES. Could you please visit http://people.freebsd.org/~fenner/portsurvey/freebsd-ia64@freebsd.org.html and correct the problems listed there? The individual port with a problem is emulators/ski. Note that the main port web page, as listed in the WWW: line of the pkg-descr, is checked just as though it was a port distfile. This is an unfortunate side effect of the architecture of the distfile survey reporting tool, but if you see a distfile being reported as not fetchable that's not actually a distfile, see if it's from the pkg-descr. If you have already corrected the problems and submitted a PR, please accept my thanks and apologies for the delay in getting the fixes into the tree. This reminder is created automatically and does not (yet) have a way to know if a PR fixing the problem has been submitted. Please do *NOT* send your response to me directly; I do not always have time to commit your fix; please instead submit a PR via 'send-pr' so it doesn't get lost. Problems are usually of two types: 1. The software package has been upgraded and the version in the port has been removed. The best solution to this problem is to upgrade the port to the most current version of the software package. If you are a FreeBSD committer, then you can just upgrade the port directly. If not, you should create the updated port on your own machine, test it (and maybe even run "portlint" on it), and then use "send-pr" to submit a "diff -uNr old-port updated-port". If you added or deleted any files, please make an explicit note of it. 2. The mirror site being used no longer contains the software package in question, or no longer exists. Solutions include: a) If there are other mirror sites, just remove the bad site from the list. (Make sure that what appears to be a bad site isn't actually a problem of type 1, upgrade) b) If the README or other support files in the software documentation mention where to get the software package, use one of those sites. c) Use ftpsearch (http://ftpsearch.ntnu.no/ftpsearch) or other search engines to find another place to get the original DISTFILES. Make sure that you don't pick a FreeBSD distfiles mirror -- if you can't find any other places where the file exists, it can be a LOCAL_PORT or you can simply comment out the MASTER_SITES= line, with a comment explaining why. Once you have a solution, use "send-pr" to submit a "diff -u" of the Makefile. Note that this isn't an urgent issue, as people who try to build the port now will just fall back to the FreeBSD distfiles mirror. Please just put it on your list to do and get to it when you have time. These messages will continue to arrive twice a month until the fix is committed, as a reminder. Thanks, Bill "distfiles" Fenner.