1. 29 8月, 2012 9 次提交
  2. 30 7月, 2012 12 次提交
  3. 16 6月, 2012 15 次提交
  4. 08 6月, 2012 1 次提交
  5. 06 6月, 2012 3 次提交
    • O
      uprobes: Kill uprobes_srcu/uprobe_srcu_id · 778b032d
      Oleg Nesterov 提交于
      Kill the no longer needed uprobes_srcu/uprobe_srcu_id code.
      
      It doesn't really work anyway. synchronize_srcu() can only
      synchronize with the code "inside" the
      srcu_read_lock/srcu_read_unlock section, while
      uprobe_pre_sstep_notifier() does srcu_read_lock() _after_ we
      already hit the breakpoint.
      
      I guess this probably works "in practice". synchronize_srcu() is
      slow and it implies synchronize_sched(), and the probed task
      enters the non- preemptible section at the start of exception
      handler. Still this is not right at least in theory, and
      task->uprobe_srcu_id blows task_struct.
      Signed-off-by: NOleg Nesterov <oleg@redhat.com>
      Acked-by: NSrikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Anton Arapov <anton@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20120529193008.GG8057@redhat.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      778b032d
    • O
      uprobes: Teach handle_swbp() to rely on "is_swbp" rather than uprobes_srcu · 56bb4cf6
      Oleg Nesterov 提交于
      Currently handle_swbp() assumes that it can't race with
      unregister, so it roughly does:
      
      	if (find_uprobe(vaddr))
      		process_uprobe();
      	else
      		send_sig(SIGTRAP);
      
      This relies on the not-really-working uprobes_srcu code we are
      going to remove, see the next patch.
      
      With this patch we rely on the result of
      is_swbp_at_addr(bp_vaddr) if find_uprobe() fails.
      
      If is_swbp == 1, then we hit the normal int3, we should send
      SIGTRAP.
      
      If is_swbp == 0, we raced with uprobe_unregister(), we simply
      restart this insn again.
      
      The "difficult" case is is_swbp == -EFAULT, when we can't read
      this memory. In this case I think we should restart too, and
      this is more correct compared to the current code which sends
      SIGTRAP.
      
      Ignoring ENOMEM/etc from get_user_pages(), this can only happen
      if another thread unmaps this memory before find_active_uprobe()
      takes mmap_sem. It would be better to pretend it was unmapped
      before this insn was executed, restart, and get SIGSEGV.
      Signed-off-by: NOleg Nesterov <oleg@redhat.com>
      Acked-by: NSrikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Anton Arapov <anton@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20120529192947.GF8057@redhat.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      56bb4cf6
    • O
      uprobes: Change register_for_each_vma() to take mm->mmap_sem for writing · 77fc4af1
      Oleg Nesterov 提交于
      Change register_for_each_vma() to take mm->mmap_sem for writing.
      This is a bit unfortunate but hopefully not too bad, this is the
      slow path anyway.
      
      This is needed to ensure that find_active_uprobe() can not race
      with uprobe_register() which adds the new bp at the same
      bp_vaddr, after find_uprobe() fails and before
      is_swbp_at_addr_fast() checks the memory.
      
      IOW, this is needed to ensure that if find_active_uprobe()
      returns NULL but is_swbp == true, we can safely assume that it
      was the "normal" int3 and we should send SIGTRAP.
      
      There is another reason for this change. We are going to replace
      uprobes_state->count with MMF_ flags set by register/unregister
      and cleared by find_active_uprobe(), and set/clear shouldn't
      race with each other.
      Signed-off-by: NOleg Nesterov <oleg@redhat.com>
      Acked-by: NSrikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Anton Arapov <anton@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20120529192928.GE8057@redhat.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      77fc4af1