Re: [PATCH][v2] uprobes/x86: emulate push insns for uprobe on x86

2017-11-14 Thread Yonghong Song
On 11/14/17 7:34 AM, Oleg Nesterov wrote: On 11/13, Yonghong Song wrote: On 11/13/17 4:59 AM, Oleg Nesterov wrote: + switch (opc1) { + case 0x50: + reg_offset = offsetof(struct pt_regs, r8); + break; +

Re: [PATCH][v2] uprobes/x86: emulate push insns for uprobe on x86

2017-11-14 Thread Oleg Nesterov
On 11/13, Yonghong Song wrote: > > On 11/13/17 4:59 AM, Oleg Nesterov wrote: > >>+ switch (opc1) { > >>+ case 0x50: > >>+ reg_offset = offsetof(struct pt_regs, r8); > >>+ break; > >>+ case 0x51: > >>+ reg_offset =

Re: [PATCH][v2] uprobes/x86: emulate push insns for uprobe on x86

2017-11-13 Thread Yonghong Song
On 11/13/17 4:59 AM, Oleg Nesterov wrote: The patch looks good to me, but I have a question because I know nothing about insn encoding, On 11/10, Yonghong Song wrote: +static int push_setup_xol_ops(struct arch_uprobe *auprobe, struct insn *insn) +{ + u8 opc1 = OPCODE1(insn),

Re: [PATCH][v2] uprobes/x86: emulate push insns for uprobe on x86

2017-11-13 Thread Oleg Nesterov
The patch looks good to me, but I have a question because I know nothing about insn encoding, On 11/10, Yonghong Song wrote: > > +static int push_setup_xol_ops(struct arch_uprobe *auprobe, struct insn *insn) > +{ > + u8 opc1 = OPCODE1(insn), reg_offset = 0; > + > + if (opc1 < 0x50 || opc1

[PATCH][v2] uprobes/x86: emulate push insns for uprobe on x86

2017-11-10 Thread Yonghong Song
Uprobe is a tracing mechanism for userspace programs. Typical uprobe will incur overhead of two traps. First trap is caused by replaced trap insn, and the second trap is to execute the original displaced insn in user space. To reduce the overhead, kernel provides hooks for architectures to