LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: Rakib Mullick <rakib.mullick@gmail.com>,
	linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH -mm] ftrace : Fix section mismatch warning.
Date: Fri, 24 Oct 2008 08:22:05 -0400 (EDT)	[thread overview]
Message-ID: <alpine.DEB.1.10.0810240821080.25677@gandalf.stny.rr.com> (raw)
In-Reply-To: <alpine.DEB.1.10.0810240802070.25677@gandalf.stny.rr.com>


On Fri, 24 Oct 2008, Steven Rostedt wrote:
> 
> The real solution should probably be this:
> 
> (Compiled tested only)
> 
> Signed-off-by: Steven Rostedt <srostedt@redhat.com>
> ---
>  arch/x86/kernel/ftrace.c |   11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)
> 
> Index: linux-tip.git/arch/x86/kernel/ftrace.c
> ===================================================================
> --- linux-tip.git.orig/arch/x86/kernel/ftrace.c	2008-10-23 19:23:28.000000000 -0400
> +++ linux-tip.git/arch/x86/kernel/ftrace.c	2008-10-24 08:11:57.000000000 -0400
> @@ -22,7 +22,7 @@
>  
>  
>  /* Long is fine, even if it is only 4 bytes ;-) */
> -static unsigned long *ftrace_nop;
> +static unsigned long ftrace_nop[MCOUNT_INSN_SIZE];

I need to convert that to unsigned char ftrace_nop[]. I'll run some more 
tests, and produce a real patch later.

-- Steve

>  
>  union ftrace_code_union {
>  	char code[MCOUNT_INSN_SIZE];
> @@ -126,8 +126,7 @@ int __init ftrace_dyn_arch_init(void *da
>  	 */
>  	asm volatile (
>  		"jmp ftrace_test_jmp\n"
> -		/* This code needs to stay around */
> -		".section .text, \"ax\"\n"
> +		".section .text.init, \"ax\"\n"
>  		"ftrace_test_jmp:"
>  		"jmp ftrace_test_p6nop\n"
>  		"nop\n"
> @@ -154,15 +153,15 @@ int __init ftrace_dyn_arch_init(void *da
>  	switch (faulted) {
>  	case 0:
>  		pr_info("ftrace: converting mcount calls to 0f 1f 44 00 00\n");
> -		ftrace_nop = (unsigned long *)ftrace_test_p6nop;
> +		memcpy(ftrace_nop, ftrace_test_p6nop, MCOUNT_INSN_SIZE);
>  		break;
>  	case 1:
>  		pr_info("ftrace: converting mcount calls to 66 66 66 66 90\n");
> -		ftrace_nop = (unsigned long *)ftrace_test_nop5;
> +		memcpy(ftrace_nop, ftrace_test_nop5, MCOUNT_INSN_SIZE);
>  		break;
>  	case 2:
>  		pr_info("ftrace: converting mcount calls to jmp . + 5\n");
> -		ftrace_nop = (unsigned long *)ftrace_test_jmp;
> +		memcpy(ftrace_nop, ftrace_test_jmp, MCOUNT_INSN_SIZE);
>  		break;
>  	}
>  
> 

  reply	other threads:[~2008-10-24 12:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-13  5:50 Rakib Mullick
2008-10-20 16:27 ` Ingo Molnar
2008-10-22  7:03   ` Ingo Molnar
2008-10-24 11:09     ` Rakib Mullick
2008-10-24 11:50       ` Ingo Molnar
2008-10-24 12:19         ` Steven Rostedt
2008-10-24 12:22           ` Steven Rostedt [this message]
2008-10-24 13:12         ` [PATCH] ftrace: use a real variable for ftrace_nop in x86 Steven Rostedt
2008-10-24 13:17           ` Steven Rostedt
2008-10-27 15:52             ` Ingo Molnar

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=alpine.DEB.1.10.0810240821080.25677@gandalf.stny.rr.com \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rakib.mullick@gmail.com \
    --subject='Re: [PATCH -mm] ftrace : Fix section mismatch warning.' \
    /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

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).