Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Mar 2001 11:18:29 -0500 (EST)
From:      Andrew Gallatin <gallatin@cs.duke.edu>
To:        raymond@one.com.au
Cc:        freebsd-alpha@freebsd.org
Subject:   Re: alpha/25535: unaligned access crash on stq
Message-ID:  <15011.48213.655850.515898@grasshopper.cs.duke.edu>
In-Reply-To: <200103050041.f250fP281920@freefall.freebsd.org>
References:  <200103050041.f250fP281920@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15011.48213.655850.515898>