--- zzzz-none-000/linux-2.6.19.2/arch/i386/kernel/kprobes.c 2007-01-10 19:10:37.000000000 +0000 +++ davinci-8020-5505/linux-2.6.19.2/arch/i386/kernel/kprobes.c 2007-01-19 14:42:56.000000000 +0000 @@ -361,11 +361,8 @@ asm volatile ( ".global kretprobe_trampoline\n" "kretprobe_trampoline: \n" " pushf\n" - /* skip cs, eip, orig_eax */ - " subl $12, %esp\n" - " pushl %gs\n" - " pushl %ds\n" - " pushl %es\n" + /* skip cs, eip, orig_eax, es, ds */ + " subl $20, %esp\n" " pushl %eax\n" " pushl %ebp\n" " pushl %edi\n" @@ -376,10 +373,10 @@ " movl %esp, %eax\n" " call trampoline_handler\n" /* move eflags to cs */ - " movl 52(%esp), %edx\n" - " movl %edx, 48(%esp)\n" + " movl 48(%esp), %edx\n" + " movl %edx, 44(%esp)\n" /* save true return address on eflags */ - " movl %eax, 52(%esp)\n" + " movl %eax, 48(%esp)\n" " popl %ebx\n" " popl %ecx\n" " popl %edx\n" @@ -387,8 +384,8 @@ " popl %edi\n" " popl %ebp\n" " popl %eax\n" - /* skip eip, orig_eax, es, ds, gs */ - " addl $20, %esp\n" + /* skip eip, orig_eax, es, ds */ + " addl $16, %esp\n" " popf\n" " ret\n"); } @@ -407,10 +404,6 @@ INIT_HLIST_HEAD(&empty_rp); spin_lock_irqsave(&kretprobe_lock, flags); head = kretprobe_inst_table_head(current); - /* fixup registers */ - regs->xcs = __KERNEL_CS; - regs->eip = trampoline_address; - regs->orig_eax = 0xffffffff; /* * It is possible to have multiple instances associated with a given @@ -432,7 +425,6 @@ if (ri->rp && ri->rp->handler){ __get_cpu_var(current_kprobe) = &ri->rp->kp; - get_kprobe_ctlblk()->kprobe_status = KPROBE_HIT_ACTIVE; ri->rp->handler(ri, regs); __get_cpu_var(current_kprobe) = NULL; } @@ -661,7 +653,7 @@ struct die_args *args = (struct die_args *)data; int ret = NOTIFY_DONE; - if (args->regs && user_mode_vm(args->regs)) + if (args->regs && user_mode(args->regs)) return ret; switch (val) {