From mboxrd@z Thu Jan 1 00:00:00 1970 From: linux@arm.linux.org.uk (Russell King - ARM Linux) Date: Thu, 11 Oct 2012 09:53:02 +0100 Subject: alignment faults in 3.6 In-Reply-To: References: <20121005071216.GD4625@n2100.arm.linux.org.uk> <20121005082439.GF4625@n2100.arm.linux.org.uk> <506ED18C.3010009@gmail.com> <20121005140556.GQ4625@n2100.arm.linux.org.uk> <506EEFBB.3060705@gmail.com> <507619FA.6080001@jonmasters.org> Message-ID: <20121011085302.GM4625@n2100.arm.linux.org.uk> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Thu, Oct 11, 2012 at 09:21:35AM +0100, David Laight wrote: > It might be enough to use __attribute__((aligned(2))) on some structure > members (actually does 'ldm' need 8 byte alignment?? - in which case > aligned(4) is enough). No, ldm just needs 4 byte alignment, the same as normal word loads/stores not to fault. The only instructions which needs 8 byte alignment not to fault are the double-word load/stores. > One on my bugbears is hardware that will once receive ethernet frames > onto a 4n boundary - it needs to be 4n+2. two bytes of 'junk' will do. Indeed, but remember that is just a mere optimisation for IPv4. What may be true of IPv4 is not necessarily true of other protocols, though IPv4 is currently the dominant protocol today. IPv6 follows the same alignment rules as IPv4, so it's unlikely to change.