[v5,0/6] Add uprobes support for LoongArch

Message ID 1685947150-4949-1-git-send-email-yangtiezhu@loongson.cn
Headers
Series Add uprobes support for LoongArch |

Message

Tiezhu Yang June 5, 2023, 6:39 a.m. UTC
  v5:
  -- Rebased on 6.4rc5
  -- Like arm64, add user_enable_single_step() in arch_uprobe_pre_xol(),
     add user_disable_single_step() in arch_uprobe_{post,abort}_xol(),
     suggested by Jeff and Huacai offline

v4:
  -- Rebased on 6.4rc1
  -- Fix problem about "perf probe -x /lib64/libc.so.6 malloc"

v3:
  -- Check atomic instructions in insns_not_supported()
  -- Remove five DIE_* definitions in kdebug.h

v2:
  -- Move the functions to inst.c in patch #1
  -- Pass around union for insns_not_supported(),
     insns_need_simulation() and arch_simulate_insn()

v1:
  -- Split the RFC patch #2 into two patches
  -- Use larch_insn_gen_break() to generate break insns
     for kprobes and uprobes
  -- Pass around instruction word instead of union for
     insns_not_supported(), insns_need_simulation() and
     arch_simulate_insn() to avoid type conversion for callers
  -- Add a simple test case for uprobes in the commit message

Tiezhu Yang (6):
  LoongArch: Move three functions from kprobes.c to inst.c
  LoongArch: Add larch_insn_gen_break() to generate break insns
  LoongArch: Use larch_insn_gen_break() for kprobes
  LoongArch: Add uprobes support
  LoongArch: Check atomic instructions in insns_not_supported()
  LoongArch: Remove five DIE_* definitions in kdebug.h

 arch/loongarch/Kconfig               |   3 +
 arch/loongarch/include/asm/inst.h    |  42 ++++++++++
 arch/loongarch/include/asm/kdebug.h  |   5 --
 arch/loongarch/include/asm/kprobes.h |   2 +-
 arch/loongarch/include/asm/uprobes.h |  35 ++++++++
 arch/loongarch/kernel/Makefile       |   1 +
 arch/loongarch/kernel/inst.c         |  54 +++++++++++++
 arch/loongarch/kernel/kprobes.c      |  75 ++++-------------
 arch/loongarch/kernel/traps.c        |   9 +--
 arch/loongarch/kernel/uprobes.c      | 152 +++++++++++++++++++++++++++++++++++
 10 files changed, 306 insertions(+), 72 deletions(-)
 create mode 100644 arch/loongarch/include/asm/uprobes.h
 create mode 100644 arch/loongarch/kernel/uprobes.c
  

Comments

Huacai Chen June 7, 2023, 8:52 a.m. UTC | #1
Hi, Jeff,

I queued this series at
https://github.com/chenhuacai/linux/commits/loongarch-next, could you
please test it when you have time? Thanks.

Huacai

On Mon, Jun 5, 2023 at 2:39 PM Tiezhu Yang <yangtiezhu@loongson.cn> wrote:
>
> v5:
>   -- Rebased on 6.4rc5
>   -- Like arm64, add user_enable_single_step() in arch_uprobe_pre_xol(),
>      add user_disable_single_step() in arch_uprobe_{post,abort}_xol(),
>      suggested by Jeff and Huacai offline
>
> v4:
>   -- Rebased on 6.4rc1
>   -- Fix problem about "perf probe -x /lib64/libc.so.6 malloc"
>
> v3:
>   -- Check atomic instructions in insns_not_supported()
>   -- Remove five DIE_* definitions in kdebug.h
>
> v2:
>   -- Move the functions to inst.c in patch #1
>   -- Pass around union for insns_not_supported(),
>      insns_need_simulation() and arch_simulate_insn()
>
> v1:
>   -- Split the RFC patch #2 into two patches
>   -- Use larch_insn_gen_break() to generate break insns
>      for kprobes and uprobes
>   -- Pass around instruction word instead of union for
>      insns_not_supported(), insns_need_simulation() and
>      arch_simulate_insn() to avoid type conversion for callers
>   -- Add a simple test case for uprobes in the commit message
>
> Tiezhu Yang (6):
>   LoongArch: Move three functions from kprobes.c to inst.c
>   LoongArch: Add larch_insn_gen_break() to generate break insns
>   LoongArch: Use larch_insn_gen_break() for kprobes
>   LoongArch: Add uprobes support
>   LoongArch: Check atomic instructions in insns_not_supported()
>   LoongArch: Remove five DIE_* definitions in kdebug.h
>
>  arch/loongarch/Kconfig               |   3 +
>  arch/loongarch/include/asm/inst.h    |  42 ++++++++++
>  arch/loongarch/include/asm/kdebug.h  |   5 --
>  arch/loongarch/include/asm/kprobes.h |   2 +-
>  arch/loongarch/include/asm/uprobes.h |  35 ++++++++
>  arch/loongarch/kernel/Makefile       |   1 +
>  arch/loongarch/kernel/inst.c         |  54 +++++++++++++
>  arch/loongarch/kernel/kprobes.c      |  75 ++++-------------
>  arch/loongarch/kernel/traps.c        |   9 +--
>  arch/loongarch/kernel/uprobes.c      | 152 +++++++++++++++++++++++++++++++++++
>  10 files changed, 306 insertions(+), 72 deletions(-)
>  create mode 100644 arch/loongarch/include/asm/uprobes.h
>  create mode 100644 arch/loongarch/kernel/uprobes.c
>
> --
> 2.1.0
>
  
Jeff Xie June 12, 2023, 7:41 a.m. UTC | #2
On Wed, Jun 7, 2023 at 4:52 PM Huacai Chen <chenhuacai@kernel.org> wrote:
>
> Hi, Jeff,
>
> I queued this series at
> https://github.com/chenhuacai/linux/commits/loongarch-next, could you
> please test it when you have time? Thanks.

I have tested this series and saw no errors while using uprobe, the
patchset looks good to me.

Tested-by: Jeff Xie <xiehuan09@gmail.com>

>
> Huacai
>
> On Mon, Jun 5, 2023 at 2:39 PM Tiezhu Yang <yangtiezhu@loongson.cn> wrote:
> >
> > v5:
> >   -- Rebased on 6.4rc5
> >   -- Like arm64, add user_enable_single_step() in arch_uprobe_pre_xol(),
> >      add user_disable_single_step() in arch_uprobe_{post,abort}_xol(),
> >      suggested by Jeff and Huacai offline
> >
> > v4:
> >   -- Rebased on 6.4rc1
> >   -- Fix problem about "perf probe -x /lib64/libc.so.6 malloc"
> >
> > v3:
> >   -- Check atomic instructions in insns_not_supported()
> >   -- Remove five DIE_* definitions in kdebug.h
> >
> > v2:
> >   -- Move the functions to inst.c in patch #1
> >   -- Pass around union for insns_not_supported(),
> >      insns_need_simulation() and arch_simulate_insn()
> >
> > v1:
> >   -- Split the RFC patch #2 into two patches
> >   -- Use larch_insn_gen_break() to generate break insns
> >      for kprobes and uprobes
> >   -- Pass around instruction word instead of union for
> >      insns_not_supported(), insns_need_simulation() and
> >      arch_simulate_insn() to avoid type conversion for callers
> >   -- Add a simple test case for uprobes in the commit message
> >
> > Tiezhu Yang (6):
> >   LoongArch: Move three functions from kprobes.c to inst.c
> >   LoongArch: Add larch_insn_gen_break() to generate break insns
> >   LoongArch: Use larch_insn_gen_break() for kprobes
> >   LoongArch: Add uprobes support
> >   LoongArch: Check atomic instructions in insns_not_supported()
> >   LoongArch: Remove five DIE_* definitions in kdebug.h
> >
> >  arch/loongarch/Kconfig               |   3 +
> >  arch/loongarch/include/asm/inst.h    |  42 ++++++++++
> >  arch/loongarch/include/asm/kdebug.h  |   5 --
> >  arch/loongarch/include/asm/kprobes.h |   2 +-
> >  arch/loongarch/include/asm/uprobes.h |  35 ++++++++
> >  arch/loongarch/kernel/Makefile       |   1 +
> >  arch/loongarch/kernel/inst.c         |  54 +++++++++++++
> >  arch/loongarch/kernel/kprobes.c      |  75 ++++-------------
> >  arch/loongarch/kernel/traps.c        |   9 +--
> >  arch/loongarch/kernel/uprobes.c      | 152 +++++++++++++++++++++++++++++++++++
> >  10 files changed, 306 insertions(+), 72 deletions(-)
> >  create mode 100644 arch/loongarch/include/asm/uprobes.h
> >  create mode 100644 arch/loongarch/kernel/uprobes.c
> >
> > --
> > 2.1.0
> >