lkml.org 
[lkml]   [2007]   [Dec]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: FInal kprobes rollup patches
From
Date
On Mon, 2007-12-17 at 19:52 +0530, Srikar Dronamraju wrote:
> * Ingo Molnar <mingo@elte.hu> [2007-12-15 14:12:04]:
>
>
> Hi Ingo, Harvey
>
> In file include/asm-x86/kprobes_32.h
> typedef u8 kprobe_opcode_t;
> hence sizeof(kprobe_opcode_t) turns out to be 1.
>
> Hence
>
> memcpy(p->ainsn.insn, p->addr, MAX_INSN_SIZE * sizeof(kprobe_opcode_t));
> is correct.
>

OK, but this would be much clearer to adopt the X86_64 way, define
MAX_INSN_SIZE one smaller and make this line:

/* Copy original instruction plus space for 1 byte relative jump */
memcpy(p->ainsn.insn, p->addr, MAX_INSN_SIZE + sizeof(kprobe_opcode_t));

See the first patch of my cleanup work that unified MAX_INSN_SIZE
and you'll see why this jumped out.

Harvey



\
 
 \ /
  Last update: 2007-12-17 20:23    [W:0.134 / U:0.748 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site