All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/7] ARM: kexec: Correct data alignment for CONFIG_THUMB2_KERNEL
@ 2010-11-16 13:14 Dave Martin
  2010-11-16 13:14 ` [PATCH 2/7] ARM: vfp: " Dave Martin
                   ` (5 more replies)
  0 siblings, 6 replies; 20+ messages in thread
From: Dave Martin @ 2010-11-16 13:14 UTC (permalink / raw)
  To: linux-arm-kernel

Directives such as .long and .word do not magically cause the
assembler location counter to become aligned in gas.  As a
result, using these directives in code sections can result in
misaligned data words when building a Thumb-2 kernel
(CONFIG_THUMB2_KERNEL).

This is a Bad Thing, since the ABI permits the compiler to
assume that fundamental types of word size or above are word-
aligned when accessing them from C.  If the data is not really
word-aligned, this can cause impaired performance and stray
alignment faults in some circumstances.

In general, the following rules should be applied when using
data word declaration directives inside code sections:

    * .quad and .double:
         .align 3

    * .long, .word, .single, .float:
         .align (or .align 2)

    * .short:
        No explicit alignment required, since Thumb-2
        instructions are always 2 or 4 bytes in size.
        immediately after an instruction.

Applies cleanly on v2.6.37-rc1.

Signed-off-by: Dave Martin <dave.martin@linaro.org>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Reviewed-by: Will Deacon <will.deacon@arm.com>
---
 arch/arm/kernel/relocate_kernel.S |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/arm/kernel/relocate_kernel.S b/arch/arm/kernel/relocate_kernel.S
index fd26f8d..9cf4cbf 100644
--- a/arch/arm/kernel/relocate_kernel.S
+++ b/arch/arm/kernel/relocate_kernel.S
@@ -59,6 +59,8 @@ relocate_new_kernel:
 	ldr r2,kexec_boot_atags
 	mov pc,lr
 
+	.align
+
 	.globl kexec_start_address
 kexec_start_address:
 	.long	0x0
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2010-11-17 16:46 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-16 13:14 [PATCH 1/7] ARM: kexec: Correct data alignment for CONFIG_THUMB2_KERNEL Dave Martin
2010-11-16 13:14 ` [PATCH 2/7] ARM: vfp: " Dave Martin
2010-11-16 13:14 ` [PATCH 3/7] ARM: Thumb-2: Correct data alignment for CONFIG_THUMB2_KERNEL in bootp/init.S Dave Martin
2010-11-16 13:14 ` [PATCH 4/7] ARM: Thumb-2: Correct data alignment for CONFIG_THUMB2_KERNEL in kernel/head.S Dave Martin
2010-11-16 18:22   ` Russell King - ARM Linux
2010-11-17 10:16     ` Catalin Marinas
2010-11-17 10:16     ` Dave Martin
2010-11-16 13:14 ` [PATCH 5/7] ARM: Thumb-2: Correct data alignment for CONFIG_THUMB2_KERNEL in mm/proc-v7.S Dave Martin
2010-11-16 13:14 ` [PATCH 6/7] ARM: Thumb-2: Fix CONFIG_THUMB2_KERNEL breakage in compressed/head.S Dave Martin
2010-11-16 13:14 ` [PATCH 7/7] ARM: Thumb-2: Restore sensible zImage header layout for CONFIG_THUMB2_KERNEL Dave Martin
2010-11-16 18:26   ` Russell King - ARM Linux
2010-11-16 20:28     ` Nicolas Pitre
2010-11-16 20:35       ` Russell King - ARM Linux
2010-11-16 20:58         ` Uwe Kleine-König
2010-11-17  9:16         ` Dave Martin
2010-11-17  9:19           ` Dave Martin
2010-11-17 10:21           ` Catalin Marinas
2010-11-17 11:11   ` [PATCH 7/7 v1.1] " Dave Martin
2010-11-17 16:17     ` Nicolas Pitre
2010-11-17 16:46       ` Dave Martin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.