2008-08-13 12:34:41     misaligned address violation

Document created by Aaronwu Employee on Aug 8, 2013
Version 1Show Document
  • View in full screen mode

2008-08-13 12:34:41     misaligned address violation

Norbert van Bolhuis (NETHERLANDS)

Message: 60416   


when my uClinux 2008R1-RC8 kernel receives an IP packet


(on our BF547 rev0.1 board), a "misaligned address violation" occurs.


I caught it in an In Circuit Emulator, see attached bzip2 compressed bitmap.


It happens in standard uClinux kernel code (ip_rcv calling ip_rcv_finish


trying to call ip_route_input).


Obviously the code is processing IP headers (and skipping the 14


bytes eth header). When it skips to ip daddr (r1 = [p4 + 0x10]) the violation occurs.




I can understand it is an address violation (eth_frame_ptr + 0xe + 0x10)


but how do I prevent this kind of problems from happening ?








2008-08-13 12:41:06     Re: misaligned address violation

Mike Frysinger (UNITED STATES)

Message: 60418   


please try the 2008R1.5 release ... some alignment issues were addressed in the networking stack




2008-08-14 06:45:30     Re: misaligned address violation

Norbert van Bolhuis (NETHERLANDS)

Message: 60465   


you probably mean the changes in drivers/net/bfin_mac.c


(I don't see any other alignment related fixes between 2008R1.5-RC3


and 2008R1-RC8)




I forgot to mention we're using a custom eth-mac driver. I solved


the problem in there by simply allocating 2 bytes more


and skip 2 bytes initially. This way eth_frame_ptr + 0xe is


4-byte aligned.