linux-stable/arch
Dave Martin 088c01f1e3 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 <dave.martin@linaro.org>
Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2011-08-09 08:42:39 +01:00
..
alpha Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6 2011-07-29 23:35:05 -07:00
arm ARM: 7007/1: alignment: Prevent ignoring of faults with ARMv6 unaligned access model 2011-08-09 08:42:39 +01:00
avr32 atomic: cleanup asm-generic atomic*.h inclusion 2011-07-26 16:49:47 -07:00
blackfin atomic: cleanup asm-generic atomic*.h inclusion 2011-07-26 16:49:47 -07:00
cris cris: add missing declaration of kgdb_init() and breakpoint() 2011-08-03 14:25:22 -10:00
frv frv: remove unnecessary code 2011-07-29 23:41:09 -07:00
h8300 atomic: cleanup asm-generic atomic*.h inclusion 2011-07-26 16:49:47 -07:00
ia64 Merge branch 'gpiolib' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6 2011-08-01 13:41:43 -10:00
m32r atomic: cleanup asm-generic atomic*.h inclusion 2011-07-26 16:49:47 -07:00
m68k Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k 2011-07-31 14:30:59 -10:00
microblaze Merge branch 'next' of git://git.monstr.eu/linux-2.6-microblaze 2011-07-27 09:24:20 -07:00
mips atomic: cleanup asm-generic atomic*.h inclusion 2011-07-26 16:49:47 -07:00
mn10300 atomic: cleanup asm-generic atomic*.h inclusion 2011-07-26 16:49:47 -07:00
openrisc OpenRISC: Miscellaneous 2011-07-22 18:46:41 +02:00
parisc atomic: cleanup asm-generic atomic*.h inclusion 2011-07-26 16:49:47 -07:00
powerpc Merge branch 'next/cross-platform' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/linux-arm-soc 2011-07-26 17:12:10 -07:00
s390 atomic: cleanup asm-generic atomic*.h inclusion 2011-07-26 16:49:47 -07:00
score modules: make arch's use default loader hooks 2011-07-24 22:06:04 +09:30
sh Merge branch 'sh-latest' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-3.x 2011-08-01 06:10:16 -10:00
sparc Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k 2011-07-31 14:30:59 -10:00
tile Merge git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile 2011-08-02 21:16:11 -10:00
um ptrace: unify show_regs() prototype 2011-07-26 16:49:43 -07:00
unicore32 Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6 2011-07-29 23:35:05 -07:00
x86 Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6 2011-07-29 23:35:05 -07:00
xtensa atomic: cleanup asm-generic atomic*.h inclusion 2011-07-26 16:49:47 -07:00
.gitignore
Kconfig mm, powerpc: move the RCU page-table freeing into generic code 2011-05-25 08:39:16 -07:00