From owner-freebsd-alpha Mon Mar 5 9: 8:12 2001 Delivered-To: freebsd-alpha@freebsd.org Received: from feral.com (feral.com [192.67.166.1]) by hub.freebsd.org (Postfix) with ESMTP id D47A437B719 for ; Mon, 5 Mar 2001 09:08:09 -0800 (PST) (envelope-from mjacob@feral.com) Received: from zeppo.feral.com (IDENT:mjacob@zeppo [192.67.166.71]) by feral.com (8.9.3/8.9.3) with ESMTP id JAA03024; Mon, 5 Mar 2001 09:07:59 -0800 Date: Mon, 5 Mar 2001 09:07:57 -0800 (PST) From: Matthew Jacob Reply-To: mjacob@feral.com To: Andrew Gallatin Cc: raymond@one.com.au, freebsd-alpha@FreeBSD.ORG Subject: Re: alpha/25535: unaligned access crash on stq In-Reply-To: <15011.48213.655850.515898@grasshopper.cs.duke.edu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-alpha@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Thanks Drew- I had just gone to pull my Brown Book to follow up on this and just figured out that the register was r31... > > 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 > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-alpha" in the body of the message