summaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorWill Deacon <will.deacon@arm.com>2012-12-04 12:56:44 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2012-12-07 12:48:57 +0100
commite91b36efe51b5cbbfe5eb61a653cde5985ae8285 (patch)
tree2b003a99db9afedbdeca8c795ca6e06716a5b3d5 /arch/arm
parentARM: 7591/1: nommu: Enable the strict alignment (CR_A) bit only if ARCH < v6 (diff)
downloadlinux-e91b36efe51b5cbbfe5eb61a653cde5985ae8285.tar.xz
linux-e91b36efe51b5cbbfe5eb61a653cde5985ae8285.zip
ARM: 7592/1: nommu: prevent generation of kernel unaligned memory accesses
Recent ARMv7 toolchains assume that unaligned memory accesses will not fault and will instead be handled by the processor. For the nommu case (without an MPU), memory will be treated as strongly-ordered and therefore unaligned accesses may fault regardless of the SCTLR.A setting. This patch passes -mno-unaligned-access to GCC when compiling for nommu targets, preventing the generation of unaligned memory access in the kernel. Acked-by: Nicolas Pitre <nico@linaro.org> Tested-by: Jonathan Austin <jonathan.austin@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/Makefile1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index f023e3acdfbd..cbe364210c7d 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -34,6 +34,7 @@ KBUILD_DEFCONFIG := versatile_defconfig
# defines filename extension depending memory management type.
ifeq ($(CONFIG_MMU),)
MMUEXT := -nommu
+KBUILD_CFLAGS += $(call cc-option,-mno-unaligned-access)
endif
ifeq ($(CONFIG_FRAME_POINTER),y)