diff options
author | Rabin Vincent <rabin.vincent@stericsson.com> | 2012-07-04 02:37:37 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-07-05 07:57:16 -0400 |
commit | f8b435bb918412c9410da4c4b0b02b6b3d99b27c (patch) | |
tree | 437a95d7a2b25659172cb4353b1511152e216a1c /arch | |
parent | fdeb8e35fd59e79dec385f98eb4b6d2e3398264b (diff) |
ARM: 7440/1: kprobes: only test 'sub pc, pc, #1b-2b+8-2' on ARMv6
'sub pc, pc, #1b-2b+8-2' results in address<1:0> == '10'.
sub pc, pc, #const (== ADR pc, #const) performs an interworking branch
(BXWritePC()) on ARMv7+ and a simple branch (BranchWritePC()) on earlier
versions.
In ARM state, BXWritePC() is UNPREDICTABLE when address<1:0> == '10'.
In ARM state on ARMv6+, BranchWritePC() ignores address<1:0>. Before
ARMv6, BranchWritePC() is UNPREDICTABLE if address<1:0> != '00'
So the instruction is UNPREDICTABLE both before and after v6.
Acked-by: Jon Medhurst <tixy@yxit.co.uk>
Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/kernel/kprobes-test-arm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/arm/kernel/kprobes-test-arm.c b/arch/arm/kernel/kprobes-test-arm.c index ba32b393b3f0..38c1a3b103a0 100644 --- a/arch/arm/kernel/kprobes-test-arm.c +++ b/arch/arm/kernel/kprobes-test-arm.c | |||
@@ -187,8 +187,8 @@ void kprobe_arm_test_cases(void) | |||
187 | TEST_BF_R ("mov pc, r",0,2f,"") | 187 | TEST_BF_R ("mov pc, r",0,2f,"") |
188 | TEST_BF_RR("mov pc, r",0,2f,", asl r",1,0,"") | 188 | TEST_BF_RR("mov pc, r",0,2f,", asl r",1,0,"") |
189 | TEST_BB( "sub pc, pc, #1b-2b+8") | 189 | TEST_BB( "sub pc, pc, #1b-2b+8") |
190 | #if __LINUX_ARM_ARCH__ >= 6 | 190 | #if __LINUX_ARM_ARCH__ == 6 && !defined(CONFIG_CPU_V7) |
191 | TEST_BB( "sub pc, pc, #1b-2b+8-2") /* UNPREDICTABLE before ARMv6 */ | 191 | TEST_BB( "sub pc, pc, #1b-2b+8-2") /* UNPREDICTABLE before and after ARMv6 */ |
192 | #endif | 192 | #endif |
193 | TEST_BB_R( "sub pc, pc, r",14, 1f-2f+8,"") | 193 | TEST_BB_R( "sub pc, pc, r",14, 1f-2f+8,"") |
194 | TEST_BB_R( "rsb pc, r",14,1f-2f+8,", pc") | 194 | TEST_BB_R( "rsb pc, r",14,1f-2f+8,", pc") |