lkml.org 
[lkml]   [2015]   [May]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 07/10] uprobes/x86: Introduce arch_uretprobe_is_alive()
> 
> diff --git a/arch/x86/include/asm/uprobes.h b/arch/x86/include/asm/uprobes.h
> index f011fd0..60777f3 100644
> --- a/arch/x86/include/asm/uprobes.h
> +++ b/arch/x86/include/asm/uprobes.h
> @@ -57,6 +57,7 @@ struct arch_uprobe {
> };
>
> struct arch_uretprobe {
> + unsigned long sp;

While this looks good, I was wondering if you did think of having the sp
in the return_instance structure itself. I mean can we use
user_stack_pointer() to populate the ri->sp?
In which case the weak function itself should suffice for most archs.

Something like this.
prepare_uretprobe() we can have
ri->sp = user_stack_pointer(regs)

and handle_trampoline() would call something like

arch_uretprobe_is_alive(next->sp, regs);

bool __weak arch_uretprobe_is_alive(unsigned long sp, struct pt_regs *regs)
{
return user_stack_pointer(regs) <= sp;
}

Am I missing something?

>
--
Thanks and Regards
Srikar Dronamraju



\
 
 \ /
  Last update: 2015-05-07 13:21    [W:0.168 / U:0.936 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site