[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <m2vdcl5ocj.fsf@igel.home>
Date: Wed, 24 Mar 2010 23:47:24 +0100
From: Andreas Schwab <schwab@...ux-m68k.org>
To: Jan Engelhardt <jengelh@...ozas.de>
Cc: David Miller <davem@...emloft.net>, tony.luck@...el.com,
netdev@...r.kernel.org
Subject: Re: Seeing new kernel unaligned access messages in linux-next on ia64
Jan Engelhardt <jengelh@...ozas.de> writes:
> Using a temporary and memcpying it off would normally fix this,
> as in the patch below. During testing however, I still get
> unaligned messages even with the patch - and I would not know
> what causes this.
The memcpy will not fix the alignment issue because the copy operation
is fully equivalent to a direct assignment, and the compiler can still
take advantage of the known alignment of the types. You have to
explicitly tell the compiler about the reduced alignment guarantee.
> In fact, adding a printks magically fixes it. (Bug in gcc-4.4-sparc
> compiler?)
>
> memcpy(v, &a, sizeof(a));
> + printk(KERN_INFO "v=%p a=%p\n", v, &a);
Presumably the extended lifetime of the variables caused the compiler to
use a different expansion for memcpy which is less dependent on
alignment.
Andreas.
--
Andreas Schwab, schwab@...ux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists