Skip to content

Commit

Permalink
ARM: Fix up vfp exception location in thumb mode
Browse files Browse the repository at this point in the history
The exception handler in entry-armv.S checks for thumb mode and
correctly determines the exception location and instruction,
but VFP_bounce uses the uncorrected location off the stack.
If the VFP exception occured in Thumb mode, fix up the
exception location on the stack to match the value that would
be returned in ARM mode.

Fixes segfaults in userspace applications running in Thumb mode
caused by a handled VFP exception returning to the middle of the
instruction that triggered the exception.

Change-Id: I02be4c5b546561d9a967a02c1e9eb1de876cff07
Original-author: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Colin Cross <ccross@android.com>
(cherry picked from commit 70f54f687eb5c7e6ba52c5ef3197fa7214e87009)

Signed-off-by: nobodyAtall <tsogkas@ceid.upatras.gr>
Signed-off-by: garwedgess <garethwilliams21@gmail.com>
  • Loading branch information
colincross authored and garwedgess committed Jun 11, 2013
1 parent 7c771b1 commit cac8998
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/arm/kernel/entry-armv.S
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,8 @@ __und_usr:
blo __und_usr_unknown
3: ldrht r0, [r4]
add r2, r2, #2 @ r2 is PC + 2, make it PC + 4
orr r0, r0, r5, lsl #16
str r2, [sp, #S_PC] @ it's a 2x16bit instr, update
orr r0, r0, r5, lsl #16 @ regs->ARM_pc
#else
b __und_usr_unknown
#endif
Expand Down

0 comments on commit cac8998

Please sign in to comment.