Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Mar 2001 09:07:57 -0800 (PST)
From:      Matthew Jacob <mjacob@feral.com>
To:        Andrew Gallatin <gallatin@cs.duke.edu>
Cc:        raymond@one.com.au, freebsd-alpha@FreeBSD.ORG
Subject:   Re: alpha/25535: unaligned access crash on stq
Message-ID:  <Pine.LNX.4.21.0103050907110.16541-100000@zeppo.feral.com>
In-Reply-To: <15011.48213.655850.515898@grasshopper.cs.duke.edu>

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

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




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