lkml.org 
[lkml]   [2014]   [Apr]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH v2 4/6] uprobes/x86: Emulate rip-relative call's
(2014/04/10 21:53), Denys Vlasenko wrote:
> On 04/09/2014 09:44 PM, Oleg Nesterov wrote:
>> +static void ttt_clear_displacement(struct arch_uprobe *auprobe, struct insn *insn)
>
> Branch instruction's offset isn't called "displacement"
> on x86.
>
> How about ttt_clear_branch_offset?

I like his idea. "displacement" on x86 is so confused especially
with using x86 insn decoder.

Thank you,

>
>> +{
>> + /*
>> + * Turn this insn into "call 1f; 1:", this is what we will execute
>> + * out-of-line if ->emulate() fails.
>> + *
>> + * In the likely case this will lead to arch_uprobe_abort_xol(), but
>> + * see the comment in ->emulate(). So we need to ensure that the new
>> + * ->ip can't fall into non-canonical area and trigger #GP.
>> + *
>> + * We could turn it into (say) "pushf", but then we would need to
>> + * divorce ->insn[] and ->ixol[]. We need to preserve the 1st byte
>> + * of ->insn[] for set_orig_insn().
>> + */
>> + memset(auprobe->insn + insn_offset_immediate(insn),
>> + 0, insn->immediate.nbytes);
>> +}
>
>


--
Masami HIRAMATSU
Software Platform Research Dept. Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@hitachi.com




\
 
 \ /
  Last update: 2014-04-10 20:21    [W:0.063 / U:0.376 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site