From: Will Deacon Date: Tue, 4 Dec 2012 11:56:44 +0000 (+0100) Subject: ARM: 7592/1: nommu: prevent generation of kernel unaligned memory accesses X-Git-Tag: v3.8-rc1~147^2~1^4~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e91b36efe51b5cbbfe5eb61a653cde5985ae8285;p=platform%2Fkernel%2Flinux-exynos.git 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 Tested-by: Jonathan Austin Signed-off-by: Will Deacon Signed-off-by: Russell King --- diff --git a/arch/arm/Makefile b/arch/arm/Makefile index f023e3a..cbe3642 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)