lkml.org 
[lkml]   [2020]   [Dec]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject[PATCH 0/1] x86/kprobes: Classify opcode while preparing kprobe
Date
Hi,

I noticed that the kprobe x86 still has an inefficient code.

Currently kprobes x86 decodes opcode right after single
stepping in resume_execution(), which is kprobe's hot path.
But it already decoded the opcode while preparing
arch_specific_insn in arch_copy_kprobe(), so this is
inefficient.

So decode the opcode while preparing kprobes (arch_copy_kprobe())
instead of resume_execution() and set some flags for resuming from
single stepping. This also removes the custom instruction prefix
decoding, which should be done in x86 instruction decoder.

Thank you,

---

Masami Hiramatsu (1):
x86/kprobes: Do not decode opcode in resume_execution()


arch/x86/include/asm/kprobes.h | 11 ++-
arch/x86/kernel/kprobes/core.c | 166 ++++++++++++++++++----------------------
2 files changed, 80 insertions(+), 97 deletions(-)

--
Masami Hiramatsu (Linaro) <mhiramat@kernel.org>

\
 
 \ /
  Last update: 2020-12-06 15:13    [W:0.071 / U:0.304 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site