aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2011-01-14 14:32:49 -0800
committerErik Gilling <konkers@android.com>2011-03-30 11:24:45 -0700
commit967db0e003a488158c90a86ce3e6699216135dd6 (patch)
tree74a301ef169a9d9cf0962283b0e49629e4a96e2b
parent823ee85794524964f4d40ba5c5f960fb265d8ece (diff)
downloadexperimental-967db0e003a488158c90a86ce3e6699216135dd6.tar.gz
ARM: Fix up vfp exception location in thumb mode
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>
-rw-r--r--arch/arm/kernel/entry-armv.S3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index e8d88567680..e64b47dd43f 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -492,7 +492,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