Skip to content

Conversation

@olsajiri
Copy link
Contributor

No description provided.

@olsajiri olsajiri marked this pull request as ready for review November 17, 2025 08:54
@olsajiri olsajiri marked this pull request as draft November 18, 2025 08:10
It's not used, pt_regs_offset returns only offset to struct pt_regs,
not the actual register values.

Signed-off-by: Jiri Olsa <[email protected]>
It's not used, get_reg_offset returns only offset to struct pt_regs,
not the actual register values.

Signed-off-by: Jiri Olsa <[email protected]>
It's not used, insn_get_modrm_rm_off returns only offset to struct
pt_regs, not the actual register values.

Signed-off-by: Jiri Olsa <[email protected]>
It's not used, insn_get_modrm_reg_off returns only offset to struct
pt_regs, not the actual register values.

Signed-off-by: Jiri Olsa <[email protected]>
It's not used, get_reg_offset_16 returns only offset to struct
pt_regs, not the actual register values.

Signed-off-by: Jiri Olsa <[email protected]>
Mov xol data into separate arch_uprobe_xol object so we can
hold more of them in following changes.

Signed-off-by: Jiri Olsa <[email protected]>
Using struct arch_uprobe_xol also in emulate callback
which will help in following changes.

Signed-off-by: Jiri Olsa <[email protected]>
Adding support to emulate mov reg to reg instructions, because it's
often part of the function prologue.

Signed-off-by: Jiri Olsa <[email protected]>
Adding support to emulate sub reg, imm instructions, because it's
often part of the function prologue.

Signed-off-by: Jiri Olsa <[email protected]>
Adding support to optimize uprobe on top of instructions that can
be emulated.

The idea is to store instructions on underlying 5 bytes and emulate
them during the int3 and uprobe syscall execution:

  - install 'call trampoline' through standard int3 update
  - if int3 is hit before we finish optimizing we emulate
    all underlying instructions
  - when call is installed the uprobe syscall will emulate
    all underlying instructions

Adding opt_xol_ops that emulate instructions that are replaced
by 5 bytes call instruction used to optimize the uprobe.

Signed-off-by: Jiri Olsa <[email protected]>
Adding test code for mov and sub instructions emulation.

TODO add test for sub flags value emulation.

Signed-off-by: Jiri Olsa <[email protected]>
Adding test that places uprobe on top of supported prologue
and checks that the uprobe gets properly optimized.

Signed-off-by: Jiri Olsa <[email protected]>
Adding uprobe race test on top of prologue instructions.

Signed-off-by: Jiri Olsa <[email protected]>
@kernel-patches-daemon-bpf kernel-patches-daemon-bpf bot force-pushed the bpf-next_base branch 5 times, most recently from bfb0726 to b0a5b86 Compare November 20, 2025 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant