Re: [PATCH] Bring sparc64 dynamic ftrace up to snuff...
From: Ingo Molnar
Date: Sat Jun 13 2009 - 18:06:42 EST
* David Miller <davem@xxxxxxxxxxxxx> wrote:
> int ftrace_update_ftrace_func(ftrace_func_t func)
> {
> unsigned long ip = (unsigned long)(&ftrace_call);
> - unsigned char old[MCOUNT_INSN_SIZE], *new;
> + u32 old, new;
>
> - memcpy(old, &ftrace_call, MCOUNT_INSN_SIZE);
> + old = *(u32 *) &ftrace_call;
btw., just one (really stupid) question here: can ftrace_call be
misaligned, and is misalignment a problem on Sparc? If it's not a
problem then disregard the rest of the mail.
I dont see a particular alignment done in mcount.S:
ftrace_caller:
mov %i7, %o1
mov %o7, %o0
.globl ftrace_call
ftrace_call:
call ftrace_stub
so replacing an memcpy (which can copy misaligned buffers) with a
direct assignment (which cannot) - wont that cause misalignment on
Sparc?
Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/