[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5284CB22.7000604@hitachi.com>
Date: Thu, 14 Nov 2013 22:07:46 +0900
From: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
To: Petr Mladek <pmladek@...e.cz>
Cc: Steven Rostedt <rostedt@...dmis.org>,
Frederic Weisbecker <fweisbec@...il.com>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
Jiri Kosina <jkosina@...e.cz>, linux-kernel@...r.kernel.org,
x86@...nel.org
Subject: Re: [PATCH v3 4/8] x86: speed up int3-based patching using direct
write
(2013/11/14 21:46), Petr Mladek wrote:
> Masami Hiramatsu píše v Čt 14. 11. 2013 v 20:36 +0900:
>> (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.
>
> Ah, I used "text_poke_part" only in "text_poke_bp_iter" in the end. This
> function is currently used only in ftrace that sets the code read-write
> in "ftrace_arch_code_modify_prepare", see arch/x86/kernel/ftrace.c.
Oh, I see, I missed that.
> Note that "text_poke_bp" still uses "text_poke". It seems that the
> remapping is faster if you patch only one address.
>
> So, we should be on the safe side.
OK, so this looks good for me. :)
Reviewed-by: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
Thank you,
--
Masami HIRAMATSU
IT Management Research Dept. Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@...achi.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists