[PATCH v3 0/4] Fix objtool issues about do_syscall() and Clang on LoongArch

Tiezhu Yang posted 4 patches 1 year, 6 months ago
arch/loongarch/Kconfig                |  4 ++--
arch/loongarch/kernel/syscall.c       |  4 ----
tools/objtool/arch/loongarch/decode.c | 11 ++++++++++-
tools/objtool/check.c                 | 23 ++++++++++++++++++++---
tools/objtool/include/objtool/elf.h   |  1 +
5 files changed, 33 insertions(+), 10 deletions(-)
[PATCH v3 0/4] Fix objtool issues about do_syscall() and Clang on LoongArch
Posted by Tiezhu Yang 1 year, 6 months ago
With this series, there is no objtool warning about do_syscall() and
there is handle_syscall() which is the previous frame of do_syscall()
in the call trace when running "echo l > /proc/sysrq-trigger".

Compiled with GCC and Clang, tested with the following two configs:

(1) CONFIG_RANDOMIZE_KSTACK_OFFSET=y &&
    CONFIG_RANDOMIZE_KSTACK_OFFSET_DEFAULT=n
(2) CONFIG_RANDOMIZE_KSTACK_OFFSET=y &&
    CONFIG_RANDOMIZE_KSTACK_OFFSET_DEFAULT=y

Tiezhu Yang (4):
  objtool: Handle frame pointer related instructions
  LoongArch: Remove STACK_FRAME_NON_STANDARD(do_syscall)
  LoongArch: Set AS_HAS_THIN_ADD_SUB as y if AS_IS_LLVM
  LoongArch: Enable objtool for Clang

 arch/loongarch/Kconfig                |  4 ++--
 arch/loongarch/kernel/syscall.c       |  4 ----
 tools/objtool/arch/loongarch/decode.c | 11 ++++++++++-
 tools/objtool/check.c                 | 23 ++++++++++++++++++++---
 tools/objtool/include/objtool/elf.h   |  1 +
 5 files changed, 33 insertions(+), 10 deletions(-)

-- 
2.42.0
Re: [PATCH v3 0/4] Fix objtool issues about do_syscall() and Clang on LoongArch
Posted by Huacai Chen 1 year, 5 months ago
Hi, Ruoyao and Jinyang,

On Wed, Aug 7, 2024 at 4:59 PM Tiezhu Yang <yangtiezhu@loongson.cn> wrote:
>
> With this series, there is no objtool warning about do_syscall() and
> there is handle_syscall() which is the previous frame of do_syscall()
> in the call trace when running "echo l > /proc/sysrq-trigger".
>
> Compiled with GCC and Clang, tested with the following two configs:
>
> (1) CONFIG_RANDOMIZE_KSTACK_OFFSET=y &&
>     CONFIG_RANDOMIZE_KSTACK_OFFSET_DEFAULT=n
> (2) CONFIG_RANDOMIZE_KSTACK_OFFSET=y &&
>     CONFIG_RANDOMIZE_KSTACK_OFFSET_DEFAULT=y
Please review this series. If you have no objections, I will apply to
loongarch-next.

Huacai

>
> Tiezhu Yang (4):
>   objtool: Handle frame pointer related instructions
>   LoongArch: Remove STACK_FRAME_NON_STANDARD(do_syscall)
>   LoongArch: Set AS_HAS_THIN_ADD_SUB as y if AS_IS_LLVM
>   LoongArch: Enable objtool for Clang
>
>  arch/loongarch/Kconfig                |  4 ++--
>  arch/loongarch/kernel/syscall.c       |  4 ----
>  tools/objtool/arch/loongarch/decode.c | 11 ++++++++++-
>  tools/objtool/check.c                 | 23 ++++++++++++++++++++---
>  tools/objtool/include/objtool/elf.h   |  1 +
>  5 files changed, 33 insertions(+), 10 deletions(-)
>
> --
> 2.42.0
>