Subject: Re: [FTRACE] Enabling function_graph causes OOPS

From: Benjamin Herrenschmidt <[email-masked]>
Date: Wed, 07 Oct 2009 20:10:21 +1100

On Wed, 2009-10-07 at 14:26 +0530, Sachin Sant wrote:

> As Ben suggested, i changed LOAD_REG_IMMEDIATE() to LOAD_REG_ADDR()
> as follows.
> 
> -       LOAD_REG_IMMEDIATE(r4,ftrace_return_to_handler)
> +       LOAD_REG_ADDR(r4,ftrace_return_to_handler)
> 
> With this change compile time warnings about bad relocations
> related to ftrace are gone.

You also need to make sure r2 is properly loaded with the kernel TOC
pointer, something like ld r2,PACAKTOC(r13) before the LOAD_REG_ADDR.

Cheers,
Ben.