All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH  0/1] x86/kprobes: Classify opcode while preparing kprobe
@ 2020-12-06 14:11 Masami Hiramatsu
  2020-12-06 14:11 ` [PATCH 1/1] x86/kprobes: Do not decode opcode in resume_execution() Masami Hiramatsu
  0 siblings, 1 reply; 12+ messages in thread
From: Masami Hiramatsu @ 2020-12-06 14:11 UTC (permalink / raw)
  To: Ingo Molnar, Steven Rostedt
  Cc: mhiramat, linux-kernel, Naveen N . Rao, Anil S Keshavamurthy,
	David Miller, Borislav Petkov, x86

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>

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-01-05 14:48 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-06 14:11 [PATCH 0/1] x86/kprobes: Classify opcode while preparing kprobe Masami Hiramatsu
2020-12-06 14:11 ` [PATCH 1/1] x86/kprobes: Do not decode opcode in resume_execution() Masami Hiramatsu
2020-12-07 20:28   ` Steven Rostedt
2020-12-18  1:02   ` [x86/kprobes] 413d31338f: kernel_BUG_at_mm/vmalloc.c kernel test robot
2020-12-18  1:02     ` kernel test robot
2020-12-18 12:44     ` Masami Hiramatsu
2020-12-18 12:44       ` Masami Hiramatsu
2020-12-18 14:12       ` [PATCH -tip v2] x86/kprobes: Do not decode opcode in resume_execution() Masami Hiramatsu
2020-12-31 16:09         ` Borislav Petkov
2021-01-04  3:45           ` Masami Hiramatsu
2021-01-04 18:40             ` Borislav Petkov
2021-01-05 14:47         ` [tip: perf/kprobes] " tip-bot2 for Masami Hiramatsu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.