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 v5 1/8] x86: allow to handle errors in text_poke function family
Date: Sat, 07 Dec 2013 10:20:14 +0900	[thread overview]
Message-ID: <52A277CE.4080900@hitachi.com> (raw)
In-Reply-To: <1386076887-2655-2-git-send-email-pmladek@suse.cz>

(2013/12/03 22:21), Petr Mladek wrote:
> The text_poke functions called BUG() in case of error. This was too strict.
> There are situations when the system is still usable even when the patching
> has failed, for example when enabling the dynamic ftrace.
> 
> This commit modifies text_poke, text_poke_early, and text_poke_bp functions
> to return an error code instead calling BUG(). The code is returned instead
> of the patched address. The address was just copied from the first parameter,
> so it was no extra information. It has not been used anywhere yet.

Hmm, this change basically good for me. However, from the maintenance point
of view, I'd like to recommend you to introduce some wrappers for them
to check return code and just do BUG() instead of changing all call-site,
because except for the text_poke_bp, we can not rollback the code safely.
(e.g. text_poke() returns an error but text_poke_or_die() just calls BUG
when it fails)

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-12-07  1:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-03 13:21 [PATCH v5 0/8] x86: use new text_poke_bp in ftrace Petr Mladek
2013-12-03 13:21 ` [PATCH v5 1/8] x86: allow to handle errors in text_poke function family Petr Mladek
2013-12-07  1:20   ` Masami Hiramatsu [this message]
2013-12-03 13:21 ` [PATCH v5 2/8] x86: allow to call text_poke_bp during boot Petr Mladek
2013-12-03 13:21 ` [PATCH v5 3/8] x86: add generic function to modify more calls using int3 framework Petr Mladek
2013-12-03 13:21 ` [PATCH v5 4/8] x86: speed up int3-based patching using direct write Petr Mladek
2013-12-03 13:21 ` [PATCH v5 5/8] x86: do not trace __probe_kernel_read Petr Mladek
2013-12-03 13:21 ` [PATCH v5 6/8] x86: modify ftrace function using the new int3-based framework Petr Mladek
2013-12-03 13:21 ` [PATCH v5 7/8] x86: patch all traced function calls using the " Petr Mladek
2013-12-03 13:21 ` [PATCH v5 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=52A277CE.4080900@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