Commit e91b36ef authored by Will Deacon's avatar Will Deacon Committed by Russell King
Browse files

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
Acked-by: default avatarNicolas Pitre <>
Tested-by: default avatarJonathan Austin <>
Signed-off-by: default avatarWill Deacon <>
Signed-off-by: default avatarRussell King <>
parent 76e09204
...@@ -34,6 +34,7 @@ KBUILD_DEFCONFIG := versatile_defconfig ...@@ -34,6 +34,7 @@ KBUILD_DEFCONFIG := versatile_defconfig
# defines filename extension depending memory management type. # defines filename extension depending memory management type.
ifeq ($(CONFIG_MMU),) ifeq ($(CONFIG_MMU),)
MMUEXT := -nommu MMUEXT := -nommu
KBUILD_CFLAGS += $(call cc-option,-mno-unaligned-access)
endif endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment