From: Dave Martin Date: Thu, 28 Jul 2011 13:28:52 +0000 (+0100) Subject: ARM: 7007/1: alignment: Prevent ignoring of faults with ARMv6 unaligned access model X-Git-Tag: v3.1-rc2~29^2~2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=088c01f1e39dbe93a13e0b00f4532ed8b79d35f4;p=pandora-kernel.git ARM: 7007/1: alignment: Prevent ignoring of faults with ARMv6 unaligned access model Currently, it's possible to set the kernel to ignore alignment faults when changing the alignment fault handling mode at runtime via /proc/sys/alignment, even though this is undesirable on ARMv6 and above, where it can result in infinite spins where an un-fixed- up instruction repeatedly faults. In addition, the kernel clobbers any alignment mode specified on the command-line if running on ARMv6 or above. This patch factors out the necessary safety check into a couple of new helper functions, and checks and modifies the fault handling mode as appropriate on boot and on writes to /proc/cpu/alignment. Prior to ARMv6, the behaviour is unchanged. For ARMv6 and above, the behaviour changes as follows: * Attempting to ignore faults on ARMv6 results in the mode being forced to UM_FIXUP instead. A warning is printed if this happened as a result of a write to /proc/cpu/alignment. The user's UM_WARN bit (if present) is still honoured. * An alignment= argument from the kernel command-line is now honoured, except that the kernel will modify the specified mode as described above. This is allows modes such as UM_SIGNAL and UM_WARN to be active immediately from boot, which is useful for debugging purposes. Signed-off-by: Dave Martin Acked-by: Nicolas Pitre Signed-off-by: Russell King --- Reading git-diff-tree failed