Skip to contentSkip to conversation

linux-next: m86k/m68knommu tree build failure

DISCUSSION Stephen Rothwell 4 participants 7 messages Sep 10, 2009 – Oct 1, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hi Geert, Greg,

Today's linux-next build (m68k defconfig) failed like this:

kernel/built-in.o: In function `ptrace_resume':
ptrace.c:(.text+0xc5d6): undefined reference to user_disable_single_step' ptrace.c:(.text+0xc5fe): undefined reference to user_enable_single_step' ptrace.c:(.text+0xc620): undefined reference to `user_disable_single_step'

Caused by commit 5db612ef70d24be12f6dbf5d06b23bcd6bc2fc05 ("m68knommu:
define arch_has_single_step() and friends"). This commit added definitions of these functions for m68knommu, but added declarations (and arch_has_single_step()) in a common header file.

Signature · 3 lines
Cheers,
Stephen Rothwell                    [email protected]
http://www.canb.auug.org.au/~sfr/
#1 lore raw

Hi Stephen,

Quoted 11 lines · Stephen Rothwell

Today's linux-next build (m68k defconfig) failed like this:

kernel/built-in.o: In function `ptrace_resume':
ptrace.c:(.text+0xc5d6): undefined reference to user_disable_single_step' ptrace.c:(.text+0xc5fe): undefined reference to user_enable_single_step' ptrace.c:(.text+0xc620): undefined reference to `user_disable_single_step'

Caused by commit 5db612ef70d24be12f6dbf5d06b23bcd6bc2fc05 ("m68knommu:
define arch_has_single_step() and friends"). This commit added definitions of these functions for m68knommu, but added declarations (and arch_has_single_step()) in a common header file.

Ah, yes, thanks. I'll fix that. I don't regularly build for m68k, so I missed that in my test builds.

Regards
Greg

------------------------------------------------------------------------

Greg Ungerer  --  Principal Engineer        EMAIL:     [email protected]
SnapGear Group, McAfee                      PHONE:       +61 7 3435 2888
825 Stanley St,                             FAX:         +61 7 3891 3630
Woolloongabba, QLD, 4102, Australia         WEB: http://www.SnapGear.com
#2 lore raw
Quoted 10 lines · Greg Ungerer

Hi Stephen,

Quoted 7 lines · Stephen Rothwell

Today's linux-next build (m68k defconfig) failed like this:

kernel/built-in.o: In function `ptrace_resume':
ptrace.c:(.text+0xc5d6): undefined reference to user_disable_single_step' ptrace.c:(.text+0xc5fe): undefined reference to user_enable_single_step' ptrace.c:(.text+0xc620): undefined reference to `user_disable_single_step'

Quoted 7 lines
Quoted 4 lines

Caused by commit 5db612ef70d24be12f6dbf5d06b23bcd6bc2fc05 ("m68knommu:
define arch_has_single_step() and friends"). This commit added definitions of these functions for m68knommu, but added declarations (and arch_has_single_step()) in a common header file.

Ah, yes, thanks. I'll fix that. I don't regularly build for m68k, so I missed that in my test builds.

An m68k implementation is here
<http://permalink.gmane.org/gmane.linux.ports.m68k/721>.

Andreas.

Signature · 3 lines
Andreas Schwab, [email protected]
GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84  5EC7 45C6 250E 6F00 984E
"And now for something completely different."
#4 lore raw
In reply to Andreas Schwab

Hi Andreas,

Quoted 16 lines · Andreas Schwab
Quoted 14 lines · Greg Ungerer

Hi Stephen,

Quoted 11 lines · Stephen Rothwell

Today's linux-next build (m68k defconfig) failed like this:

kernel/built-in.o: In function `ptrace_resume':
ptrace.c:(.text+0xc5d6): undefined reference to user_disable_single_step' ptrace.c:(.text+0xc5fe): undefined reference to user_enable_single_step' ptrace.c:(.text+0xc620): undefined reference to `user_disable_single_step'

Caused by commit 5db612ef70d24be12f6dbf5d06b23bcd6bc2fc05 ("m68knommu:
define arch_has_single_step() and friends"). This commit added definitions of these functions for m68knommu, but added declarations (and arch_has_single_step()) in a common header file.

Quoted 5 lines
Quoted 2 lines

Ah, yes, thanks. I'll fix that. I don't regularly build for m68k, so I missed that in my test builds.

An m68k implementation is here
<http://permalink.gmane.org/gmane.linux.ports.m68k/721>.

Thanks for the pointer. I have something similar I have been working on for m68knommu. I'll follow up here with the new patches soon.

Regards
Greg

------------------------------------------------------------------------

Greg Ungerer  --  Principal Engineer        EMAIL:     [email protected]
SnapGear Group, McAfee                      PHONE:       +61 7 3435 2888
825 Stanley St,                             FAX:         +61 7 3891 3630
Woolloongabba, QLD, 4102, Australia         WEB: http://www.SnapGear.com
#5 lore raw
In reply to Andreas Schwab

Hi Andreas,

Quoted 16 lines · Andreas Schwab
Quoted 14 lines · Greg Ungerer

Hi Stephen,

Quoted 11 lines · Stephen Rothwell

Today's linux-next build (m68k defconfig) failed like this:

kernel/built-in.o: In function `ptrace_resume':
ptrace.c:(.text+0xc5d6): undefined reference to user_disable_single_step' ptrace.c:(.text+0xc5fe): undefined reference to user_enable_single_step' ptrace.c:(.text+0xc620): undefined reference to `user_disable_single_step'

Caused by commit 5db612ef70d24be12f6dbf5d06b23bcd6bc2fc05 ("m68knommu:
define arch_has_single_step() and friends"). This commit added definitions of these functions for m68knommu, but added declarations (and arch_has_single_step()) in a common header file.

Quoted 5 lines
Quoted 2 lines

Ah, yes, thanks. I'll fix that. I don't regularly build for m68k, so I missed that in my test builds.

An m68k implementation is here
<http://permalink.gmane.org/gmane.linux.ports.m68k/721>.

I have 2 patches now for m68knommu (first is below, second following). If no complaints I'll add to the for-next branch of the m68knommu git tree.

Regards
Greg

m68knommu: define arch_has_single_step() and friends

Towards adding CONFIG_UTRACE support for non-mmu m68k add arch_has_single_step, and its support functions user_enable_single_step() and user_disable_single_step().

---
 arch/m68k/include/asm/ptrace.h |   12 ++++++++++++
 arch/m68knommu/kernel/ptrace.c |   18 +++++++++++++++---
 2 files changed, 27 insertions(+), 3 deletions(-)
arch/m68k/include/asm/ptrace.h +12 -0
index 8c9194b..beb2091 100644
@@ -82,6 +82,18 @@ struct switch_stack {
 #define instruction_pointer(regs) ((regs)->pc)
 #define profile_pc(regs) instruction_pointer(regs)
 extern void show_regs(struct pt_regs *);
+
+/*
+ * These are defined as per linux/ptrace.h.
+ */
+struct task_struct;
+
+#ifndef CONFIG_MMU
+#define	arch_has_single_step()	(1)
+extern void user_enable_single_step(struct task_struct *);
+extern void user_disable_single_step(struct task_struct *);
+#endif
+
 #endif /* __KERNEL__ */
 #endif /* __ASSEMBLY__ */
 #endif /* _M68K_PTRACE_H */
arch/m68knommu/kernel/ptrace.c +15 -3
index ef70ca0..4d38289 100644
@@ -86,6 +86,20 @@ static inline int put_reg(struct task_struct *task, int regno,
 	return 0;
 }
 
+void user_enable_single_step(struct task_struct *task)
+{
+	unsigned long srflags;
+	srflags = get_reg(task, PT_SR) | (TRACE_BITS << 16);
+	put_reg(task, PT_SR, srflags);
+}
+
+void user_disable_single_step(struct task_struct *task)
+{
+	unsigned long srflags;
+	srflags = get_reg(task, PT_SR) & ~(TRACE_BITS << 16);
+	put_reg(task, PT_SR, srflags);
+}
+
 /*
  * Called by kernel/ptrace.c when detaching..
  *
@@ -93,10 +107,8 @@ static inline int put_reg(struct task_struct *task, int regno,
  */
 void ptrace_disable(struct task_struct *child)
 {
-	unsigned long tmp;
 	/* make sure the single step bit is not set. */
-	tmp = get_reg(child, PT_SR) & ~(TRACE_BITS << 16);
-	put_reg(child, PT_SR, tmp);
+	user_disable_single_step(child);
 }
 
 long arch_ptrace(struct task_struct *child, long request, long addr, 

long data)

------------------------------------------------------------------------

Greg Ungerer  --  Principal Engineer        EMAIL:     [email protected]
SnapGear Group, McAfee                      PHONE:       +61 7 3435 2888
825 Stanley St,                             FAX:         +61 7 3891 3630
Woolloongabba, QLD, 4102, Australia         WEB: http://www.SnapGear.com
#6 lore raw
Quoted 22 lines · Greg Ungerer

Hi Andreas,

Quoted 19 lines · Andreas Schwab
Quoted 16 lines · Greg Ungerer

Hi Stephen,

Quoted 11 lines · Stephen Rothwell

Today's linux-next build (m68k defconfig) failed like this:

kernel/built-in.o: In function `ptrace_resume':
ptrace.c:(.text+0xc5d6): undefined reference to user_disable_single_step' ptrace.c:(.text+0xc5fe): undefined reference to user_enable_single_step' ptrace.c:(.text+0xc620): undefined reference to `user_disable_single_step'

Caused by commit 5db612ef70d24be12f6dbf5d06b23bcd6bc2fc05 ("m68knommu:
define arch_has_single_step() and friends"). This commit added definitions of these functions for m68knommu, but added declarations (and arch_has_single_step()) in a common header file.

Ah, yes, thanks. I'll fix that. I don't regularly build for m68k, so I missed that in my test builds.

Quoted 6 lines
Quoted 2 lines

An m68k implementation is here
<http://permalink.gmane.org/gmane.linux.ports.m68k/721>.

I have 2 patches now for m68knommu (first is below, second following). If no complaints I'll add to the for-next branch of the m68knommu git tree.

Second patch:

m68knommu: remove ptrace PEEK and POKE

Remove the no longer needed ptrace PEEK and POKE ioctl support.

---
 arch/m68knommu/kernel/ptrace.c |   68 
----------------------------------------
 1 files changed, 0 insertions(+), 68 deletions(-)
arch/m68knommu/kernel/ptrace.c +0 -12
index 4d38289..5a37549 100644
@@ -116,12 +116,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
 	int ret;
 
 	switch (request) {
-		/* when I and D space are separate, these will need to be fixed. */
-		case PTRACE_PEEKTEXT: /* read word at location addr. */
-		case PTRACE_PEEKDATA:
-			ret = generic_ptrace_peekdata(child, addr, data);
-			break;
-
 		/* read the word at location addr in the USER area. */
 		case PTRACE_PEEKUSR: {
 			unsigned long tmp;
@@ -160,12 +154,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
 			break;
 		}
 
-		/* when I and D space are separate, this will have to be fixed. */
-		case PTRACE_POKETEXT: /* write the word at location addr. */
-		case PTRACE_POKEDATA:
-			ret = generic_ptrace_pokedata(child, addr, data);
-			break;
-
 		case PTRACE_POKEUSR: /* write the word at location addr in the USER 

area */
ret = -EIO;
if ((addr & 3) || addr < 0 ||
@@ -202,62 +190,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
}
break;

- case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */
- case PTRACE_CONT: { /* restart after signal. */
- long tmp;
-
- ret = -EIO;
- if (!valid_signal(data))
- break;
- if (request == PTRACE_SYSCALL)
- set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
- else
- clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
- child->exit_code = data;
- /* make sure the single step bit is not set. */
- tmp = get_reg(child, PT_SR) & ~(TRACE_BITS << 16);
- put_reg(child, PT_SR, tmp);
- wake_up_process(child);
- ret = 0;
- break;
- }
-
- /*
- * make the child exit. Best I can do is send it a sigkill.
- * perhaps it should be put in the status that it wants to
- * exit.
- */
- case PTRACE_KILL: {
- long tmp;
-
- ret = 0;
- if (child->exit_state == EXIT_ZOMBIE) /* already dead */
- break;
- child->exit_code = SIGKILL;
- /* make sure the single step bit is not set. */
- tmp = get_reg(child, PT_SR) & ~(TRACE_BITS << 16);
- put_reg(child, PT_SR, tmp);
- wake_up_process(child);
- break;
- }
-
- case PTRACE_SINGLESTEP: { /* set the trap flag. */
- long tmp;
-
- ret = -EIO;
- if (!valid_signal(data))
- break;
- clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
- tmp = get_reg(child, PT_SR) | (TRACE_BITS << 16);
- put_reg(child, PT_SR, tmp);
-
- child->exit_code = data;
- /* give it a chance to run. */
- wake_up_process(child);
- ret = 0;
- break;
- }
-
case PTRACE_DETACH: /* detach a process that was attached. */
ret = ptrace_detach(child, data); break;

------------------------------------------------------------------------

Greg Ungerer  --  Principal Engineer        EMAIL:     [email protected]
SnapGear Group, McAfee                      PHONE:       +61 7 3435 2888
825 Stanley St,                             FAX:         +61 7 3891 3630
Woolloongabba, QLD, 4102, Australia         WEB: http://www.SnapGear.com