]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ARM: Fix undefined instruction exception handling
authorRussell King <rmk+kernel@arm.linux.org.uk>
Mon, 30 Jul 2012 18:42:10 +0000 (19:42 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Aug 2012 14:52:45 +0000 (07:52 -0700)
commit276bbdb82abdb65769e152b7a0282ef2e0b4b5b6
treefcc5ecadff813213914fe6d1480665e7e23faaf0
parent909397450a68f80282bd30cbd25efb5dba955531
ARM: Fix undefined instruction exception handling

commit 15ac49b65024f55c4371a53214879a9c77c4fbf9 upstream.

While trying to get a v3.5 kernel booted on the cubox, I noticed that
VFP does not work correctly with VFP bounce handling.  This is because
of the confusion over 16-bit vs 32-bit instructions, and where PC is
supposed to point to.

The rule is that FP handlers are entered with regs->ARM_pc pointing at
the _next_ instruction to be executed.  However, if the exception is
not handled, regs->ARM_pc points at the faulting instruction.

This is easy for ARM mode, because we know that the next instruction and
previous instructions are separated by four bytes.  This is not true of
Thumb2 though.

Since all FP instructions are 32-bit in Thumb2, it makes things easy.
We just need to select the appropriate adjustment.  Do this by moving
the adjustment out of do_undefinstr() into the assembly code, as only
the assembly code knows whether it's dealing with a 32-bit or 16-bit
instruction.

Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm/kernel/entry-armv.S
arch/arm/kernel/traps.c
arch/arm/vfp/entry.S
arch/arm/vfp/vfphw.S