linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/2] x86/kprobes: add exception opcode detector and boost more opcodes
@ 2024-01-27  4:41 Jinghao Jia
  2024-01-27  4:41 ` [RFC PATCH 1/2] x86/kprobes: Prohibit kprobing on INT and UD Jinghao Jia
  2024-01-27  4:41 ` [RFC PATCH 2/2] x86/kprobes: boost more instructions from grp2/3/4/5 Jinghao Jia
  0 siblings, 2 replies; 13+ messages in thread
From: Jinghao Jia @ 2024-01-27  4:41 UTC (permalink / raw)
  To: Masami Hiramatsu (Google), Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, Dave Hansen, x86, H. Peter Anvin, Peter Zijlstra
  Cc: linux-trace-kernel, linux-kernel, Jinghao Jia

Hi everyone,

This patch set makes the following 2 changes:

- It adds an exception opcode detector to prevent kprobing on INTs and UDs.
  These opcodes serves special purposes in the kernel and kprobing them
  will also cause the stack trace to be polluted by the copy buffer
  address. This is suggested by Masami.

- At the same time, this patch set also boosts more opcodes from the group
  2/3/4/5. The newly boosted opcodes are all arithmetic instructions with
  semantics that are easy to reason about, and therefore, they are able to
  be boosted and executed out-of-line. These instructions were not boosted
  previously because they use opcode extensions that are not handled by the
  kernel. But now with the instruction decoder they can be easily handled.
  Boosting (and further jump optimizing) these instructions leads to a 10x
  performance gain for a single probe on QEMU.

Jinghao Jia (2):
  x86/kprobes: Prohibit kprobing on INT and UD
  x86/kprobes: boost more instructions from grp2/3/4/5

 arch/x86/kernel/kprobes/core.c | 54 ++++++++++++++++++++++++++--------
 1 file changed, 41 insertions(+), 13 deletions(-)

--
2.43.0


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

end of thread, other threads:[~2024-01-30 11:30 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-27  4:41 [RFC PATCH 0/2] x86/kprobes: add exception opcode detector and boost more opcodes Jinghao Jia
2024-01-27  4:41 ` [RFC PATCH 1/2] x86/kprobes: Prohibit kprobing on INT and UD Jinghao Jia
2024-01-27 19:47   ` Xin Li
2024-01-28 21:09     ` Jinghao Jia
2024-01-28  1:19   ` Masami Hiramatsu
2024-01-28 21:25     ` Jinghao Jia
2024-01-30  1:44       ` Masami Hiramatsu
2024-01-30  2:50         ` Jinghao Jia
2024-01-30 11:30           ` Masami Hiramatsu
2024-01-27  4:41 ` [RFC PATCH 2/2] x86/kprobes: boost more instructions from grp2/3/4/5 Jinghao Jia
2024-01-28  2:22   ` Masami Hiramatsu
2024-01-28 21:30     ` Jinghao Jia
2024-01-30  1:45       ` Masami Hiramatsu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).