Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1320272
| Path | csiph.com!news.freedyn.net!newsfeed.datemas.de!news.albasani.net!news.mixmin.net!aioe.org!news.servidellagleba.it!bofh.it!news.nic.it!robomod |
|---|---|
| From | Michael Ellerman <mpe@ellerman.id.au> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v6 1/9] ppc64 (le): prepare for -mprofile-kernel |
| Date | Thu, 28 Jan 2016 04:40:02 +0100 |
| Message-ID | <qVLB8-5Fa-7@gated-at.bofh.it> (permalink) |
| References | <qUSOm-7cE-23@gated-at.bofh.it> <qUSOm-7cE-21@gated-at.bofh.it> <qVvmG-1Z6-23@gated-at.bofh.it> <qVxRw-3BF-13@gated-at.bofh.it> |
| X-Original-To | Alan Modra <amodra@gmail.com> |
| Content-Type | text/plain; charset="UTF-8" |
| X-Mailer | Evolution 3.16.5-1ubuntu3.1 |
| MIME-Version | 1.0 |
| Content-Transfer-Encoding | 7bit |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 58 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Torsten Duwe <duwe@lst.de>, Steven Rostedt <rostedt@goodmis.org>, Anton Blanchard <anton@samba.org>, Jiri Kosina <jkosina@suse.cz>, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, live-patching@vger.kernel.org |
| X-Original-Date | Thu, 28 Jan 2016 14:39:38 +1100 |
| X-Original-Message-ID | <1453952378.4108.3.camel@ellerman.id.au> |
| X-Original-References | <20160125170459.14DB7692CE@newverein.lst.de> <20160125170723.D2CCE692CE@newverein.lst.de> <1453889967.10839.2.camel@ellerman.id.au> <20160127125809.GN17028@bubble.grove.modra.org> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1320272 |
Show key headers only | View raw
On Wed, 2016-01-27 at 23:28 +1030, Alan Modra wrote: > On Wed, Jan 27, 2016 at 09:19:27PM +1100, Michael Ellerman wrote: > > Hi Torsten, > > > > On Mon, 2016-01-25 at 16:26 +0100, Torsten Duwe wrote: > > > The gcc switch -mprofile-kernel, available for ppc64 on gcc > 4.8.5, > > > allows to call _mcount very early in the function, which low-level > > > ASM code and code patching functions need to consider. > > > Especially the link register and the parameter registers are still > > > alive and not yet saved into a new stack frame. > > > > > > Signed-off-by: Torsten Duwe <duwe@suse.de> > > > --- > > > arch/powerpc/kernel/entry_64.S | 45 +++++++++++++++++++++++++++++++++++++++-- > > > arch/powerpc/kernel/ftrace.c | 12 +++++++++-- > > > arch/powerpc/kernel/module_64.c | 14 +++++++++++++ > > > 3 files changed, 67 insertions(+), 4 deletions(-) > > > > > > diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S > > > index a94f155..e7cd043 100644 > > > --- a/arch/powerpc/kernel/entry_64.S > > > +++ b/arch/powerpc/kernel/entry_64.S > > > @@ -1206,7 +1206,12 @@ _GLOBAL(enter_prom) > > > #ifdef CONFIG_DYNAMIC_FTRACE > > > _GLOBAL(mcount) > > > _GLOBAL(_mcount) > > > - blr > > > + std r0,LRSAVE(r1) /* gcc6 does this _after_ this call _only_ */ > > > + mflr r0 > > > + mtctr r0 > > > + ld r0,LRSAVE(r1) > > > + mtlr r0 > > > + bctr > > > > Can we use r11 instead? eg: > > > > _GLOBAL(_mcount) > > mflr r11 > > mtctr r11 > > mtlr r0 > > bctr > > Depends on what you need to support. As Torsten says, the code to > call _mcount when -mprofile-kernel is emitted before the prologue of a > function (similar to -m32), but after the ELFv2 global entry point > code. If you trash r11 here you're killing the static chain pointer, > used by C nested functions or other languages that use a static chain, > eg. Pascal. r11 has *not* been saved for ELFv2. OK, thanks for clarfiying. Pascal is not a big concern :D. But although I don't think we use nested functions anywhere, someone somewhere could be, or at least might one day. > r12 might be a better choice for a temp reg. Even better. cheers
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v6 1/9] ppc64 (le): prepare for -mprofile-kernel Torsten Duwe <duwe@lst.de> - 2016-01-25 18:10 +0100
Re: [PATCH v6 1/9] ppc64 (le): prepare for -mprofile-kernel Michael Ellerman <mpe@ellerman.id.au> - 2016-01-27 11:20 +0100
Re: [PATCH v6 1/9] ppc64 (le): prepare for -mprofile-kernel Torsten Duwe <duwe@lst.de> - 2016-01-27 11:50 +0100
Re: [PATCH v6 1/9] ppc64 (le): prepare for -mprofile-kernel Michael Ellerman <mpe@ellerman.id.au> - 2016-01-28 05:30 +0100
Re: [PATCH v6 1/9] ppc64 (le): prepare for -mprofile-kernel Torsten Duwe <duwe@lst.de> - 2016-01-28 13:00 +0100
Re: [PATCH v6 1/9] ppc64 (le): prepare for -mprofile-kernel Alan Modra <amodra@gmail.com> - 2016-01-27 14:00 +0100
Re: [PATCH v6 1/9] ppc64 (le): prepare for -mprofile-kernel Torsten Duwe <duwe@lst.de> - 2016-01-27 14:50 +0100
Re: [PATCH v6 1/9] ppc64 (le): prepare for -mprofile-kernel Michael Ellerman <mpe@ellerman.id.au> - 2016-01-28 04:40 +0100
Re: [PATCH v6 1/9] ppc64 (le): prepare for -mprofile-kernel AKASHI Takahiro <takahiro.akashi@linaro.org> - 2016-02-03 08:30 +0100
Re: [PATCH v6 1/9] ppc64 (le): prepare for -mprofile-kernel Jiri Kosina <jikos@kernel.org> - 2016-02-03 10:00 +0100
Re: [PATCH v6 1/9] ppc64 (le): prepare for -mprofile-kernel Torsten Duwe <duwe@lst.de> - 2016-02-03 12:30 +0100
Re: [PATCH v6 1/9] ppc64 (le): prepare for -mprofile-kernel AKASHI Takahiro <takahiro.akashi@linaro.org> - 2016-02-04 10:40 +0100
Re: [PATCH v6 1/9] ppc64 (le): prepare for -mprofile-kernel Petr Mladek <pmladek@suse.com> - 2016-02-04 12:10 +0100
Re: [PATCH v6 1/9] ppc64 (le): prepare for -mprofile-kernel Balbir Singh <bsingharora@gmail.com> - 2016-02-05 05:50 +0100
Re: [PATCH v6 1/9] ppc64 (le): prepare for -mprofile-kernel Petr Mladek <pmladek@suse.com> - 2016-02-05 11:30 +0100
Re: [PATCH v6 1/9] ppc64 (le): prepare for -mprofile-kernel Jiri Kosina <jikos@kernel.org> - 2016-02-04 22:50 +0100
csiph-web