From: Torsten Duwe <duwe@lst.de> To: Josh Poimboeuf <jpoimboe@redhat.com> Cc: linux-arch@vger.kernel.org, Jungseok Lee <jungseoklee85@gmail.com>, Arnd Bergmann <arnd@arndb.de>, Catalin Marinas <catalin.marinas@arm.com>, Christopher Li <sparse@chrisli.org>, Jiri Kosina <jikos@kernel.org>, Will Deacon <will.deacon@arm.com>, linux-kernel@vger.kernel.org, Steven Rostedt <rostedt@goodmis.org>, takahiro.akashi@linaro.org, linux-sparse@vger.kernel.org, Ingo Molnar <mingo@redhat.com>, andrew.wafaa@arm.com, Li Bin <huawei.libin@huawei.com>, live-patching@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2 1/2] arm64: implement FTRACE_WITH_REGS Date: Mon, 4 Jul 2016 11:18:41 +0200 [thread overview] Message-ID: <20160704091841.GB19960@lst.de> (raw) In-Reply-To: <20160701125344.usuovsvbpilzen4m@treble> On Fri, Jul 01, 2016 at 07:53:44AM -0500, Josh Poimboeuf wrote: > On Mon, Jun 27, 2016 at 05:17:17PM +0200, Torsten Duwe wrote: > > Once gcc is enhanced to optionally generate NOPs at the beginning > > of each function, like the concept proven in > > https://gcc.gnu.org/ml/gcc-patches/2016-04/msg01671.html > > (sans the "fprintf (... pad_size);", which spoils the data structure > > for kernel use), the generated pads can nicely be used to reroute > > function calls for tracing/profiling, or live patching. [...] > > @@ -35,6 +35,10 @@ KBUILD_CFLAGS += -fno-asynchronous-unwind-tables > > KBUILD_CFLAGS += $(call cc-option, -mpc-relative-literal-loads) > > KBUILD_AFLAGS += $(lseinstr) > > > > +ifeq ($(CONFIG_DYNAMIC_FTRACE_WITH_REGS), y) > > +CC_FLAGS_FTRACE := -fprolog-pad=2 -DCC_USING_PROLOG_PAD > > +endif > > + > > It would probably be good to print a warning for older gccs which don't > support this option, so that when the build fails, there's at least a > warning to indicate why. Something like: > > ifdef CONFIG_DYNAMIC_FTRACE_WITH_REGS > CC_FLAGS_FTRACE := -fprolog-pad=2 -DCC_USING_PROLOG_PAD > ifeq ($(call cc-option,-fprolog-pad=2),) > $(warning Cannot use CONFIG_DYNAMIC_FTRACE_WITH_REGS: \ > -fprolog-pad not supported by compiler) > endif > endif Yes. Ideally, compiler support could be checked even before the option is offered, but your explicit warning is better than just failing obscurely. What do you think about prolog-pad in general? If we can convince the gcc people to include it, it could become the default mechanism for all architectures that do not require special treatment (e.g. like ABIv2 dual entry on ppc64le). Torsten
WARNING: multiple messages have this Message-ID (diff)
From: Torsten Duwe <duwe@lst.de> To: Josh Poimboeuf <jpoimboe@redhat.com> Cc: Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will.deacon@arm.com>, takahiro.akashi@linaro.org, Jungseok Lee <jungseoklee85@gmail.com>, Arnd Bergmann <arnd@arndb.de>, Li Bin <huawei.libin@huawei.com>, Steven Rostedt <rostedt@goodmis.org>, Ingo Molnar <mingo@redhat.com>, Christopher Li <sparse@chrisli.org>, Jiri Kosina <jikos@kernel.org>, andrew.wafaa@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, live-patching@vger.kernel.org, linux-arch@vger.kernel.org, linux-sparse@vger.kernel.org Subject: Re: [PATCH v2 1/2] arm64: implement FTRACE_WITH_REGS Date: Mon, 4 Jul 2016 11:18:41 +0200 [thread overview] Message-ID: <20160704091841.GB19960@lst.de> (raw) Message-ID: <20160704091841.mXLIj3lV8LuEPzyP4NHrjN1aDqkz1CDEeI_G8tRGlUo@z> (raw) In-Reply-To: <20160701125344.usuovsvbpilzen4m@treble> On Fri, Jul 01, 2016 at 07:53:44AM -0500, Josh Poimboeuf wrote: > On Mon, Jun 27, 2016 at 05:17:17PM +0200, Torsten Duwe wrote: > > Once gcc is enhanced to optionally generate NOPs at the beginning > > of each function, like the concept proven in > > https://gcc.gnu.org/ml/gcc-patches/2016-04/msg01671.html > > (sans the "fprintf (... pad_size);", which spoils the data structure > > for kernel use), the generated pads can nicely be used to reroute > > function calls for tracing/profiling, or live patching. [...] > > @@ -35,6 +35,10 @@ KBUILD_CFLAGS += -fno-asynchronous-unwind-tables > > KBUILD_CFLAGS += $(call cc-option, -mpc-relative-literal-loads) > > KBUILD_AFLAGS += $(lseinstr) > > > > +ifeq ($(CONFIG_DYNAMIC_FTRACE_WITH_REGS), y) > > +CC_FLAGS_FTRACE := -fprolog-pad=2 -DCC_USING_PROLOG_PAD > > +endif > > + > > It would probably be good to print a warning for older gccs which don't > support this option, so that when the build fails, there's at least a > warning to indicate why. Something like: > > ifdef CONFIG_DYNAMIC_FTRACE_WITH_REGS > CC_FLAGS_FTRACE := -fprolog-pad=2 -DCC_USING_PROLOG_PAD > ifeq ($(call cc-option,-fprolog-pad=2),) > $(warning Cannot use CONFIG_DYNAMIC_FTRACE_WITH_REGS: \ > -fprolog-pad not supported by compiler) > endif > endif Yes. Ideally, compiler support could be checked even before the option is offered, but your explicit warning is better than just failing obscurely. What do you think about prolog-pad in general? If we can convince the gcc people to include it, it could become the default mechanism for all architectures that do not require special treatment (e.g. like ABIv2 dual entry on ppc64le). Torsten
next prev parent reply other threads:[~2016-07-04 9:18 UTC|newest] Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top 2016-06-27 15:15 [PATCH v2 0/2] arm64 live patching Torsten Duwe 2016-06-27 15:15 ` Torsten Duwe 2016-06-27 15:17 ` [PATCH v2 1/2] arm64: implement FTRACE_WITH_REGS Torsten Duwe 2016-06-27 15:17 ` Torsten Duwe 2016-07-01 12:53 ` Josh Poimboeuf 2016-07-01 12:53 ` Josh Poimboeuf 2016-07-04 9:18 ` Torsten Duwe [this message] 2016-07-04 9:18 ` Torsten Duwe 2016-07-03 5:17 ` kbuild test robot 2016-07-08 14:58 ` Petr Mladek 2016-07-08 14:58 ` Petr Mladek 2016-07-08 15:07 ` Torsten Duwe 2016-07-08 15:24 ` Petr Mladek 2016-07-08 15:24 ` Petr Mladek 2016-07-08 15:48 ` Josh Poimboeuf 2016-07-08 15:48 ` Josh Poimboeuf 2016-07-08 15:57 ` Steven Rostedt 2016-07-08 20:24 ` Torsten Duwe 2016-07-08 20:24 ` Torsten Duwe 2016-07-08 21:08 ` Steven Rostedt 2016-07-09 9:06 ` Torsten Duwe 2016-07-09 9:06 ` Torsten Duwe 2016-07-15 18:36 ` Steven Rostedt 2016-07-15 18:36 ` Steven Rostedt 2016-07-08 15:49 ` Steven Rostedt 2016-06-27 15:17 ` [PATCH v2 2/2] arm64: implement live patching Torsten Duwe 2016-06-27 15:17 ` Torsten Duwe 2016-07-11 14:03 ` Miroslav Benes 2016-07-11 14:03 ` Miroslav Benes 2016-07-11 21:58 ` Jessica Yu 2016-07-12 9:47 ` Miroslav Benes 2016-07-13 0:11 ` [PATCH] arm64: take SHN_LIVEPATCH syms into account when calculating plt_max_entries Jessica Yu 2016-07-13 0:11 ` Jessica Yu 2016-08-17 9:38 ` Miroslav Benes 2016-08-17 9:38 ` Miroslav Benes 2016-08-11 16:46 ` [PATCH v2 2/2] arm64: implement live patching Torsten Duwe 2016-08-11 16:46 ` Torsten Duwe 2016-07-15 16:03 ` Paul Gortmaker
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=20160704091841.GB19960@lst.de \ --to=duwe@lst.de \ --cc=andrew.wafaa@arm.com \ --cc=arnd@arndb.de \ --cc=catalin.marinas@arm.com \ --cc=huawei.libin@huawei.com \ --cc=jikos@kernel.org \ --cc=jpoimboe@redhat.com \ --cc=jungseoklee85@gmail.com \ --cc=linux-arch@vger.kernel.org \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-sparse@vger.kernel.org \ --cc=live-patching@vger.kernel.org \ --cc=mingo@redhat.com \ --cc=rostedt@goodmis.org \ --cc=sparse@chrisli.org \ --cc=takahiro.akashi@linaro.org \ --cc=will.deacon@arm.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: linkBe 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).