Re: [PATCH 2/5] x86/uprobes: implement x86 specific arch_uprobe_*_step

2012-08-08 Thread Ananth N Mavinakayanahalli
On Wed, Aug 08, 2012 at 04:53:45PM +0200, Oleg Nesterov wrote: > On 08/08, Sebastian Andrzej Siewior wrote: ... > >> ->insn[0] doesn't look right, we should skip the prefixes. insn_init() insn_get_opcode() if (OPCODE1() == 0x9d) is always the right way of doing it. ... > And in any case it wo

Re: [PATCH 2/5] x86/uprobes: implement x86 specific arch_uprobe_*_step

2012-08-08 Thread Sebastian Andrzej Siewior
On 08/08/2012 04:53 PM, Oleg Nesterov wrote: Why? I tried 'lock popf' and I got invalid instruction. The same for 'rep popf'. int main(void) { asm volatile ("pushf; rep; popf"); return 0; } Just tested and it works. Hmm. OK, probably

Re: [PATCH 2/5] x86/uprobes: implement x86 specific arch_uprobe_*_step

2012-08-08 Thread Oleg Nesterov
On 08/08, Sebastian Andrzej Siewior wrote: > > On 08/08/2012 02:57 PM, Oleg Nesterov wrote: >>> +static int insn_changes_flags(struct arch_uprobe *auprobe) >>> +{ >>> + /* popf reads flags from stack */ >>> + if (auprobe->insn[0] == 0x9d) >>> + return 1; >> >> Ah, somehow I didn't thi

Re: [PATCH 2/5] x86/uprobes: implement x86 specific arch_uprobe_*_step

2012-08-08 Thread Sebastian Andrzej Siewior
On 08/08/2012 02:57 PM, Oleg Nesterov wrote: +static int insn_changes_flags(struct arch_uprobe *auprobe) +{ + /* popf reads flags from stack */ + if (auprobe->insn[0] == 0x9d) + return 1; Ah, somehow I didn't think about this before. ->insn[0] doesn't look right, we s

Re: [PATCH 2/5] x86/uprobes: implement x86 specific arch_uprobe_*_step

2012-08-08 Thread Oleg Nesterov
On 08/07, Sebastian Andrzej Siewior wrote: > > The arch specific implementation behaves like user_enable_single_step() > except that it does not disable single stepping if it was already > enabled. This allows the debugger to single step over an uprobe. > The state of block stepping is not restored