From owner-freebsd-alpha Mon Mar 5 8:19: 6 2001 Delivered-To: freebsd-alpha@freebsd.org Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by hub.freebsd.org (Postfix) with ESMTP id 4EA5237B718 for ; Mon, 5 Mar 2001 08:19:02 -0800 (PST) (envelope-from gallatin@cs.duke.edu) Received: from grasshopper.cs.duke.edu (grasshopper.cs.duke.edu [152.3.145.30]) by duke.cs.duke.edu (8.9.3/8.9.3) with ESMTP id LAA11921; Mon, 5 Mar 2001 11:18:59 -0500 (EST) Received: (from gallatin@localhost) by grasshopper.cs.duke.edu (8.11.2/8.9.1) id f25GITI15947; Mon, 5 Mar 2001 11:18:29 -0500 (EST) (envelope-from gallatin@cs.duke.edu) From: Andrew Gallatin MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15011.48213.655850.515898@grasshopper.cs.duke.edu> Date: Mon, 5 Mar 2001 11:18:29 -0500 (EST) To: raymond@one.com.au Cc: freebsd-alpha@freebsd.org Subject: Re: alpha/25535: unaligned access crash on stq In-Reply-To: <200103050041.f250fP281920@freefall.freebsd.org> References: <200103050041.f250fP281920@freefall.freebsd.org> X-Mailer: VM 6.75 under 21.1 (patch 12) "Channel Islands" XEmacs Lucid Sender: owner-freebsd-alpha@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org raymond@one.com.au writes: > systab->lockfree->fwd_link = NULL; // only one The problem is that our unaligned access handling code has a bug in that it does not handle storing unaligned zeros. This is because it does not handle storing from register R31. The following patch should fix it: Index: trap.c =================================================================== RCS file: /home/ncvs/src/sys/alpha/alpha/trap.c,v retrieving revision 1.26.2.2 diff -u -r1.26.2.2 trap.c --- trap.c 2000/05/24 14:20:57 1.26.2.2 +++ trap.c 2001/03/05 16:04:23 @@ -777,8 +777,9 @@ #define unaligned_store(storage, ptrf, mod) \ if ((regptr = ptrf(p, reg)) == NULL) \ - break; \ - (storage) = mod (*regptr); \ + (storage) = 0; \ + else \ + (storage) = mod (*regptr); \ if (copyout(&(storage), (caddr_t)va, sizeof (storage)) == 0) \ signal = 0; \ else \ I've just comitted this to -current. Excellent problem report, BTW. Had that null not been staring me in the face, I wouldn't have been able to figure this out. You really should fix your code, if you can. Unaligned stores are horribly expensive, as each load or store involves a trap into the kernel. Cheers, Drew To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-alpha" in the body of the message