All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masami Hiramatsu <mhiramat@kernel.org>
To: Ingo Molnar <mingo@kernel.org>, Steven Rostedt <rostedt@goodmis.org>
Cc: mhiramat@kernel.org, linux-kernel@vger.kernel.org,
	"Naveen N . Rao" <naveen.n.rao@linux.ibm.com>,
	Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>,
	David Miller <davem@davemloft.net>,
	Borislav Petkov <bp@alien8.de>,
	x86@kernel.org
Subject: [PATCH  0/1] x86/kprobes: Classify opcode while preparing kprobe
Date: Sun,  6 Dec 2020 23:11:28 +0900	[thread overview]
Message-ID: <160726388853.3413805.4854581312983421622.stgit@devnote2> (raw)

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>

             reply	other threads:[~2020-12-06 14:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-06 14:11 Masami Hiramatsu [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=160726388853.3413805.4854581312983421622.stgit@devnote2 \
    --to=mhiramat@kernel.org \
    --cc=anil.s.keshavamurthy@intel.com \
    --cc=bp@alien8.de \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=naveen.n.rao@linux.ibm.com \
    --cc=rostedt@goodmis.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.