From: Steven Rostedt <rostedt@goodmis.org>
To: "Christopher M. Riedl" <cmr@informatik.wtf>
Cc: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>,
linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH 1/3] powerpc: Properly return error code from do_patch_instruction()
Date: Sat, 25 Apr 2020 10:10:14 -0400 [thread overview]
Message-ID: <20200425101014.0c1b5fe0@oasis.local.home> (raw)
In-Reply-To: <C29ONNE5PMZ3.2R5TT1FV2RFHC@geist>
On Fri, 24 Apr 2020 14:26:02 -0500
"Christopher M. Riedl" <cmr@informatik.wtf> wrote:
> On Fri Apr 24, 2020 at 9:15 AM, Steven Rostedt wrote:
> > On Thu, 23 Apr 2020 18:21:14 +0200
> > Christophe Leroy <christophe.leroy@c-s.fr> wrote:
> >
> >
> > > Le 23/04/2020 à 17:09, Naveen N. Rao a écrit :
> > > > With STRICT_KERNEL_RWX, we are currently ignoring return value from
> > > > __patch_instruction() in do_patch_instruction(), resulting in the error
> > > > not being propagated back. Fix the same.
> > >
> > > Good patch.
> > >
> > > Be aware that there is ongoing work which tend to wanting to replace
> > > error reporting by BUG_ON() . See
> > > https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=166003
> >
> >
> > Thanks for the reference. I still believe that WARN_ON() should be used
> > in
> > 99% of the cases, including here. And only do a BUG_ON() when you know
> > there's no recovering from it.
> >
> >
> > In fact, there's still BUG_ON()s in my code that I need to convert to
> > WARN_ON() (it was written when BUG_ON() was still acceptable ;-)
> >
> Figured I'd chime in since I am working on that other series :) The
> BUG_ON()s are _only_ in the init code to set things up to allow a
> temporary mapping for patching a STRICT_RWX kernel later. There's no
> ongoing work to "replace error reporting by BUG_ON()". If that initial
> setup fails we cannot patch under STRICT_KERNEL_RWX at all which imo
> warrants a BUG_ON(). I am still working on v2 of my RFC which does
> return any __patch_instruction() error back to the caller of
> patch_instruction() similar to this patch.
I agree certain locations may warrant a BUG_ON(), but I wouldn't make a
generic operation like patch_instruction() BUG, as it may be used in
cases that do not warrant it (like setting up ftrace).
Deciding to BUG on not based on the return code of patch_instruction()
is the way to go IMO.
-- Steve
next prev parent reply other threads:[~2020-04-25 14:20 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-23 15:09 [PATCH 0/3] powerpc: Enhance error handling with patch_instruction() Naveen N. Rao
2020-04-23 15:09 ` [PATCH 1/3] powerpc: Properly return error code from do_patch_instruction() Naveen N. Rao
2020-04-23 16:21 ` Christophe Leroy
2020-04-24 13:15 ` Steven Rostedt
2020-04-24 18:07 ` Naveen N. Rao
2020-04-24 18:29 ` Steven Rostedt
2020-04-24 19:26 ` Christopher M. Riedl
2020-04-25 14:10 ` Steven Rostedt [this message]
2020-04-25 14:11 ` Steven Rostedt
2020-04-27 17:14 ` Naveen N. Rao
2020-04-24 18:02 ` Naveen N. Rao
2022-01-14 16:19 ` Christophe Leroy
2020-04-23 15:09 ` [PATCH 2/3] powerpc/ftrace: Simplify error checking when patching instructions Naveen N. Rao
2020-04-23 15:44 ` Christophe Leroy
2020-04-23 15:09 ` [PATCH 3/3] powerpc/kprobes: Check return value of patch_instruction() Naveen N. Rao
2020-04-23 15:41 ` Christophe Leroy
2020-04-24 13:22 ` Steven Rostedt
2020-04-24 18:26 ` Naveen N. Rao
2020-04-24 18:31 ` Steven Rostedt
2020-04-24 19:38 ` Naveen N. Rao
2020-04-25 10:11 ` Christophe Leroy
2020-04-25 14:06 ` Steven Rostedt
2020-04-27 17:13 ` Naveen N. Rao
2020-04-27 17:11 ` Naveen N. Rao
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=20200425101014.0c1b5fe0@oasis.local.home \
--to=rostedt@goodmis.org \
--cc=cmr@informatik.wtf \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=naveen.n.rao@linux.vnet.ibm.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;
as well as URLs for NNTP newsgroup(s).