Skip to content

RFC jump label v4

Jason Baron lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest8 patches 26 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8jump label v4 - kprobes/x86: Cleanup RELATIVEJUMP_INSTRUCTION to RELATIVEJUMP_OPCODEarch/x86/include/asm/kprobes.h arch/x86/kernel/kprobes.c+2 -20 replies
2/8jump label v4 - x86: Introduce generic jump patching without stop_machinearch/x86/include/asm/alternative.h arch/x86/include/asm/kprobes.h arch/x86/kernel/alternative.c +1 more+134 -126 replies
3/8jump label v4 - move opcode definitionsarch/x86/include/asm/alternative.h arch/x86/include/asm/kprobes.h+5 -40 replies
4/8jump label v4 - notifier atomic call chain notracekernel/notifier.c+3 -30 replies
5/8jump label v4 - base patchinclude/asm-generic/vmlinux.lds.h include/linux/jump_label.h kernel/Makefile +1 more+232 -20 replies
6/8jump label v4 - x86 supportarch/x86/include/asm/jump_label.h arch/x86/kernel/Makefile arch/x86/kernel/jump_label.c+85 -10 replies
7/8jump label v4 - tracepoint supportinclude/linux/tracepoint.h kernel/tracepoint.c+27 -150 replies
8/8jump label v4 - add module supportarch/x86/kernel/ptrace.c include/linux/jump_label.h include/linux/module.h +2 more+150 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/8] jump label v4

hi,

For background, see previous posting: http://marc.info/?l=linux-kernel&m=125858436505941&w=2

Refresh of the jump labeling patches. The largest update revolves around how the jump labels are organized. I've added a hash table, using the name of the tracepoints as the 'key'. (I might want to change this to a pointer, for other users, but the string key works well for tracepoints). I've also pre-sorted the jump tables by name. Thus, when a jump label is enabled/disabled we look up its hash table entry and then walk the list of associated jump labels. The implementation also associates module jump sections with the appropriate keys as they are inserted and removed.

The first 2 patches of the series are a repost of Masami's text_poke_fixup() function, which allows for efficient instruction patching. I believe this is still an ongoing discussion, on the best safest approach here. Masami's text_poke_fixup() has been working well for me. But I could certainly substitute a 'stop_machine()' version or something similar if there is enough interest, until we have a more efficient solution.

patches are against the latest -tip tree.

thanks,

-Jason

Masami Hiramatsu (2):
x86: Introduce generic jump patching without stop_machine kprobes/x86: Cleanup RELATIVEJUMP_INSTRUCTION to RELATIVEJUMP_OPCODE

Mathieu Desnoyers (1):
notifier atomic call chain notrace

Jason Baron(5):
move opcode defs from asm/kprobes.h to asm/alternative.h jump label base
x86: jump label support
jump label tracepoint support
jump label module support

 arch/x86/include/asm/alternative.h |   17 ++
 arch/x86/include/asm/jump_label.h  |   32 ++++
 arch/x86/include/asm/kprobes.h     |    3 -
 arch/x86/kernel/Makefile           |    2 +-
 arch/x86/kernel/alternative.c      |  120 ++++++++++++++
 arch/x86/kernel/jump_label.c       |   52 ++++++
 arch/x86/kernel/kprobes.c          |    2 +-
 arch/x86/kernel/ptrace.c           |    1 +
 include/asm-generic/vmlinux.lds.h  |   10 +-
 include/linux/jump_label.h         |   58 +++++++
 include/linux/module.h             |    5 +-
 include/linux/tracepoint.h         |   34 +++--
 kernel/Makefile                    |    2 +-
 kernel/jump_label.c                |  301 ++++++++++++++++++++++++++++++++++++
 kernel/kprobes.c                   |    2 +-
 kernel/module.c                    |    7 +
 kernel/notifier.c                  |    6 +-
 kernel/tracepoint.c                |    8 +
 18 files changed, 635 insertions(+), 27 deletions(-)
 create mode 100644 arch/x86/include/asm/jump_label.h
 create mode 100644 arch/x86/kernel/jump_label.c
 create mode 100644 include/linux/jump_label.h
 create mode 100644 kernel/jump_label.c