Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933859AbbLWRjK (ORCPT ); Wed, 23 Dec 2015 12:39:10 -0500 Received: from mailapp01.imgtec.com ([195.59.15.196]:25236 "EHLO imgpgp01.kl.imgtec.org" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933738AbbLWRjI (ORCPT ); Wed, 23 Dec 2015 12:39:08 -0500 X-PGP-Universal: processed; by imgpgp01.kl.imgtec.org on Wed, 23 Dec 2015 17:39:06 +0000 Date: Wed, 23 Dec 2015 17:39:05 +0000 From: James Hogan To: Steven Rostedt CC: Li Bin , , , Subject: Re: [PATCH v2 2/5] metag: ftrace: fix the comments for ftrace_modify_code Message-ID: <20151223173905.GA22683@jhogan-linux.le.imgtec.org> References: <1449367378-29430-1-git-send-email-huawei.libin@huawei.com> <1449367378-29430-3-git-send-email-huawei.libin@huawei.com> <20151223123346.46bb525b@gandalf.local.home> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="bg08WKrSYDhXBjb5" Content-Disposition: inline In-Reply-To: <20151223123346.46bb525b@gandalf.local.home> User-Agent: Mutt/1.5.23 (2014-03-12) X-Originating-IP: [192.168.154.110] X-ESG-ENCRYPT-TAG: 30575414 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3621 Lines: 97 --bg08WKrSYDhXBjb5 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Steven, On Wed, Dec 23, 2015 at 12:33:46PM -0500, Steven Rostedt wrote: > On Sun, 6 Dec 2015 10:02:55 +0800 > Li Bin wrote: >=20 > > There is no need to worry about module and __init text disappearing > > case, because that ftrace has a module notifier that is called when > > a module is being unloaded and before the text goes away and this > > code grabs the ftrace_lock mutex and removes the module functions > > from the ftrace list, such that it will no longer do any > > modifications to that module's text, the update to make functions > > be traced or not is done under the ftrace_lock mutex as well. > > And by now, __init section codes should not been modified > > by ftrace, because it is black listed in recordmcount.c and > > ignored by ftrace. > >=20 > > Cc: James Hogan > > Cc: linux-metag@vger.kernel.org > > Suggested-by: Steven Rostedt > > Signed-off-by: Li Bin >=20 > Hi, can I get a metag maintainer to ack this. Or you can take the patch > too. Yep, sorry for the delay, Acked-by: James Hogan Cheers James >=20 > -- Steve >=20 > > --- > > arch/metag/kernel/ftrace.c | 11 +++++------ > > 1 files changed, 5 insertions(+), 6 deletions(-) > >=20 > > diff --git a/arch/metag/kernel/ftrace.c b/arch/metag/kernel/ftrace.c > > index ed1d685..ac8c039 100644 > > --- a/arch/metag/kernel/ftrace.c > > +++ b/arch/metag/kernel/ftrace.c > > @@ -54,12 +54,11 @@ static int ftrace_modify_code(unsigned long pc, uns= igned char *old_code, > > unsigned char replaced[MCOUNT_INSN_SIZE]; > > =20 > > /* > > - * Note: Due to modules and __init, code can > > - * disappear and change, we need to protect against faulting > > - * as well as code changing. > > - * > > - * No real locking needed, this code is run through > > - * kstop_machine. > > + * Note: > > + * We are paranoid about modifying text, as if a bug was to happen, it > > + * could cause us to read or write to someplace that could cause harm. > > + * Carefully read and modify the code with probe_kernel_*(), and make > > + * sure what we read is what we expected it to be before modifying it. > > */ > > =20 > > /* read the text we want to modify */ >=20 --bg08WKrSYDhXBjb5 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJWetw5AAoJEGwLaZPeOHZ64XoP/0HemEoUGzi5jbna9cJQgEUY VcVYvxU1tjk/8X2FZEVm1jQuwQPttdCjqLGasdSlbqOu9UIxI0tUYkOF75NHEnyU lDlv5nFExrmq1KjcQC4LCFlIZXhvc/sr+yQsD0x8wk8umPTNBL8q45lPIAo/VHjS jODegCVqIElKUy5/GSe83AHuZ1eJQbA2aLBwbW/k+0mJP6X3Y/DNV+QGg4Nk/P8p Dd1KDdGNTuRUChVkdL468h5sAqynY/7Dnw9Qk1SFr2kcVoMuZLaIYaION7Q7RS/9 7m9SbRydb7LPYK3czyRWZFfiz6weYMnLlVHpLVMXOtzaqkC3ci2sTC5t3rm8iwV6 beOdqSUI1v0BFLbuvU2tQxq79eP8Jhy/AR1r5pSlPhfzkS4VRSirCFXoiPZhqb4X CVr4VEiR3KLSHvmzMaumvAz09uaZOIz1HMHYSxG1bZKMZjO4uejypOGI//9MiSZQ 9bTkHmLtFB2+1DjNJJCXOARVB1JnzakT+91KKavgJA2xYo1sM6ZsWYf3xZh6ozJB fkDZ6GVZ3xvKqwb6AgSoTgdcBdh8CCkrz/ozUia1poP0j52W1KggYr44fqwRZI3m 4cGmBS4G/tJnm/MQ3qXVoerKdF0l/a5TYA9VMkVN/uf30AgXGcDPEmD9AMnyTyB7 t/guO8emG0kydsA/mil9 =u1iL -----END PGP SIGNATURE----- --bg08WKrSYDhXBjb5-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/