[PATCH] ARM: kprobes: rewrite in UAL

Arnd Bergmann arnd at kernel.org
Thu Jan 28 11:15:13 EST 2021


On Thu, Jan 28, 2021 at 5:44 AM 'Nick Desaulniers' via Clang Built
Linux <clang-built-linux at googlegroups.com> wrote:
>
> Clang's integrated assembler only accepts UAL syntax, rewrite the
> instructions that were changed by RVCTv2.1.
>
> The document "Assembly language changes after RVCTv2.1" was very
> helpful.
>
> This exposed a bug in Clang's integrated assembler, which hopefully will
> land in clang-12, but is required to test this patch with LLVM_IAS=1.
>
> Link: https://developer.arm.com/documentation/dui0473/c/writing-arm-assembly-language/assembly-language-changes-after-rvctv2-1
> Link: https://github.com/ClangBuiltLinux/linux/issues/1271
> Link: https://reviews.llvm.org/D95586
> Reported-by: Arnd Bergmann <arnd at arndb.de>
> Signed-off-by: Nick Desaulniers <ndesaulniers at google.com>
> ---
>  arch/arm/probes/kprobes/test-arm.c | 288 ++++++++++++++---------------
>  1 file changed, 144 insertions(+), 144 deletions(-)

This mostly works, but I see one extra case in some configurations:


arch/arm/probes/kprobes/test-arm.c:453:2: error: invalid instruction,
did you mean: swpb?
        TEST_R( "swpvsb r0, r",1,VAL1,", [sp]")
        ^
arch/arm/probes/kprobes/test-core.h:235:2: note: expanded from macro 'TEST_R'
        TEST_INSTRUCTION(code1 #reg code2)              \
        ^
arch/arm/probes/kprobes/test-core.h:155:17: note: expanded from macro
'TEST_INSTRUCTION'
        "50:    nop                                     \n\t"   \
                                                          ^
<inline asm>:20:5: note: instantiated into assembly here
        1:      swpvsb  r0, r1, [sp]
                ^~~~~~

Plus a lot of extra errors when building with CONFIG_THUMB2_KERNEL,
as that uses tests in arch/arm/probes/kprobes/test-thumb.c.

        Arnd



More information about the linux-arm-kernel mailing list