* [PATCH] powerpc: ftrace: bugfix for test_24bit_addr
@ 2014-02-26 2:23 Liu Ping Fan
2014-02-26 4:35 ` Ananth N Mavinakayanahalli
0 siblings, 1 reply; 5+ messages in thread
From: Liu Ping Fan @ 2014-02-26 2:23 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Paul Mackerras
The branch target should be the func addr, not the addr of func_descr_t.
So using ppc_function_entry() to generate the right target addr.
Signed-off-by: Liu Ping Fan <pingfank@linux.vnet.ibm.com>
---
This bug will make ftrace fail to work. It can be triggered when the kernel
size grows up.
---
arch/powerpc/kernel/ftrace.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/powerpc/kernel/ftrace.c b/arch/powerpc/kernel/ftrace.c
index 9b27b29..b0ded97 100644
--- a/arch/powerpc/kernel/ftrace.c
+++ b/arch/powerpc/kernel/ftrace.c
@@ -74,6 +74,7 @@ ftrace_modify_code(unsigned long ip, unsigned int old, unsigned int new)
*/
static int test_24bit_addr(unsigned long ip, unsigned long addr)
{
+ addr = ppc_function_entry((void *)addr);
/* use the create_branch to verify that this offset can be branched */
return create_branch((unsigned int *)ip, addr, 0);
--
1.8.1.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] powerpc: ftrace: bugfix for test_24bit_addr
2014-02-26 2:23 [PATCH] powerpc: ftrace: bugfix for test_24bit_addr Liu Ping Fan
@ 2014-02-26 4:35 ` Ananth N Mavinakayanahalli
2014-02-26 6:06 ` Liu ping fan
2014-02-26 12:22 ` Michael Ellerman
0 siblings, 2 replies; 5+ messages in thread
From: Ananth N Mavinakayanahalli @ 2014-02-26 4:35 UTC (permalink / raw)
To: Liu Ping Fan; +Cc: Paul Mackerras, linuxppc-dev, Anton Blanchard
On Wed, Feb 26, 2014 at 10:23:01AM +0800, Liu Ping Fan wrote:
> The branch target should be the func addr, not the addr of func_descr_t.
> So using ppc_function_entry() to generate the right target addr.
>
> Signed-off-by: Liu Ping Fan <pingfank@linux.vnet.ibm.com>
> ---
> This bug will make ftrace fail to work. It can be triggered when the kernel
> size grows up.
> ---
> arch/powerpc/kernel/ftrace.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/arch/powerpc/kernel/ftrace.c b/arch/powerpc/kernel/ftrace.c
> index 9b27b29..b0ded97 100644
> --- a/arch/powerpc/kernel/ftrace.c
> +++ b/arch/powerpc/kernel/ftrace.c
> @@ -74,6 +74,7 @@ ftrace_modify_code(unsigned long ip, unsigned int old, unsigned int new)
> */
> static int test_24bit_addr(unsigned long ip, unsigned long addr)
> {
> + addr = ppc_function_entry((void *)addr);
Won't this break on LE?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] powerpc: ftrace: bugfix for test_24bit_addr
2014-02-26 4:35 ` Ananth N Mavinakayanahalli
@ 2014-02-26 6:06 ` Liu ping fan
2014-02-26 12:22 ` Michael Ellerman
1 sibling, 0 replies; 5+ messages in thread
From: Liu ping fan @ 2014-02-26 6:06 UTC (permalink / raw)
To: ananth; +Cc: Paul Mackerras, linuxppc-dev, Anton Blanchard
On Wed, Feb 26, 2014 at 12:35 PM, Ananth N Mavinakayanahalli
<ananth@in.ibm.com> wrote:
> On Wed, Feb 26, 2014 at 10:23:01AM +0800, Liu Ping Fan wrote:
>> The branch target should be the func addr, not the addr of func_descr_t.
>> So using ppc_function_entry() to generate the right target addr.
>>
>> Signed-off-by: Liu Ping Fan <pingfank@linux.vnet.ibm.com>
>> ---
>> This bug will make ftrace fail to work. It can be triggered when the kernel
>> size grows up.
>> ---
>> arch/powerpc/kernel/ftrace.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/arch/powerpc/kernel/ftrace.c b/arch/powerpc/kernel/ftrace.c
>> index 9b27b29..b0ded97 100644
>> --- a/arch/powerpc/kernel/ftrace.c
>> +++ b/arch/powerpc/kernel/ftrace.c
>> @@ -74,6 +74,7 @@ ftrace_modify_code(unsigned long ip, unsigned int old, unsigned int new)
>> */
>> static int test_24bit_addr(unsigned long ip, unsigned long addr)
>> {
>> + addr = ppc_function_entry((void *)addr);
>
> Won't this break on LE?
>
How? I can not figure out it. Anyway, ppc_function_entry() is already
used in other places with LE.
Thx,
Fan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] powerpc: ftrace: bugfix for test_24bit_addr
2014-02-26 4:35 ` Ananth N Mavinakayanahalli
2014-02-26 6:06 ` Liu ping fan
@ 2014-02-26 12:22 ` Michael Ellerman
2014-02-26 23:19 ` Tony Breeds
1 sibling, 1 reply; 5+ messages in thread
From: Michael Ellerman @ 2014-02-26 12:22 UTC (permalink / raw)
To: ananth; +Cc: linuxppc-dev, Paul Mackerras, Anton Blanchard, Liu Ping Fan
On Wed, 2014-02-26 at 10:05 +0530, Ananth N Mavinakayanahalli wrote:
> On Wed, Feb 26, 2014 at 10:23:01AM +0800, Liu Ping Fan wrote:
> > The branch target should be the func addr, not the addr of func_descr_t.
> > So using ppc_function_entry() to generate the right target addr.
> >
> > Signed-off-by: Liu Ping Fan <pingfank@linux.vnet.ibm.com>
> > ---
> > This bug will make ftrace fail to work. It can be triggered when the kernel
> > size grows up.
> > ---
> > arch/powerpc/kernel/ftrace.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/arch/powerpc/kernel/ftrace.c b/arch/powerpc/kernel/ftrace.c
> > index 9b27b29..b0ded97 100644
> > --- a/arch/powerpc/kernel/ftrace.c
> > +++ b/arch/powerpc/kernel/ftrace.c
> > @@ -74,6 +74,7 @@ ftrace_modify_code(unsigned long ip, unsigned int old, unsigned int new)
> > */
> > static int test_24bit_addr(unsigned long ip, unsigned long addr)
> > {
> > + addr = ppc_function_entry((void *)addr);
>
> Won't this break on LE?
ppc_function_entry() just needs to be a nop on LE, as it already is on 32-bit.
cheers
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] powerpc: ftrace: bugfix for test_24bit_addr
2014-02-26 12:22 ` Michael Ellerman
@ 2014-02-26 23:19 ` Tony Breeds
0 siblings, 0 replies; 5+ messages in thread
From: Tony Breeds @ 2014-02-26 23:19 UTC (permalink / raw)
To: Michael Ellerman
Cc: Paul Mackerras, linuxppc-dev, Liu Ping Fan, Anton Blanchard
[-- Attachment #1: Type: text/plain, Size: 195 bytes --]
On Wed, Feb 26, 2014 at 11:22:16PM +1100, Michael Ellerman wrote:
> ppc_function_entry() just needs to be a nop on LE, as it already is on 32-bit.
Well on LE ABI2, but yes.
Yours Tony
[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-02-26 23:19 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-26 2:23 [PATCH] powerpc: ftrace: bugfix for test_24bit_addr Liu Ping Fan
2014-02-26 4:35 ` Ananth N Mavinakayanahalli
2014-02-26 6:06 ` Liu ping fan
2014-02-26 12:22 ` Michael Ellerman
2014-02-26 23:19 ` Tony Breeds
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).