public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
To: Petr Mladek <pmladek@suse.cz>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	Jiri Kosina <jkosina@suse.cz>,
	linux-kernel@vger.kernel.org, x86@kernel.org
Subject: Re: [PATCH v3 4/8] x86: speed up int3-based patching using direct write
Date: Thu, 14 Nov 2013 20:36:50 +0900	[thread overview]
Message-ID: <5284B5D2.70206@hitachi.com> (raw)
In-Reply-To: <1384425686-21018-5-git-send-email-pmladek@suse.cz>

(2013/11/14 19:41), Petr Mladek wrote:
> @@ -837,7 +882,7 @@ static void recover_iter(struct text_poke_bp_iter *iterator,
>  	}
>  
>  	/* Finally, put back the first byte from the old code */
> -	err = text_poke(addr, old_opcode, sizeof(bp_int3));
> +	err = text_poke_part(addr, old_opcode, sizeof(bp_int3));
>  	/* we can not continue if the interrupt is still there */
>  	BUG_ON(err);
>  }
> @@ -865,7 +910,9 @@ static void recover_iter(struct text_poke_bp_iter *iterator,
>   * It is a bit more paranoid than text_poke_bp because it checks the actual
>   * code before patching. This is a good practice proposed by the ftrace code.
>   *
> - * Note: This function must be called under text_mutex.
> + * Note: This function must be called under text_mutex. Also the caller is
> + * responsible for making the patched code read-write, for example using
> + * set_kernel_text_rw() and set_all_modules_text_rw()

OK, I got the reason why we can do it.
But if so, we should change all existing caller of text_poke_bp() to
call it in this patch, or they must fail at this point.

Thank you,

-- 
Masami HIRAMATSU
IT Management Research Dept. Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@hitachi.com



  reply	other threads:[~2013-11-14 11:36 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-14 10:41 [PATCH v3 0/8] x86: use new text_poke_bp in ftrace Petr Mladek
2013-11-14 10:41 ` [PATCH v3 1/8] x86: allow to handle errors in text_poke function family Petr Mladek
2013-11-14 11:10   ` Masami Hiramatsu
2013-11-14 10:41 ` [PATCH v3 2/8] x86: allow to call text_poke_bp during boot Petr Mladek
2013-11-14 11:12   ` Masami Hiramatsu
2013-11-14 10:41 ` [PATCH v3 3/8] x86: add generic function to modify more calls using int3 framework Petr Mladek
2013-11-14 10:41 ` [PATCH v3 4/8] x86: speed up int3-based patching using direct write Petr Mladek
2013-11-14 11:36   ` Masami Hiramatsu [this message]
2013-11-14 12:46     ` Petr Mladek
2013-11-14 13:07       ` Masami Hiramatsu
2013-11-14 10:41 ` [PATCH v3 5/8] x86: do not trace __probe_kernel_read Petr Mladek
2013-11-14 10:41 ` [PATCH v3 6/8] x86: modify ftrace function using the new int3-based framework Petr Mladek
2013-11-14 10:41 ` [PATCH v3 7/8] x86: patch all traced function calls using the " Petr Mladek
2013-11-14 10:41 ` [PATCH v3 8/8] x86: enable/disable ftrace graph call using new " Petr Mladek

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=5284B5D2.70206@hitachi.com \
    --to=masami.hiramatsu.pt@hitachi.com \
    --cc=fweisbec@gmail.com \
    --cc=jkosina@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=pmladek@suse.cz \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox