This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / arch / ppc / kernel / ptrace.c
index 426b6f7..19e81ab 100644 (file)
@@ -35,7 +35,7 @@
 /*
  * Set of msr bits that gdb can change on behalf of a process.
  */
-#if defined(CONFIG_40x) || defined(CONFIG_BOOKE)
+#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
 #define MSR_DEBUGCHANGE        0
 #else
 #define MSR_DEBUGCHANGE        (MSR_SE | MSR_BE)
@@ -201,9 +201,9 @@ set_single_step(struct task_struct *task)
        struct pt_regs *regs = task->thread.regs;
 
        if (regs != NULL) {
-#if defined(CONFIG_40x) || defined(CONFIG_BOOKE)
+#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
                task->thread.dbcr0 = DBCR0_IDM | DBCR0_IC;
-               regs->msr |= MSR_DE;
+               /* MSR.DE should already be set */
 #else
                regs->msr |= MSR_SE;
 #endif
@@ -216,9 +216,8 @@ clear_single_step(struct task_struct *task)
        struct pt_regs *regs = task->thread.regs;
 
        if (regs != NULL) {
-#if defined(CONFIG_40x) || defined(CONFIG_BOOKE)
+#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
                task->thread.dbcr0 = 0;
-               regs->msr &= ~MSR_DE;
 #else
                regs->msr &= ~MSR_SE;
 #endif
@@ -262,6 +261,8 @@ int sys_ptrace(long request, long pid, long addr, long data)
        read_unlock(&tasklist_lock);
        if (!child)
                goto out;
+       if (!vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT))
+               goto out_tsk;
 
        ret = -EPERM;
        if (pid == 1)           /* you may not mess with init */