From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752312AbbLNQab (ORCPT ); Mon, 14 Dec 2015 11:30:31 -0500 Received: from smtprelay0235.hostedemail.com ([216.40.44.235]:49369 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751937AbbLNQaa convert rfc822-to-8bit (ORCPT ); Mon, 14 Dec 2015 11:30:30 -0500 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 50,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::,RULES_HIT:41:152:355:379:421:541:599:800:901:960:966:967:973:988:989:1260:1263:1277:1311:1313:1314:1345:1359:1437:1513:1515:1516:1518:1521:1535:1544:1593:1594:1605:1711:1730:1747:1777:1792:2194:2196:2199:2200:2393:2525:2553:2560:2563:2682:2685:2693:2827:2859:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3167:3622:3657:3865:3866:3867:3868:3870:3871:3872:3873:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4321:4385:5007:6119:6261:7576:7875:7903:8603:8660:9025:9040:9108:9388:10004:10848:10967:11026:11232:11473:11658:11783:11914:12043:12296:12438:12517:12519:12555:12740:13053:13148:13149:13230:14096:14097:14659:21080:21212:30012:30054:30070:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:5,LUA_SUMMARY:none X-HE-Tag: wall32_5b69c58056411 X-Filterd-Recvd-Size: 5748 Date: Mon, 14 Dec 2015 11:30:27 -0500 From: Steven Rostedt To: Borislav Petkov Cc: LKML Subject: Re: [PATCH] ftrace: Kill ftrace_caller_end label Message-ID: <20151214113027.03d3587c@gandalf.local.home> In-Reply-To: <1450109314-20323-1-git-send-email-bp@alien8.de> References: <1450109314-20323-1-git-send-email-bp@alien8.de> X-Mailer: Claws Mail 3.13.0 (GTK+ 2.24.28; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 14 Dec 2015 17:08:34 +0100 Borislav Petkov wrote: > From: Borislav Petkov > > One of ftrace_caller_and and ftrace_return is redundant so unify them. s/_and/_end/ > Rename ftrace_return to ftrace_epilogue to mean that everything after > that label represents, like an afterword, work which happens *after* the > ftrace call, e.g., the function graph tracer for one. > > Beef up the comment about the code contents and layout before > ftrace_epilogue label. According to http://www.thefreedictionary.com/epilog ep·i·logue also ep·i·log (ĕp′ə-lôg′, -lŏg′) (n). 1. a. A short poem or speech spoken directly to the audience following the conclusion of a play. Hmm, that doesn't fit. b. The performer who delivers such a short poem or speech. Maybe people can think ftrace as a poem. But people will never think that I give such a short speech. 2. A short addition or concluding section at the end of a literary work, often dealing with the future of its characters. Also called afterword. Ah, "afterword" also doesn't fit, unless you mean "characters" as a set of "char []". Which I guess the trampoline would fit. 3. An event which reflects meaningfully on a recently ended conflict or struggle. Ah! This looks like the best match! Thus, this should be stated in the changelog! > > Signed-off-by: Borislav Petkov > Cc: Steven Rostedt Reviewed-by: Steven Rostedt -- Steve > --- > arch/x86/kernel/ftrace.c | 11 +++++------ > arch/x86/kernel/mcount_64.S | 14 ++++++++------ > 2 files changed, 13 insertions(+), 12 deletions(-) > > diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c > index 311bcf338f07..26ad092ac0dc 100644 > --- a/arch/x86/kernel/ftrace.c > +++ b/arch/x86/kernel/ftrace.c > @@ -690,9 +690,8 @@ static inline void tramp_free(void *tramp) { } > #endif > > /* Defined as markers to the end of the ftrace default trampolines */ > -extern void ftrace_caller_end(void); > extern void ftrace_regs_caller_end(void); > -extern void ftrace_return(void); > +extern void ftrace_epilogue(void); > extern void ftrace_caller_op_ptr(void); > extern void ftrace_regs_caller_op_ptr(void); > > @@ -739,7 +738,7 @@ create_trampoline(struct ftrace_ops *ops, unsigned int *tramp_size) > op_offset = (unsigned long)ftrace_regs_caller_op_ptr; > } else { > start_offset = (unsigned long)ftrace_caller; > - end_offset = (unsigned long)ftrace_caller_end; > + end_offset = (unsigned long)ftrace_epilogue; > op_offset = (unsigned long)ftrace_caller_op_ptr; > } > > @@ -747,7 +746,7 @@ create_trampoline(struct ftrace_ops *ops, unsigned int *tramp_size) > > /* > * Allocate enough size to store the ftrace_caller code, > - * the jmp to ftrace_return, as well as the address of > + * the jmp to ftrace_epilogue, as well as the address of > * the ftrace_ops this trampoline is used for. > */ > trampoline = alloc_tramp(size + MCOUNT_INSN_SIZE + sizeof(void *)); > @@ -765,8 +764,8 @@ create_trampoline(struct ftrace_ops *ops, unsigned int *tramp_size) > > ip = (unsigned long)trampoline + size; > > - /* The trampoline ends with a jmp to ftrace_return */ > - jmp = ftrace_jmp_replace(ip, (unsigned long)ftrace_return); > + /* The trampoline ends with a jmp to ftrace_epilogue */ > + jmp = ftrace_jmp_replace(ip, (unsigned long)ftrace_epilogue); > memcpy(trampoline + size, jmp, MCOUNT_INSN_SIZE); > > /* > diff --git a/arch/x86/kernel/mcount_64.S b/arch/x86/kernel/mcount_64.S > index 87e1762e2bca..ed48a9f465f8 100644 > --- a/arch/x86/kernel/mcount_64.S > +++ b/arch/x86/kernel/mcount_64.S > @@ -168,12 +168,14 @@ GLOBAL(ftrace_call) > restore_mcount_regs > > /* > - * The copied trampoline must call ftrace_return as it > + * The copied trampoline must call ftrace_epilogue as it > * still may need to call the function graph tracer. > + * > + * The code up to this label is copied into trampolines so > + * think twice before adding any new code or changing the > + * layout here. > */ > -GLOBAL(ftrace_caller_end) > - > -GLOBAL(ftrace_return) > +GLOBAL(ftrace_epilogue) > > #ifdef CONFIG_FUNCTION_GRAPH_TRACER > GLOBAL(ftrace_graph_call) > @@ -244,14 +246,14 @@ GLOBAL(ftrace_regs_call) > popfq > > /* > - * As this jmp to ftrace_return can be a short jump > + * As this jmp to ftrace_epilogue can be a short jump > * it must not be copied into the trampoline. > * The trampoline will add the code to jump > * to the return. > */ > GLOBAL(ftrace_regs_caller_end) > > - jmp ftrace_return > + jmp ftrace_epilogue > > END(ftrace_regs_caller) >