mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Eugene Shatokhin <eugene.shatokhin@rosalab.ru>
To: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
	Ingo Molnar <mingo@kernel.org>
Cc: Andy Lutomirski <luto@amacapital.net>,
	Ingo Molnar <mingo@redhat.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 0/2] kprobes/x86: Allow "boost" for 10- and 11-byte instructions
Date: Mon,  1 Jun 2015 19:32:09 +0300	[thread overview]
Message-ID: <1433176331-479-1-git-send-email-eugene.shatokhin@rosalab.ru> (raw)

Kprobes' "boost" feature allows to avoid single-stepping in some cases, along with its overhead. It is useful for the Kprobes that cannot be optimized for some reason.

Currently, "boost" cannot be applied to the instructions of 10 and 11 bytes in size, including some rather commonly used kinds of MOV.

The first of the two patches in this series fixes the code that checks if the jump needed for the boost fits in the insn slot (the conditional is too strict). This allows to apply "boost" to 10-byte instructions.

As a side effect of commit 91e5ed49fca0 ("x86/asm/decoder: Fix and enforce max instruction size in the insn decoder"), the size of the instruction slot became 1 byte smaller, 15 bytes VS 16 bytes before that change. The second patch makes the size of each insn slot 16 bytes again (while keeping MAX_INSN_SIZE as 15). This allows to apply "boost" to 11-byte instructions as well.

I have checked that "boost" does happen for at least "movq $0x1,0x100(%rbx)" (48 c7 83 00 01 00 00 01 00 00 00) in the kernel 4.1-rc6 after these changes.

arch/x86/include/asm/kprobes.h | 1 +
arch/x86/kernel/kprobes/core.c | 2 +-
kernel/kprobes.c               | 8 ++++++--
3 files changed, 8 insertions(+), 3 deletions(-)

Regards,

Eugene


             reply	other threads:[~2015-06-01 16:33 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-01 16:32 Eugene Shatokhin [this message]
2015-06-01 16:32 ` [PATCH 1/2] kprobes/x86: boost: Fix checking if there is enough room for a jump Eugene Shatokhin
2015-06-01 21:51   ` Masami Hiramatsu
2015-06-01 16:32 ` [PATCH 2/2] kprobes/x86: Use 16 bytes for each instruction slot again Eugene Shatokhin
2015-06-01 17:04   ` Andy Lutomirski
2015-06-01 21:49     ` Masami Hiramatsu
2015-06-01 21:57       ` Andy Lutomirski
2015-06-02 21:42         ` Masami Hiramatsu
2015-06-02  5:44       ` Ingo Molnar
2015-06-02 21:46         ` Masami Hiramatsu
2015-06-02 21:55           ` Andy Lutomirski
2015-06-04 21:59             ` Masami Hiramatsu
2015-06-03  7:28           ` Ingo Molnar
2015-06-01 21:58   ` Masami Hiramatsu
2015-06-02  5:47   ` Ingo Molnar
2015-06-01 21:44 ` [PATCH 0/2] kprobes/x86: Allow "boost" for 10- and 11-byte instructions Masami Hiramatsu
2015-06-03  7:54 ` [PATCH v2 2/2] kprobes/x86: Use 16 bytes for each instruction slot again Eugene Shatokhin
2015-06-04 14:42   ` Jeff Epler

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=1433176331-479-1-git-send-email-eugene.shatokhin@rosalab.ru \
    --to=eugene.shatokhin@rosalab.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=mingo@kernel.org \
    --cc=mingo@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®