]> git.itanic.dy.fi Git - linux-stable/commitdiff
ARM: 9061/1: kprobes: fix UNPREDICTABLE warnings
authorNick Desaulniers <ndesaulniers@google.com>
Tue, 16 Feb 2021 19:14:46 +0000 (20:14 +0100)
committerRussell King <rmk+kernel@armlinux.org.uk>
Thu, 25 Mar 2021 10:27:39 +0000 (10:27 +0000)
GNU as warns twice for this file:
Warning: using r15 results in unpredictable behaviour

via the Arm ARM:
K1.1.1 Overview of the constraints on Armv7 UNPREDICTABLE behaviors

  The term UNPREDICTABLE describes a number of cases where the
  architecture has a feature that software must not use.

Ard notes:
  These are selftests that aim to ensure that kprobe never attempts to
  replace the opcodes in question with a probe, but they are not
  actually executed, or expected to occur in real code.

Link: https://github.com/ClangBuiltLinux/linux/issues/1271
Link: https://reviews.llvm.org/D95586
Reported-by: kernelci.org bot <bot@kernelci.org>
Suggested-by: Peter Smith <peter.smith@arm.com>
Suggested-by: Renato Golin <rengolin@systemcall.eu>
Suggested-by: David Spickett <david.spickett@linaro.org>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
arch/arm/probes/kprobes/test-arm.c

index 977369f1aa4886f6a8e4e7d3df4b26155ef4e216..2543106a203ebf6615016229301dac407e6e5dbe 100644 (file)
@@ -166,10 +166,10 @@ void kprobe_arm_test_cases(void)
 
        /* Data-processing with PC as a target and status registers updated */
        TEST_UNSUPPORTED("movs  pc, r1")
-       TEST_UNSUPPORTED("movs  pc, r1, lsl r2")
+       TEST_UNSUPPORTED(__inst_arm(0xe1b0f211) "       @movs   pc, r1, lsl r2")
        TEST_UNSUPPORTED("movs  pc, #0x10000")
        TEST_UNSUPPORTED("adds  pc, lr, r1")
-       TEST_UNSUPPORTED("adds  pc, lr, r1, lsl r2")
+       TEST_UNSUPPORTED(__inst_arm(0xe09ef211) "       @adds   pc, lr, r1, lsl r2")
        TEST_UNSUPPORTED("adds  pc, lr, #4")
 
        /* Data-processing with SP as target */