Bug 217079 - utrace support breaks SPU debugging on powerc/cell
Summary: utrace support breaks SPU debugging on powerc/cell
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: rawhide
Hardware: ppc64
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Kernel Maintainer List
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-11-23 20:13 UTC by Arnd Bergmann
Modified: 2007-11-30 22:11 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-11-23 21:50:26 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Arnd Bergmann 2006-11-23 20:13:46 UTC
The current utrace patch contains the hunk

--- linux-2.6.orig/arch/powerpc/platforms/cell/spufs/run.c
+++ linux-2.6/arch/powerpc/platforms/cell/spufs/run.c
@@ -70,6 +70,7 @@ static inline int spu_run_fini(struct sp

        if (signal_pending(current))
                ret = -ERESTARTSYS;
+#if 0 /* XXX */
        if (unlikely(current->ptrace & PT_PTRACED)) {
                if ((*status & SPU_STATUS_STOPPED_BY_STOP)
                    && (*status >> SPU_STOP_STATUS_SHIFT) == 0x3fff) {
@@ -77,6 +78,7 @@ static inline int spu_run_fini(struct sp
                        ret = -ERESTARTSYS;
                }
        }
+#endif
        return ret;
 }

which breaks support for breakpoints in SPU programs. I discussed this with 
Ulrich Weigand, the spu-gdb maintainer. The result is that we should not check 
for (current->ptrace & PT_PTRACED) at all in this code. Please replace the 
patchlet above with this one:

--- a/arch/powerpc/platforms/cell/spufs/run.c
+++ b/arch/powerpc/platforms/cell/spufs/run.c
@@ -70,12 +70,10 @@ static inline int spu_run_fini(struct sp
 
 	if (signal_pending(current))
 		ret = -ERESTARTSYS;
-	if (unlikely(current->ptrace & PT_PTRACED)) {
-		if ((*status & SPU_STATUS_STOPPED_BY_STOP)
-		    && (*status >> SPU_STOP_STATUS_SHIFT) == 0x3fff) {
-			force_sig(SIGTRAP, current);
-			ret = -ERESTARTSYS;
-		}
+	if ((*status & SPU_STATUS_STOPPED_BY_STOP)
+	    && (*status >> SPU_STOP_STATUS_SHIFT) == 0x3fff) {
+		force_sig(SIGTRAP, current);
+		ret = -ERESTARTSYS;
 	}
 	return ret;
 }

Comment 1 David Woodhouse 2006-11-23 21:50:26 UTC
Committed; thanks.


Note You need to log in before you can comment on or make changes to this bug.