Thread (22 messages) 22 messages, 8 authors, 2012-10-11

alignment faults in 3.6

flat view

From: catalin.marinas@arm.com (Catalin Marinas)
Date: 2012-10-11 16:59:49
Also in: netdev

Possibly related (same subject, not in this thread)

On 11 October 2012 11:32, Russell King - ARM Linux
[off-list ref] wrote:
On Thu, Oct 11, 2012 at 12:22:06PM +0200, Eric Dumazet wrote:
quoted
I took a look, and I dont see why/how gcc could use a ldm instruction

Doing so assumed the alignment of the structure was 8 bytes, but its
not.

Networking stack mandates that IP headers are aligned on 4 bytes
boundaries, not 8 bytes.
Err, no.  ldm is "load multiple" not "load double".  It loads multiple
32-bit registers, and its requirement for non-faulting behaviour is for
the pointer to be 4 byte aligned.  However, "load double" requires 8
byte alignment.
It got better with ARMv6 where LDRD/STRD only require 4 byte alignment
(the only 8 byte alignment is required by LDREXD/STREXD). But on ARMv5
LDRD/STRD 8 byte alignment is indeed required (otherwise
unpredictable).

-- 
Catalin
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help