All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/20] powerpc/udbg: Remove unused udbg_read()
@ 2012-10-09 14:20 Michael Ellerman
  2012-10-09 14:20 ` [PATCH 02/20] powerpc/xmon: Remove unused xmon_expect() & xmon_read_poll() Michael Ellerman
                   ` (18 more replies)
  0 siblings, 19 replies; 25+ messages in thread
From: Michael Ellerman @ 2012-10-09 14:20 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Paul Mackerras, Anton Blanchard

The last user of udbg_read() was removed in 2005, in commit fca5dcd
"Simplify and clean up the xmon terminal I/O".

Given we haven't needed it for 7 years we can probably drop it.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
 arch/powerpc/include/asm/udbg.h |    1 -
 arch/powerpc/kernel/udbg.c      |   23 -----------------------
 2 files changed, 24 deletions(-)

diff --git a/arch/powerpc/include/asm/udbg.h b/arch/powerpc/include/asm/udbg.h
index b303881..5a7510e 100644
--- a/arch/powerpc/include/asm/udbg.h
+++ b/arch/powerpc/include/asm/udbg.h
@@ -21,7 +21,6 @@ extern int (*udbg_getc_poll)(void);
 
 extern void udbg_puts(const char *s);
 extern int udbg_write(const char *s, int n);
-extern int udbg_read(char *buf, int buflen);
 
 extern void register_early_udbg_console(void);
 extern void udbg_printf(const char *fmt, ...)
diff --git a/arch/powerpc/kernel/udbg.c b/arch/powerpc/kernel/udbg.c
index c39c1ca..f974849 100644
--- a/arch/powerpc/kernel/udbg.c
+++ b/arch/powerpc/kernel/udbg.c
@@ -122,29 +122,6 @@ int udbg_write(const char *s, int n)
 	return n - remain;
 }
 
-int udbg_read(char *buf, int buflen)
-{
-	char *p = buf;
-	int i, c;
-
-	if (!udbg_getc)
-		return 0;
-
-	for (i = 0; i < buflen; ++i) {
-		do {
-			c = udbg_getc();
-			if (c == -1 && i == 0)
-				return -1;
-
-		} while (c == 0x11 || c == 0x13);
-		if (c == 0 || c == -1)
-			break;
-		*p++ = c;
-	}
-
-	return i;
-}
-
 #define UDBG_BUFSIZE 256
 void udbg_printf(const char *fmt, ...)
 {
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 02/20] powerpc/xmon: Remove unused xmon_expect() & xmon_read_poll()
  2012-10-09 14:20 [PATCH 01/20] powerpc/udbg: Remove unused udbg_read() Michael Ellerman
@ 2012-10-09 14:20 ` Michael Ellerman
  2012-10-09 14:20 ` [PATCH 03/20] powerpc/xmon: Remove empty xmon_map_scc() Michael Ellerman
                   ` (17 subsequent siblings)
  18 siblings, 0 replies; 25+ messages in thread
From: Michael Ellerman @ 2012-10-09 14:20 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Paul Mackerras, Anton Blanchard

It looks like xmon_expect() was used for doing xmon over a modem (!?),
that code was dropped in 2005 in commit 51d3082 "Unify udbg (#2)".

Once xmon_expect() is gone xmon_read_poll() is unused, drop it too.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
 arch/powerpc/xmon/nonstdio.c |   27 ---------------------------
 arch/powerpc/xmon/nonstdio.h |    2 --
 arch/powerpc/xmon/start.c    |    7 -------
 3 files changed, 36 deletions(-)

diff --git a/arch/powerpc/xmon/nonstdio.c b/arch/powerpc/xmon/nonstdio.c
index bfac84f..a225d80 100644
--- a/arch/powerpc/xmon/nonstdio.c
+++ b/arch/powerpc/xmon/nonstdio.c
@@ -23,33 +23,6 @@ static char line[256];
 static char *lineptr;
 static int lineleft;
 
-int xmon_expect(const char *str, unsigned long timeout)
-{
-	int c;
-	unsigned long t0;
-
-	/* assume 25MHz default timebase if tb_ticks_per_sec not set yet */
-	timeout *= tb_ticks_per_sec? tb_ticks_per_sec: 25000000;
-	t0 = get_tbl();
-	do {
-		lineptr = line;
-		for (;;) {
-			c = xmon_read_poll();
-			if (c == -1) {
-				if (get_tbl() - t0 > timeout)
-					return 0;
-				continue;
-			}
-			if (c == '\n')
-				break;
-			if (c != '\r' && lineptr < &line[sizeof(line) - 1])
-				*lineptr++ = c;
-		}
-		*lineptr = 0;
-	} while (strstr(line, str) == NULL);
-	return 1;
-}
-
 int xmon_getchar(void)
 {
 	int c;
diff --git a/arch/powerpc/xmon/nonstdio.h b/arch/powerpc/xmon/nonstdio.h
index 23dd95f..d8cec38 100644
--- a/arch/powerpc/xmon/nonstdio.h
+++ b/arch/powerpc/xmon/nonstdio.h
@@ -9,7 +9,5 @@ extern void xmon_puts(const char *);
 extern char *xmon_gets(char *, int);
 extern void xmon_printf(const char *, ...);
 extern void xmon_map_scc(void);
-extern int xmon_expect(const char *str, unsigned long timeout);
 extern int xmon_write(const void *ptr, int nb);
 extern int xmon_readchar(void);
-extern int xmon_read_poll(void);
diff --git a/arch/powerpc/xmon/start.c b/arch/powerpc/xmon/start.c
index 8864de2..84f3a15 100644
--- a/arch/powerpc/xmon/start.c
+++ b/arch/powerpc/xmon/start.c
@@ -25,10 +25,3 @@ int xmon_readchar(void)
 		return udbg_getc();
 	return -1;
 }
-
-int xmon_read_poll(void)
-{
-	if (udbg_getc_poll)
-		return udbg_getc_poll();
-	return -1;
-}
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 03/20] powerpc/xmon: Remove empty xmon_map_scc()
  2012-10-09 14:20 [PATCH 01/20] powerpc/udbg: Remove unused udbg_read() Michael Ellerman
  2012-10-09 14:20 ` [PATCH 02/20] powerpc/xmon: Remove unused xmon_expect() & xmon_read_poll() Michael Ellerman
@ 2012-10-09 14:20 ` Michael Ellerman
  2012-10-09 14:20 ` [PATCH 04/20] powerpc/xmon: Make xmon_getchar() static Michael Ellerman
                   ` (16 subsequent siblings)
  18 siblings, 0 replies; 25+ messages in thread
From: Michael Ellerman @ 2012-10-09 14:20 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Paul Mackerras, Anton Blanchard

This has been empty since 2005, commit 51d3082 "Unify udbg (#2)".

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
 arch/powerpc/xmon/nonstdio.h |    1 -
 arch/powerpc/xmon/start.c    |    4 ----
 arch/powerpc/xmon/xmon.c     |    1 -
 3 files changed, 6 deletions(-)

diff --git a/arch/powerpc/xmon/nonstdio.h b/arch/powerpc/xmon/nonstdio.h
index d8cec38..8799ccf 100644
--- a/arch/powerpc/xmon/nonstdio.h
+++ b/arch/powerpc/xmon/nonstdio.h
@@ -8,6 +8,5 @@ extern int xmon_getchar(void);
 extern void xmon_puts(const char *);
 extern char *xmon_gets(char *, int);
 extern void xmon_printf(const char *, ...);
-extern void xmon_map_scc(void);
 extern int xmon_write(const void *ptr, int nb);
 extern int xmon_readchar(void);
diff --git a/arch/powerpc/xmon/start.c b/arch/powerpc/xmon/start.c
index 84f3a15..7769cb5 100644
--- a/arch/powerpc/xmon/start.c
+++ b/arch/powerpc/xmon/start.c
@@ -10,10 +10,6 @@
 #include <asm/udbg.h>
 #include "nonstdio.h"
 
-void xmon_map_scc(void)
-{
-}
-
 int xmon_write(const void *ptr, int nb)
 {
 	return udbg_write(ptr, nb);
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index 3a56a63..67d36ab 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -2943,7 +2943,6 @@ static void xmon_init(int enable)
 		__debugger_dabr_match = NULL;
 		__debugger_fault_handler = NULL;
 	}
-	xmon_map_scc();
 }
 
 #ifdef CONFIG_MAGIC_SYSRQ
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 04/20] powerpc/xmon: Make xmon_getchar() static
  2012-10-09 14:20 [PATCH 01/20] powerpc/udbg: Remove unused udbg_read() Michael Ellerman
  2012-10-09 14:20 ` [PATCH 02/20] powerpc/xmon: Remove unused xmon_expect() & xmon_read_poll() Michael Ellerman
  2012-10-09 14:20 ` [PATCH 03/20] powerpc/xmon: Remove empty xmon_map_scc() Michael Ellerman
@ 2012-10-09 14:20 ` Michael Ellerman
  2012-10-09 14:20 ` [PATCH 05/20] powerpc/xmon: Merge start.c into nonstdio.c Michael Ellerman
                   ` (15 subsequent siblings)
  18 siblings, 0 replies; 25+ messages in thread
From: Michael Ellerman @ 2012-10-09 14:20 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Paul Mackerras, Anton Blanchard

xmon_getchar() is only called from within nonstdio.c, so make it static.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
 arch/powerpc/xmon/nonstdio.c |    2 +-
 arch/powerpc/xmon/nonstdio.h |    1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/powerpc/xmon/nonstdio.c b/arch/powerpc/xmon/nonstdio.c
index a225d80..2209485 100644
--- a/arch/powerpc/xmon/nonstdio.c
+++ b/arch/powerpc/xmon/nonstdio.c
@@ -23,7 +23,7 @@ static char line[256];
 static char *lineptr;
 static int lineleft;
 
-int xmon_getchar(void)
+static int xmon_getchar(void)
 {
 	int c;
 
diff --git a/arch/powerpc/xmon/nonstdio.h b/arch/powerpc/xmon/nonstdio.h
index 8799ccf..321284f 100644
--- a/arch/powerpc/xmon/nonstdio.h
+++ b/arch/powerpc/xmon/nonstdio.h
@@ -4,7 +4,6 @@
 #define putchar	xmon_putchar
 
 extern int xmon_putchar(int c);
-extern int xmon_getchar(void);
 extern void xmon_puts(const char *);
 extern char *xmon_gets(char *, int);
 extern void xmon_printf(const char *, ...);
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 05/20] powerpc/xmon: Merge start.c into nonstdio.c
  2012-10-09 14:20 [PATCH 01/20] powerpc/udbg: Remove unused udbg_read() Michael Ellerman
                   ` (2 preceding siblings ...)
  2012-10-09 14:20 ` [PATCH 04/20] powerpc/xmon: Make xmon_getchar() static Michael Ellerman
@ 2012-10-09 14:20 ` Michael Ellerman
  2012-10-09 14:20 ` [PATCH 06/20] powerpc/xmon: Remove renaming #defines of scanhex() and skipbl() Michael Ellerman
                   ` (14 subsequent siblings)
  18 siblings, 0 replies; 25+ messages in thread
From: Michael Ellerman @ 2012-10-09 14:20 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Paul Mackerras, Anton Blanchard

The routines in start.c are only ever called from nonstdio.c, so if we
move them in there they can become static which is nice.

I suspect the idea behind the separation was that start.c could be
replaced in order to build xmon in userland. If anyone still cares about
doing that we could handle that with an ifdef or two.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
 arch/powerpc/xmon/Makefile   |    2 +-
 arch/powerpc/xmon/nonstdio.c |   14 ++++++++++++++
 arch/powerpc/xmon/nonstdio.h |    2 --
 arch/powerpc/xmon/start.c    |   23 -----------------------
 4 files changed, 15 insertions(+), 26 deletions(-)
 delete mode 100644 arch/powerpc/xmon/start.c

diff --git a/arch/powerpc/xmon/Makefile b/arch/powerpc/xmon/Makefile
index c168c54..b49fdbd 100644
--- a/arch/powerpc/xmon/Makefile
+++ b/arch/powerpc/xmon/Makefile
@@ -6,7 +6,7 @@ GCOV_PROFILE := n
 
 ccflags-$(CONFIG_PPC64) := -mno-minimal-toc
 
-obj-y			+= xmon.o start.o nonstdio.o
+obj-y			+= xmon.o nonstdio.o
 
 ifdef CONFIG_XMON_DISASSEMBLY
 obj-y			+= ppc-dis.o ppc-opc.o
diff --git a/arch/powerpc/xmon/nonstdio.c b/arch/powerpc/xmon/nonstdio.c
index 2209485..942d0f6 100644
--- a/arch/powerpc/xmon/nonstdio.c
+++ b/arch/powerpc/xmon/nonstdio.c
@@ -7,9 +7,23 @@
  *      2 of the License, or (at your option) any later version.
  */
 #include <linux/string.h>
+#include <asm/udbg.h>
 #include <asm/time.h>
 #include "nonstdio.h"
 
+
+static int xmon_write(const void *ptr, int nb)
+{
+	return udbg_write(ptr, nb);
+}
+
+static int xmon_readchar(void)
+{
+	if (udbg_getc)
+		return udbg_getc();
+	return -1;
+}
+
 int xmon_putchar(int c)
 {
 	char ch = c;
diff --git a/arch/powerpc/xmon/nonstdio.h b/arch/powerpc/xmon/nonstdio.h
index 321284f..18a51de 100644
--- a/arch/powerpc/xmon/nonstdio.h
+++ b/arch/powerpc/xmon/nonstdio.h
@@ -7,5 +7,3 @@ extern int xmon_putchar(int c);
 extern void xmon_puts(const char *);
 extern char *xmon_gets(char *, int);
 extern void xmon_printf(const char *, ...);
-extern int xmon_write(const void *ptr, int nb);
-extern int xmon_readchar(void);
diff --git a/arch/powerpc/xmon/start.c b/arch/powerpc/xmon/start.c
deleted file mode 100644
index 7769cb5..0000000
--- a/arch/powerpc/xmon/start.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (C) 1996 Paul Mackerras.
- *
- *      This program is free software; you can redistribute it and/or
- *      modify it under the terms of the GNU General Public License
- *      as published by the Free Software Foundation; either version
- *      2 of the License, or (at your option) any later version.
- */
-#include <asm/machdep.h>
-#include <asm/udbg.h>
-#include "nonstdio.h"
-
-int xmon_write(const void *ptr, int nb)
-{
-	return udbg_write(ptr, nb);
-}
-
-int xmon_readchar(void)
-{
-	if (udbg_getc)
-		return udbg_getc();
-	return -1;
-}
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 06/20] powerpc/xmon: Remove renaming #defines of scanhex() and skipbl()
  2012-10-09 14:20 [PATCH 01/20] powerpc/udbg: Remove unused udbg_read() Michael Ellerman
                   ` (3 preceding siblings ...)
  2012-10-09 14:20 ` [PATCH 05/20] powerpc/xmon: Merge start.c into nonstdio.c Michael Ellerman
@ 2012-10-09 14:20 ` Michael Ellerman
  2012-10-09 14:59   ` David Laight
  2012-10-09 22:15   ` Paul Mackerras
  2012-10-09 14:20 ` [PATCH 07/20] powerpc/xmon: Remove unused #defines Michael Ellerman
                   ` (13 subsequent siblings)
  18 siblings, 2 replies; 25+ messages in thread
From: Michael Ellerman @ 2012-10-09 14:20 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Paul Mackerras, Anton Blanchard

We have two #defines that rename scanhex() and skipbl() to
xmon_scanhex() and xmon_skipbl() - but no one ever uses those
names.

So the only effect is to rename the actual symbols in the generated
code, and AFACIS there is no reason to do that, so drop them.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
 arch/powerpc/xmon/xmon.c |    3 ---
 1 file changed, 3 deletions(-)

diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index 67d36ab..cc96a71 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -52,9 +52,6 @@
 #include "nonstdio.h"
 #include "dis-asm.h"
 
-#define scanhex	xmon_scanhex
-#define skipbl	xmon_skipbl
-
 #ifdef CONFIG_SMP
 static cpumask_t cpus_in_xmon = CPU_MASK_NONE;
 static unsigned long xmon_taken = 1;
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 07/20] powerpc/xmon: Remove unused #defines
  2012-10-09 14:20 [PATCH 01/20] powerpc/udbg: Remove unused udbg_read() Michael Ellerman
                   ` (4 preceding siblings ...)
  2012-10-09 14:20 ` [PATCH 06/20] powerpc/xmon: Remove renaming #defines of scanhex() and skipbl() Michael Ellerman
@ 2012-10-09 14:20 ` Michael Ellerman
  2012-10-09 14:20 ` [PATCH 08/20] powerpc/xmon: Use STACK_FRAME_OVERHEAD in xmon_show_stack() Michael Ellerman
                   ` (12 subsequent siblings)
  18 siblings, 0 replies; 25+ messages in thread
From: Michael Ellerman @ 2012-10-09 14:20 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Paul Mackerras, Anton Blanchard

Neither REGS_PER_LINE or LAST_VOLATILE are used, nor have they ever
been as far back as I can see.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
 arch/powerpc/xmon/xmon.c |    4 ----
 1 file changed, 4 deletions(-)

diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index cc96a71..abf6be4 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -166,12 +166,8 @@ extern void xmon_leave(void);
 
 #ifdef CONFIG_PPC64
 #define REG		"%.16lx"
-#define REGS_PER_LINE	4
-#define LAST_VOLATILE	13
 #else
 #define REG		"%.8lx"
-#define REGS_PER_LINE	8
-#define LAST_VOLATILE	12
 #endif
 
 #define GETWORD(v)	(((v)[0] << 24) + ((v)[1] << 16) + ((v)[2] << 8) + (v)[3])
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 08/20] powerpc/xmon: Use STACK_FRAME_OVERHEAD in xmon_show_stack()
  2012-10-09 14:20 [PATCH 01/20] powerpc/udbg: Remove unused udbg_read() Michael Ellerman
                   ` (5 preceding siblings ...)
  2012-10-09 14:20 ` [PATCH 07/20] powerpc/xmon: Remove unused #defines Michael Ellerman
@ 2012-10-09 14:20 ` Michael Ellerman
  2012-10-09 14:20 ` [PATCH 09/20] powerpc/xmon: Fiddle xmon_depth_to_print logic " Michael Ellerman
                   ` (11 subsequent siblings)
  18 siblings, 0 replies; 25+ messages in thread
From: Michael Ellerman @ 2012-10-09 14:20 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Paul Mackerras, Anton Blanchard

We use STACK_FRAME_OVERHEAD in the exception vectors to establish
the exception frame, so it should be good enough to use here.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
 arch/powerpc/xmon/xmon.c |   10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index abf6be4..d940234 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -1286,12 +1286,6 @@ static int xmon_depth_to_print = 64;
 #define LRSAVE_OFFSET		(STACK_FRAME_LR_SAVE * sizeof(unsigned long))
 #define MARKER_OFFSET		(STACK_FRAME_MARKER * sizeof(unsigned long))
 
-#ifdef __powerpc64__
-#define REGS_OFFSET		0x70
-#else
-#define REGS_OFFSET		16
-#endif
-
 static void xmon_show_stack(unsigned long sp, unsigned long lr,
 			    unsigned long pc)
 {
@@ -1355,10 +1349,10 @@ static void xmon_show_stack(unsigned long sp, unsigned long lr,
 		   an exception frame. */
 		if (mread(sp + MARKER_OFFSET, &marker, sizeof(unsigned long))
 		    && marker == STACK_FRAME_REGS_MARKER) {
-			if (mread(sp + REGS_OFFSET, &regs, sizeof(regs))
+			if (mread(sp + STACK_FRAME_OVERHEAD, &regs, sizeof(regs))
 			    != sizeof(regs)) {
 				printf("Couldn't read registers at %lx\n",
-				       sp + REGS_OFFSET);
+				       sp + STACK_FRAME_OVERHEAD);
 				break;
 			}
 			printf("--- Exception: %lx %s at ", regs.trap,
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 09/20] powerpc/xmon: Fiddle xmon_depth_to_print logic in xmon_show_stack()
  2012-10-09 14:20 [PATCH 01/20] powerpc/udbg: Remove unused udbg_read() Michael Ellerman
                   ` (6 preceding siblings ...)
  2012-10-09 14:20 ` [PATCH 08/20] powerpc/xmon: Use STACK_FRAME_OVERHEAD in xmon_show_stack() Michael Ellerman
@ 2012-10-09 14:20 ` Michael Ellerman
  2012-10-09 14:20 ` [PATCH 10/20] powerpc/xmon: Factor out the oft-repeated setjmp logic Michael Ellerman
                   ` (10 subsequent siblings)
  18 siblings, 0 replies; 25+ messages in thread
From: Michael Ellerman @ 2012-10-09 14:20 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Paul Mackerras, Anton Blanchard

Currently xmon_depth_to_print is static and global, but it's only
ever used in xmon_show_stack().

At least with a modern compiler it's inlined, so there's no point
in it being static, we could #define it but it's only used in one
place.

By reworking the logic we can drop count and just decrement the
max value as a loop counter. Also switch to a while loop so we
actually print no more than 64 frames as you'd expect based on the
variable name.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
 arch/powerpc/xmon/xmon.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index d940234..1f8d2f1 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -1281,21 +1281,19 @@ static void get_function_bounds(unsigned long pc, unsigned long *startp,
 	catch_memory_errors = 0;
 }
 
-static int xmon_depth_to_print = 64;
-
 #define LRSAVE_OFFSET		(STACK_FRAME_LR_SAVE * sizeof(unsigned long))
 #define MARKER_OFFSET		(STACK_FRAME_MARKER * sizeof(unsigned long))
 
 static void xmon_show_stack(unsigned long sp, unsigned long lr,
 			    unsigned long pc)
 {
+	int max_to_print = 64;
 	unsigned long ip;
 	unsigned long newsp;
 	unsigned long marker;
-	int count = 0;
 	struct pt_regs regs;
 
-	do {
+	while (max_to_print--) {
 		if (sp < PAGE_OFFSET) {
 			if (sp != 0)
 				printf("SP (%lx) is in userspace\n", sp);
@@ -1366,7 +1364,7 @@ static void xmon_show_stack(unsigned long sp, unsigned long lr,
 			break;
 
 		sp = newsp;
-	} while (count++ < xmon_depth_to_print);
+	}
 }
 
 static void backtrace(struct pt_regs *excp)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 10/20] powerpc/xmon: Factor out the oft-repeated setjmp logic
  2012-10-09 14:20 [PATCH 01/20] powerpc/udbg: Remove unused udbg_read() Michael Ellerman
                   ` (7 preceding siblings ...)
  2012-10-09 14:20 ` [PATCH 09/20] powerpc/xmon: Fiddle xmon_depth_to_print logic " Michael Ellerman
@ 2012-10-09 14:20 ` Michael Ellerman
  2012-10-09 22:23   ` Paul Mackerras
  2012-10-09 14:20 ` [PATCH 11/20] powerpc/xmon: Move handle_fault() next to related routines Michael Ellerman
                   ` (9 subsequent siblings)
  18 siblings, 1 reply; 25+ messages in thread
From: Michael Ellerman @ 2012-10-09 14:20 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Paul Mackerras, Anton Blanchard

We have over 15 routines that implement essentially the same logic
in terms of catching faults. Pull the logic out into two helper
routines.

The pattern becomes:

	if (start_bus_error_jump() == 0) {
		<do potentially faulting things>

		end_bus_error_jump();
	} else {
		printf("Faulting thing faulted!\n");
	}

Also move the globals next to the functions.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
 arch/powerpc/xmon/xmon.c |   33 +++++++++++++++++++++++++++++++--
 1 file changed, 31 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index 1f8d2f1..168c5e7 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -72,8 +72,6 @@ static unsigned long ncsum = 4096;
 static int termch;
 static char tmpstr[128];
 
-static long bus_error_jmp[JMP_BUF_LEN];
-static int catch_memory_errors;
 static long *xmon_fault_jmp[NR_CPUS];
 
 /* Breakpoint stuff */
@@ -636,6 +634,37 @@ static int xmon_ipi(struct pt_regs *regs)
 	return 0;
 }
 
+static long bus_error_jmp[JMP_BUF_LEN];
+static int catch_memory_errors;
+
+int start_bus_error_jump(void)
+{
+	int rc;
+
+	catch_memory_errors = 1;
+	sync();
+
+	rc = setjmp(bus_error_jmp);
+	if (rc)
+		catch_memory_errors = 0;
+
+	return rc;
+}
+
+void end_bus_error_jump(void)
+{
+	sync();
+
+	/* Wait a little while to see if we get a machine check */
+	__delay(200);
+
+	/*
+	 * We don't actually clear the jump buffer but setting
+	 * catch_memory_errors to zero means we'll no longer jump to it.
+	 */
+	catch_memory_errors = 0;
+}
+
 static int xmon_fault_handler(struct pt_regs *regs)
 {
 	struct bpt *bp;
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 11/20] powerpc/xmon: Move handle_fault() next to related routines
  2012-10-09 14:20 [PATCH 01/20] powerpc/udbg: Remove unused udbg_read() Michael Ellerman
                   ` (8 preceding siblings ...)
  2012-10-09 14:20 ` [PATCH 10/20] powerpc/xmon: Factor out the oft-repeated setjmp logic Michael Ellerman
@ 2012-10-09 14:20 ` Michael Ellerman
  2012-10-09 14:20 ` [PATCH 12/20] powerpc/xmon: Do so simple conversions to start/end_bus_error_jump() Michael Ellerman
                   ` (8 subsequent siblings)
  18 siblings, 0 replies; 25+ messages in thread
From: Michael Ellerman @ 2012-10-09 14:20 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Paul Mackerras, Anton Blanchard

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
 arch/powerpc/xmon/xmon.c |   48 +++++++++++++++++++++++-----------------------
 1 file changed, 24 insertions(+), 24 deletions(-)

diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index 168c5e7..65c3d22 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -665,6 +665,30 @@ void end_bus_error_jump(void)
 	catch_memory_errors = 0;
 }
 
+static int fault_type;
+static int fault_except;
+static char *fault_chars[] = { "--", "**", "##" };
+
+static int handle_fault(struct pt_regs *regs)
+{
+	fault_except = TRAP(regs);
+	switch (TRAP(regs)) {
+	case 0x200:
+		fault_type = 0;
+		break;
+	case 0x300:
+	case 0x380:
+		fault_type = 1;
+		break;
+	default:
+		fault_type = 2;
+	}
+
+	longjmp(bus_error_jmp, 1);
+
+	return 0;
+}
+
 static int xmon_fault_handler(struct pt_regs *regs)
 {
 	struct bpt *bp;
@@ -1755,30 +1779,6 @@ mwrite(unsigned long adrs, void *buf, int size)
 	return n;
 }
 
-static int fault_type;
-static int fault_except;
-static char *fault_chars[] = { "--", "**", "##" };
-
-static int handle_fault(struct pt_regs *regs)
-{
-	fault_except = TRAP(regs);
-	switch (TRAP(regs)) {
-	case 0x200:
-		fault_type = 0;
-		break;
-	case 0x300:
-	case 0x380:
-		fault_type = 1;
-		break;
-	default:
-		fault_type = 2;
-	}
-
-	longjmp(bus_error_jmp, 1);
-
-	return 0;
-}
-
 #define SWAP(a, b, t)	((t) = (a), (a) = (b), (b) = (t))
 
 static void
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 12/20] powerpc/xmon: Do so simple conversions to start/end_bus_error_jump()
  2012-10-09 14:20 [PATCH 01/20] powerpc/udbg: Remove unused udbg_read() Michael Ellerman
                   ` (9 preceding siblings ...)
  2012-10-09 14:20 ` [PATCH 11/20] powerpc/xmon: Move handle_fault() next to related routines Michael Ellerman
@ 2012-10-09 14:20 ` Michael Ellerman
  2012-10-09 14:20 ` [PATCH 13/20] powerpc/xmon: Use start/end_bus_error_jump() in more routines Michael Ellerman
                   ` (7 subsequent siblings)
  18 siblings, 0 replies; 25+ messages in thread
From: Michael Ellerman @ 2012-10-09 14:20 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Paul Mackerras, Anton Blanchard

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
 arch/powerpc/xmon/xmon.c |   79 +++++++++++-----------------------------------
 1 file changed, 18 insertions(+), 61 deletions(-)

diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index 65c3d22..45be9ce 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -1503,19 +1503,14 @@ static void prregs(struct pt_regs *fp)
 	struct pt_regs regs;
 
 	if (scanhex(&base)) {
-		if (setjmp(bus_error_jmp) == 0) {
-			catch_memory_errors = 1;
-			sync();
+		if (start_bus_error_jump() == 0) {
 			regs = *(struct pt_regs *)base;
-			sync();
-			__delay(200);
+			end_bus_error_jump();
 		} else {
-			catch_memory_errors = 0;
 			printf("*** Error reading registers from "REG"\n",
 			       base);
 			return;
 		}
-		catch_memory_errors = 0;
 		fp = &regs;
 	}
 
@@ -1569,10 +1564,7 @@ static void cacheflush(void)
 	nflush = 1;
 	scanhex(&nflush);
 	nflush = (nflush + L1_CACHE_BYTES - 1) / L1_CACHE_BYTES;
-	if (setjmp(bus_error_jmp) == 0) {
-		catch_memory_errors = 1;
-		sync();
-
+	if (start_bus_error_jump() == 0) {
 		if (cmd != 'i') {
 			for (; nflush > 0; --nflush, adrs += L1_CACHE_BYTES)
 				cflush((void *) adrs);
@@ -1580,11 +1572,9 @@ static void cacheflush(void)
 			for (; nflush > 0; --nflush, adrs += L1_CACHE_BYTES)
 				cinval((void *) adrs);
 		}
-		sync();
-		/* wait a little while to see if we get a machine check */
-		__delay(200);
+
+		end_bus_error_jump();
 	}
-	catch_memory_errors = 0;
 }
 
 static unsigned long
@@ -1710,9 +1700,7 @@ mread(unsigned long adrs, void *buf, int size)
 	char *p, *q;
 
 	n = 0;
-	if (setjmp(bus_error_jmp) == 0) {
-		catch_memory_errors = 1;
-		sync();
+	if (start_bus_error_jump() == 0) {
 		p = (char *)adrs;
 		q = (char *)buf;
 		switch (size) {
@@ -1731,12 +1719,9 @@ mread(unsigned long adrs, void *buf, int size)
 				sync();
 			}
 		}
-		sync();
-		/* wait a little while to see if we get a machine check */
-		__delay(200);
+		end_bus_error_jump();
 		n = size;
 	}
-	catch_memory_errors = 0;
 	return n;
 }
 
@@ -1747,9 +1732,7 @@ mwrite(unsigned long adrs, void *buf, int size)
 	char *p, *q;
 
 	n = 0;
-	if (setjmp(bus_error_jmp) == 0) {
-		catch_memory_errors = 1;
-		sync();
+	if (start_bus_error_jump() == 0) {
 		p = (char *) adrs;
 		q = (char *) buf;
 		switch (size) {
@@ -1768,14 +1751,11 @@ mwrite(unsigned long adrs, void *buf, int size)
 				sync();
 			}
 		}
-		sync();
-		/* wait a little while to see if we get a machine check */
-		__delay(200);
+		end_bus_error_jump();
 		n = size;
 	} else {
 		printf("*** Error writing address %x\n", adrs + n);
 	}
-	catch_memory_errors = 0;
 	return n;
 }
 
@@ -2272,24 +2252,18 @@ dump_log_buf(void)
 	unsigned char buf[128];
 	size_t len;
 
-	if (setjmp(bus_error_jmp) != 0) {
+	if (start_bus_error_jump() != 0) {
 		printf("Error dumping printk buffer!\n");
 		return;
 	}
 
-	catch_memory_errors = 1;
-	sync();
-
 	kmsg_dump_rewind_nolock(&dumper);
 	while (kmsg_dump_get_line_nolock(&dumper, false, buf, sizeof(buf), &len)) {
 		buf[len] = '\0';
 		printf("%s", buf);
 	}
 
-	sync();
-	/* wait a little while to see if we get a machine check */
-	__delay(200);
-	catch_memory_errors = 0;
+	end_bus_error_jump();
 }
 
 /*
@@ -2672,18 +2646,12 @@ static void xmon_print_symbol(unsigned long address, const char *mid,
 	unsigned long offset, size;
 
 	printf(REG, address);
-	if (setjmp(bus_error_jmp) == 0) {
-		catch_memory_errors = 1;
-		sync();
+	if (start_bus_error_jump() == 0) {
 		name = kallsyms_lookup(address, &size, &offset, &modname,
 				       tmpstr);
-		sync();
-		/* wait a little while to see if we get a machine check */
-		__delay(200);
+		end_bus_error_jump();
 	}
 
-	catch_memory_errors = 0;
-
 	if (name) {
 		printf("%s%s+%#lx/%#lx", mid, name, offset, size);
 		if (modname)
@@ -3123,19 +3091,13 @@ static void restart_spus(void)
 #define DUMP_WIDTH	23
 #define DUMP_VALUE(format, field, value)				\
 do {									\
-	if (setjmp(bus_error_jmp) == 0) {				\
-		catch_memory_errors = 1;				\
-		sync();							\
+	if (start_bus_error_jump() == 0) {				\
 		printf("  %-*s = "format"\n", DUMP_WIDTH,		\
 				#field, value);				\
-		sync();							\
-		__delay(200);						\
-	} else {							\
-		catch_memory_errors = 0;				\
+		end_bus_error_jump();					\
+	} else								\
 		printf("  %-*s = *** Error reading field.\n",		\
 					DUMP_WIDTH, #field);		\
-	}								\
-	catch_memory_errors = 0;					\
 } while (0)
 
 #define DUMP_FIELD(obj, format, field)	\
@@ -3187,18 +3149,13 @@ static void dump_spu_ls(unsigned long num, int subcmd)
 {
 	unsigned long offset, addr, ls_addr;
 
-	if (setjmp(bus_error_jmp) == 0) {
-		catch_memory_errors = 1;
-		sync();
+	if (start_bus_error_jump() == 0) {
 		ls_addr = (unsigned long)spu_info[num].spu->local_store;
-		sync();
-		__delay(200);
+		end_bus_error_jump();
 	} else {
-		catch_memory_errors = 0;
 		printf("*** Error: accessing spu info for spu %d\n", num);
 		return;
 	}
-	catch_memory_errors = 0;
 
 	if (scanhex(&offset))
 		addr = ls_addr + offset;
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 13/20] powerpc/xmon: Use start/end_bus_error_jump() in more routines
  2012-10-09 14:20 [PATCH 01/20] powerpc/udbg: Remove unused udbg_read() Michael Ellerman
                   ` (10 preceding siblings ...)
  2012-10-09 14:20 ` [PATCH 12/20] powerpc/xmon: Do so simple conversions to start/end_bus_error_jump() Michael Ellerman
@ 2012-10-09 14:20 ` Michael Ellerman
  2012-10-09 14:20 ` [PATCH 14/20] powerpc/xmon: Convert read/write_spr() to use start_bus_error_jump() Michael Ellerman
                   ` (6 subsequent siblings)
  18 siblings, 0 replies; 25+ messages in thread
From: Michael Ellerman @ 2012-10-09 14:20 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Paul Mackerras, Anton Blanchard

These are not entirely equivalent to the old code. In most cases they
just gain a call to __delay() via end_bus_error_jump().

In symbol_lookup() we also move the printf() outside the protected area,
this should be safe as we are not derefencing the value we lookup, just
printing its value.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
 arch/powerpc/xmon/xmon.c |   39 +++++++++++++--------------------------
 1 file changed, 13 insertions(+), 26 deletions(-)

diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index 45be9ce..ddae5cf 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -1321,17 +1321,16 @@ static void get_function_bounds(unsigned long pc, unsigned long *startp,
 	*startp = *endp = 0;
 	if (pc == 0)
 		return;
-	if (setjmp(bus_error_jmp) == 0) {
-		catch_memory_errors = 1;
-		sync();
+
+	if (start_bus_error_jump() == 0) {
 		name = kallsyms_lookup(pc, &size, &offset, NULL, tmpstr);
 		if (name != NULL) {
 			*startp = pc - offset;
 			*endp = pc - offset + size;
 		}
-		sync();
+
+		end_bus_error_jump();
 	}
-	catch_memory_errors = 0;
 }
 
 #define LRSAVE_OFFSET		(STACK_FRAME_LR_SAVE * sizeof(unsigned long))
@@ -2016,14 +2015,11 @@ static void dump_one_paca(int cpu)
 {
 	struct paca_struct *p;
 
-	if (setjmp(bus_error_jmp) != 0) {
+	if (start_bus_error_jump() != 0) {
 		printf("*** Error dumping paca for cpu 0x%x!\n", cpu);
 		return;
 	}
 
-	catch_memory_errors = 1;
-	sync();
-
 	p = &paca[cpu];
 
 	printf("paca for cpu 0x%x @ %p:\n", cpu, p);
@@ -2063,8 +2059,7 @@ static void dump_one_paca(int cpu)
 
 #undef DUMP
 
-	catch_memory_errors = 0;
-	sync();
+	end_bus_error_jump();
 }
 
 static void dump_all_pacas(void)
@@ -2402,17 +2397,14 @@ static void proccall(void)
 	}
 	func = (callfunc_t) adrs;
 	ret = 0;
-	if (setjmp(bus_error_jmp) == 0) {
-		catch_memory_errors = 1;
-		sync();
+	if (start_bus_error_jump() == 0) {
 		ret = func(args[0], args[1], args[2], args[3],
 			   args[4], args[5], args[6], args[7]);
-		sync();
+		end_bus_error_jump();
 		printf("return value is %x\n", ret);
 	} else {
 		printf("*** %x exception occurred\n", fault_except);
 	}
-	catch_memory_errors = 0;
 }
 
 /* Input scanning routines */
@@ -2507,13 +2499,10 @@ scanhex(unsigned long *vp)
 		}
 		tmpstr[i++] = 0;
 		*vp = 0;
-		if (setjmp(bus_error_jmp) == 0) {
-			catch_memory_errors = 1;
-			sync();
+		if (start_bus_error_jump() == 0) {
 			*vp = kallsyms_lookup_name(tmpstr);
-			sync();
+			end_bus_error_jump();
 		}
-		catch_memory_errors = 0;
 		if (!(*vp)) {
 			printf("unknown symbol '%s'\n", tmpstr);
 			return 0;
@@ -2620,17 +2609,15 @@ symbol_lookup(void)
 		break;
 	case 's':
 		getstring(tmp, 64);
-		if (setjmp(bus_error_jmp) == 0) {
-			catch_memory_errors = 1;
-			sync();
+		if (start_bus_error_jump() == 0) {
 			addr = kallsyms_lookup_name(tmp);
+			end_bus_error_jump();
+
 			if (addr)
 				printf("%s: %lx\n", tmp, addr);
 			else
 				printf("Symbol '%s' not found.\n", tmp);
-			sync();
 		}
-		catch_memory_errors = 0;
 		termch = 0;
 		break;
 	}
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 14/20] powerpc/xmon: Convert read/write_spr() to use start_bus_error_jump()
  2012-10-09 14:20 [PATCH 01/20] powerpc/udbg: Remove unused udbg_read() Michael Ellerman
                   ` (11 preceding siblings ...)
  2012-10-09 14:20 ` [PATCH 13/20] powerpc/xmon: Use start/end_bus_error_jump() in more routines Michael Ellerman
@ 2012-10-09 14:20 ` Michael Ellerman
  2012-10-09 14:20 ` [PATCH 15/20] powerpc/xmon: Deindent stop/restart_spus() Michael Ellerman
                   ` (5 subsequent siblings)
  18 siblings, 0 replies; 25+ messages in thread
From: Michael Ellerman @ 2012-10-09 14:20 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Paul Mackerras, Anton Blanchard

read_spr() and write_spr() were both forgetting to clear catch_memory_errors,
that's fixed now that they use start/end_bus_error_jump().

Also drop the setting of n in both routines, it's never used.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
 arch/powerpc/xmon/xmon.c |   22 ++++------------------
 1 file changed, 4 insertions(+), 18 deletions(-)

diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index ddae5cf..a8188f0 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -1599,16 +1599,9 @@ read_spr(int n)
 	store_inst(instrs);
 	store_inst(instrs+1);
 
-	if (setjmp(bus_error_jmp) == 0) {
-		catch_memory_errors = 1;
-		sync();
-
+	if (start_bus_error_jump() == 0) {
 		ret = code();
-
-		sync();
-		/* wait a little while to see if we get a machine check */
-		__delay(200);
-		n = size;
+		end_bus_error_jump();
 	}
 
 	return ret;
@@ -1635,16 +1628,9 @@ write_spr(int n, unsigned long val)
 	store_inst(instrs);
 	store_inst(instrs+1);
 
-	if (setjmp(bus_error_jmp) == 0) {
-		catch_memory_errors = 1;
-		sync();
-
+	if (start_bus_error_jump() == 0) {
 		code(val);
-
-		sync();
-		/* wait a little while to see if we get a machine check */
-		__delay(200);
-		n = size;
+		end_bus_error_jump();
 	}
 }
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 15/20] powerpc/xmon: Deindent stop/restart_spus()
  2012-10-09 14:20 [PATCH 01/20] powerpc/udbg: Remove unused udbg_read() Michael Ellerman
                   ` (12 preceding siblings ...)
  2012-10-09 14:20 ` [PATCH 14/20] powerpc/xmon: Convert read/write_spr() to use start_bus_error_jump() Michael Ellerman
@ 2012-10-09 14:20 ` Michael Ellerman
  2012-10-09 14:20 ` [PATCH 16/20] powerpc/xmon: Use start_bus_error_jump() in spu routines Michael Ellerman
                   ` (4 subsequent siblings)
  18 siblings, 0 replies; 25+ messages in thread
From: Michael Ellerman @ 2012-10-09 14:20 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Paul Mackerras, Anton Blanchard

Should be no logic change, use continue to avoid an indent.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
 arch/powerpc/xmon/xmon.c |   72 ++++++++++++++++++++++++----------------------
 1 file changed, 38 insertions(+), 34 deletions(-)

diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index a8188f0..0fefe03 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -2994,33 +2994,35 @@ static void stop_spus(void)
 		if (!spu_info[i].spu)
 			continue;
 
-		if (setjmp(bus_error_jmp) == 0) {
-			catch_memory_errors = 1;
-			sync();
+		if (setjmp(bus_error_jmp) != 0) {
+			catch_memory_errors = 0;
+			printf("*** Error stopping spu %.2d\n", i);
+			continue;
+		}
 
-			spu = spu_info[i].spu;
+		catch_memory_errors = 1;
+		sync();
 
-			spu_info[i].saved_spu_runcntl_RW =
-				in_be32(&spu->problem->spu_runcntl_RW);
+		spu = spu_info[i].spu;
 
-			tmp = spu_mfc_sr1_get(spu);
-			spu_info[i].saved_mfc_sr1_RW = tmp;
+		spu_info[i].saved_spu_runcntl_RW =
+			in_be32(&spu->problem->spu_runcntl_RW);
 
-			tmp &= ~MFC_STATE1_MASTER_RUN_CONTROL_MASK;
-			spu_mfc_sr1_set(spu, tmp);
+		tmp = spu_mfc_sr1_get(spu);
+		spu_info[i].saved_mfc_sr1_RW = tmp;
 
-			sync();
-			__delay(200);
+		tmp &= ~MFC_STATE1_MASTER_RUN_CONTROL_MASK;
+		spu_mfc_sr1_set(spu, tmp);
 
-			spu_info[i].stopped_ok = 1;
+		sync();
+		__delay(200);
+
+		spu_info[i].stopped_ok = 1;
+
+		printf("Stopped spu %.2d (was %s)\n", i,
+				spu_info[i].saved_spu_runcntl_RW ?
+				"running" : "stopped");
 
-			printf("Stopped spu %.2d (was %s)\n", i,
-					spu_info[i].saved_spu_runcntl_RW ?
-					"running" : "stopped");
-		} else {
-			catch_memory_errors = 0;
-			printf("*** Error stopping spu %.2d\n", i);
-		}
 		catch_memory_errors = 0;
 	}
 }
@@ -3040,23 +3042,25 @@ static void restart_spus(void)
 			continue;
 		}
 
-		if (setjmp(bus_error_jmp) == 0) {
-			catch_memory_errors = 1;
-			sync();
-
-			spu = spu_info[i].spu;
-			spu_mfc_sr1_set(spu, spu_info[i].saved_mfc_sr1_RW);
-			out_be32(&spu->problem->spu_runcntl_RW,
-					spu_info[i].saved_spu_runcntl_RW);
-
-			sync();
-			__delay(200);
-
-			printf("Restarted spu %.2d\n", i);
-		} else {
+		if (setjmp(bus_error_jmp) != 0) {
 			catch_memory_errors = 0;
 			printf("*** Error restarting spu %.2d\n", i);
+			continue;
 		}
+
+		catch_memory_errors = 1;
+		sync();
+
+		spu = spu_info[i].spu;
+		spu_mfc_sr1_set(spu, spu_info[i].saved_mfc_sr1_RW);
+		out_be32(&spu->problem->spu_runcntl_RW,
+				spu_info[i].saved_spu_runcntl_RW);
+
+		sync();
+		__delay(200);
+
+		printf("Restarted spu %.2d\n", i);
+
 		catch_memory_errors = 0;
 	}
 }
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 16/20] powerpc/xmon: Use start_bus_error_jump() in spu routines
  2012-10-09 14:20 [PATCH 01/20] powerpc/udbg: Remove unused udbg_read() Michael Ellerman
                   ` (13 preceding siblings ...)
  2012-10-09 14:20 ` [PATCH 15/20] powerpc/xmon: Deindent stop/restart_spus() Michael Ellerman
@ 2012-10-09 14:20 ` Michael Ellerman
  2012-10-09 14:20 ` [PATCH 17/20] powerpc/xmon: Make less variables global Michael Ellerman
                   ` (3 subsequent siblings)
  18 siblings, 0 replies; 25+ messages in thread
From: Michael Ellerman @ 2012-10-09 14:20 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Paul Mackerras, Anton Blanchard

Moves the printfs & setting of stopped_ok out of the protected area.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
 arch/powerpc/xmon/xmon.c |   22 ++++------------------
 1 file changed, 4 insertions(+), 18 deletions(-)

diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index 0fefe03..abc89a4 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -2994,15 +2994,11 @@ static void stop_spus(void)
 		if (!spu_info[i].spu)
 			continue;
 
-		if (setjmp(bus_error_jmp) != 0) {
-			catch_memory_errors = 0;
+		if (start_bus_error_jump() != 0) {
 			printf("*** Error stopping spu %.2d\n", i);
 			continue;
 		}
 
-		catch_memory_errors = 1;
-		sync();
-
 		spu = spu_info[i].spu;
 
 		spu_info[i].saved_spu_runcntl_RW =
@@ -3014,16 +3010,13 @@ static void stop_spus(void)
 		tmp &= ~MFC_STATE1_MASTER_RUN_CONTROL_MASK;
 		spu_mfc_sr1_set(spu, tmp);
 
-		sync();
-		__delay(200);
+		end_bus_error_jump();
 
 		spu_info[i].stopped_ok = 1;
 
 		printf("Stopped spu %.2d (was %s)\n", i,
 				spu_info[i].saved_spu_runcntl_RW ?
 				"running" : "stopped");
-
-		catch_memory_errors = 0;
 	}
 }
 
@@ -3042,26 +3035,19 @@ static void restart_spus(void)
 			continue;
 		}
 
-		if (setjmp(bus_error_jmp) != 0) {
-			catch_memory_errors = 0;
+		if (start_bus_error_jump() != 0) {
 			printf("*** Error restarting spu %.2d\n", i);
 			continue;
 		}
 
-		catch_memory_errors = 1;
-		sync();
-
 		spu = spu_info[i].spu;
 		spu_mfc_sr1_set(spu, spu_info[i].saved_mfc_sr1_RW);
 		out_be32(&spu->problem->spu_runcntl_RW,
 				spu_info[i].saved_spu_runcntl_RW);
 
-		sync();
-		__delay(200);
+		end_bus_error_jump();
 
 		printf("Restarted spu %.2d\n", i);
-
-		catch_memory_errors = 0;
 	}
 }
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 17/20] powerpc/xmon: Make less variables global
  2012-10-09 14:20 [PATCH 01/20] powerpc/udbg: Remove unused udbg_read() Michael Ellerman
                   ` (14 preceding siblings ...)
  2012-10-09 14:20 ` [PATCH 16/20] powerpc/xmon: Use start_bus_error_jump() in spu routines Michael Ellerman
@ 2012-10-09 14:20 ` Michael Ellerman
  2012-10-09 14:20 ` [PATCH 18/20] powerpc/xmon: Use kallsyms_lookup_size_offset() in get_function_bounds() Michael Ellerman
                   ` (2 subsequent siblings)
  18 siblings, 0 replies; 25+ messages in thread
From: Michael Ellerman @ 2012-10-09 14:20 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Paul Mackerras, Anton Blanchard

Move a number of variables into their only user, reducing some of the
global variable clutter. They remain static, so their behaviour across
calls is unchanged.

Also use ARRAY_SIZE for regnames in scanhex().

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
 arch/powerpc/xmon/xmon.c |   46 +++++++++++++++++++++-------------------------
 1 file changed, 21 insertions(+), 25 deletions(-)

diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index abc89a4..c6cd027 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -64,11 +64,7 @@ static int xmon_gate;
 static unsigned long in_xmon __read_mostly = 0;
 
 static unsigned long adrs;
-static int size = 1;
 #define MAX_DUMP (128 * 1024)
-static unsigned long ndump = 64;
-static unsigned long nidump = 16;
-static unsigned long ncsum = 4096;
 static int termch;
 static char tmpstr[128];
 
@@ -1109,6 +1105,7 @@ static unsigned short fcstab[256] = {
 static void
 csum(void)
 {
+	static unsigned long ncsum = 4096;
 	unsigned int i;
 	unsigned short fcs;
 	unsigned char v;
@@ -1634,12 +1631,12 @@ write_spr(int n, unsigned long val)
 	}
 }
 
-static unsigned long regno;
 extern char exc_prolog;
 extern char dec_exc;
 
 static void super_regs(void)
 {
+	static unsigned long regno;
 	int cmd;
 	unsigned long val;
 
@@ -1768,9 +1765,6 @@ byterev(unsigned char *val, int size)
 	}
 }
 
-static int brev;
-static int mnoread;
-
 static char *memex_help_string =
     "Memory examine command usage:\n"
     "m [addr] [flags] examine/change memory\n"
@@ -1811,6 +1805,7 @@ static char *memex_subcmd_help_string =
 static void
 memex(void)
 {
+	static int mnoread, brev, size = 1;
 	int cmd, inc, i, nslash;
 	unsigned long n;
 	unsigned char val[16];
@@ -2087,6 +2082,8 @@ static void dump_pacas(void)
 static void
 dump(void)
 {
+	static unsigned long ndump = 64;
+	static unsigned long nidump = 16;
 	int c;
 
 	c = inchar();
@@ -2253,12 +2250,13 @@ dump_log_buf(void)
 static unsigned long mdest;		/* destination address */
 static unsigned long msrc;		/* source address */
 static unsigned long mval;		/* byte value to set memory to */
-static unsigned long mcount;		/* # bytes to affect */
-static unsigned long mdiffs;		/* max # differences to print */
 
 static void
 memops(int cmd)
 {
+	static unsigned long mcount;		/* # bytes to affect */
+	static unsigned long mdiffs;		/* max # differences to print */
+
 	scanhex((void *)&mdest);
 	if( termch != '\n' )
 		termch = 0;
@@ -2297,12 +2295,12 @@ memdiffs(unsigned char *p1, unsigned char *p2, unsigned nb, unsigned maxpr)
 		printf("Total of %d differences\n", prt);
 }
 
-static unsigned mend;
-static unsigned mask;
-
 static void
 memlocate(void)
 {
+	static unsigned mend;
+	static unsigned mask;
+
 	unsigned a, n;
 	unsigned char val[4];
 
@@ -2330,12 +2328,11 @@ memlocate(void)
 	}
 }
 
-static unsigned long mskip = 0x1000;
-static unsigned long mlim = 0xffffffff;
-
 static void
 memzcan(void)
 {
+	static unsigned long mskip = 0x1000;
+	static unsigned long mlim = 0xffffffff;
 	unsigned char v;
 	unsigned a;
 	int ok, ook;
@@ -2409,8 +2406,10 @@ skipbl(void)
 	return c;
 }
 
-#define N_PTREGS	44
-static char *regnames[N_PTREGS] = {
+int
+scanhex(unsigned long *vp)
+{
+	static char *regnames[] = {
 	"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
 	"r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
 	"r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23",
@@ -2422,11 +2421,7 @@ static char *regnames[N_PTREGS] = {
 	"mq",
 #endif
 	"trap", "dar", "dsisr", "res"
-};
-
-int
-scanhex(unsigned long *vp)
-{
+	};
 	int c, d;
 	unsigned long v;
 
@@ -2445,7 +2440,7 @@ scanhex(unsigned long *vp)
 			regname[i] = c;
 		}
 		regname[i] = 0;
-		for (i = 0; i < N_PTREGS; ++i) {
+		for (i = 0; i < ARRAY_SIZE(regnames); ++i) {
 			if (strcmp(regnames[i], regname) == 0) {
 				if (xmon_regs == NULL) {
 					printf("regs not available\n");
@@ -2551,7 +2546,6 @@ getstring(char *s, int size)
 	*s = 0;
 }
 
-static char line[256];
 static char *lineptr;
 
 static void
@@ -2563,6 +2557,8 @@ flush_input(void)
 static int
 inchar(void)
 {
+	static char line[256];
+
 	if (lineptr == NULL || *lineptr == 0) {
 		if (xmon_gets(line, sizeof(line)) == NULL) {
 			lineptr = NULL;
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 18/20] powerpc/xmon: Use kallsyms_lookup_size_offset() in get_function_bounds()
  2012-10-09 14:20 [PATCH 01/20] powerpc/udbg: Remove unused udbg_read() Michael Ellerman
                   ` (15 preceding siblings ...)
  2012-10-09 14:20 ` [PATCH 17/20] powerpc/xmon: Make less variables global Michael Ellerman
@ 2012-10-09 14:20 ` Michael Ellerman
  2012-10-09 14:20 ` [PATCH 19/20] powerpc/xmon: Remove externs for non-existant routines Michael Ellerman
  2012-10-09 14:20 ` [PATCH 20/20] powerpc/xmon: Fallback to printk() in xmon_printf() if udbg is not setup Michael Ellerman
  18 siblings, 0 replies; 25+ messages in thread
From: Michael Ellerman @ 2012-10-09 14:20 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Paul Mackerras, Anton Blanchard

We throw away the name so we should use kallsyms_lookup_size_offset(),
which does what we need and nothing more.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
 arch/powerpc/xmon/xmon.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index c6cd027..9eb1d34 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -1313,15 +1313,13 @@ static void get_function_bounds(unsigned long pc, unsigned long *startp,
 				unsigned long *endp)
 {
 	unsigned long size, offset;
-	const char *name;
 
 	*startp = *endp = 0;
 	if (pc == 0)
 		return;
 
 	if (start_bus_error_jump() == 0) {
-		name = kallsyms_lookup(pc, &size, &offset, NULL, tmpstr);
-		if (name != NULL) {
+		if (kallsyms_lookup_size_offset(pc, &size, &offset)) {
 			*startp = pc - offset;
 			*endp = pc - offset + size;
 		}
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 19/20] powerpc/xmon: Remove externs for non-existant routines
  2012-10-09 14:20 [PATCH 01/20] powerpc/udbg: Remove unused udbg_read() Michael Ellerman
                   ` (16 preceding siblings ...)
  2012-10-09 14:20 ` [PATCH 18/20] powerpc/xmon: Use kallsyms_lookup_size_offset() in get_function_bounds() Michael Ellerman
@ 2012-10-09 14:20 ` Michael Ellerman
  2012-10-09 14:20 ` [PATCH 20/20] powerpc/xmon: Fallback to printk() in xmon_printf() if udbg is not setup Michael Ellerman
  18 siblings, 0 replies; 25+ messages in thread
From: Michael Ellerman @ 2012-10-09 14:20 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Paul Mackerras, Anton Blanchard

The implementation of both xmon_enter() & xmon_leave() was removed in
commit 51d3082 "Unify udbg (#2)".

I can't find any reference to exc_prolog or dec_exc since the epoch.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
 arch/powerpc/xmon/xmon.c |    6 ------
 1 file changed, 6 deletions(-)

diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index 9eb1d34..ded6c56 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -155,9 +155,6 @@ static void dump_tlb_book3e(void);
 
 static int xmon_no_auto_backtrace;
 
-extern void xmon_enter(void);
-extern void xmon_leave(void);
-
 #ifdef CONFIG_PPC64
 #define REG		"%.16lx"
 #else
@@ -1629,9 +1626,6 @@ write_spr(int n, unsigned long val)
 	}
 }
 
-extern char exc_prolog;
-extern char dec_exc;
-
 static void super_regs(void)
 {
 	static unsigned long regno;
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 20/20] powerpc/xmon: Fallback to printk() in xmon_printf() if udbg is not setup
  2012-10-09 14:20 [PATCH 01/20] powerpc/udbg: Remove unused udbg_read() Michael Ellerman
                   ` (17 preceding siblings ...)
  2012-10-09 14:20 ` [PATCH 19/20] powerpc/xmon: Remove externs for non-existant routines Michael Ellerman
@ 2012-10-09 14:20 ` Michael Ellerman
  18 siblings, 0 replies; 25+ messages in thread
From: Michael Ellerman @ 2012-10-09 14:20 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Paul Mackerras, Anton Blanchard

It is possible to configure a kernel which has xmon enabled, but has no
udbg backend to provide IO. This can make xmon rather confusing, as it
produces no output, blocks for two seconds, and then returns.

As a last resort we can instead try to printk(), which may deadlock or
otherwise crash, but tries quite hard not to.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
 arch/powerpc/xmon/nonstdio.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/xmon/nonstdio.c b/arch/powerpc/xmon/nonstdio.c
index 942d0f6..bce3dcf 100644
--- a/arch/powerpc/xmon/nonstdio.c
+++ b/arch/powerpc/xmon/nonstdio.c
@@ -111,13 +111,19 @@ char *xmon_gets(char *str, int nb)
 void xmon_printf(const char *format, ...)
 {
 	va_list args;
-	int n;
 	static char xmon_outbuf[1024];
+	int rc, n;
 
 	va_start(args, format);
 	n = vsnprintf(xmon_outbuf, sizeof(xmon_outbuf), format, args);
 	va_end(args);
-	xmon_write(xmon_outbuf, n);
+
+	rc = xmon_write(xmon_outbuf, n);
+
+	if (n && rc == 0) {
+		/* No udbg hooks, fallback to printk() - dangerous */
+		printk(xmon_outbuf);
+	}
 }
 
 void xmon_puts(const char *str)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* RE: [PATCH 06/20] powerpc/xmon: Remove renaming #defines of scanhex() and skipbl()
  2012-10-09 14:20 ` [PATCH 06/20] powerpc/xmon: Remove renaming #defines of scanhex() and skipbl() Michael Ellerman
@ 2012-10-09 14:59   ` David Laight
  2012-10-09 22:15   ` Paul Mackerras
  1 sibling, 0 replies; 25+ messages in thread
From: David Laight @ 2012-10-09 14:59 UTC (permalink / raw)
  To: Michael Ellerman, linuxppc-dev; +Cc: Paul Mackerras, Anton Blanchard

> We have two #defines that rename scanhex() and skipbl() to
> xmon_scanhex() and xmon_skipbl() - but no one ever uses those
> names.

It looks like they are there for namespace protection.

	David

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 06/20] powerpc/xmon: Remove renaming #defines of scanhex() and skipbl()
  2012-10-09 14:20 ` [PATCH 06/20] powerpc/xmon: Remove renaming #defines of scanhex() and skipbl() Michael Ellerman
  2012-10-09 14:59   ` David Laight
@ 2012-10-09 22:15   ` Paul Mackerras
  2012-10-10  1:00     ` Michael Ellerman
  1 sibling, 1 reply; 25+ messages in thread
From: Paul Mackerras @ 2012-10-09 22:15 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: linuxppc-dev, Anton Blanchard

On Wed, Oct 10, 2012 at 01:20:33AM +1100, Michael Ellerman wrote:
> We have two #defines that rename scanhex() and skipbl() to
> xmon_scanhex() and xmon_skipbl() - but no one ever uses those
> names.
> 
> So the only effect is to rename the actual symbols in the generated
> code, and AFACIS there is no reason to do that, so drop them.

You might as well make scanhex() and skipbl() static while you're at
it.

Paul.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 10/20] powerpc/xmon: Factor out the oft-repeated setjmp logic
  2012-10-09 14:20 ` [PATCH 10/20] powerpc/xmon: Factor out the oft-repeated setjmp logic Michael Ellerman
@ 2012-10-09 22:23   ` Paul Mackerras
  2012-10-10  0:59     ` Michael Ellerman
  0 siblings, 1 reply; 25+ messages in thread
From: Paul Mackerras @ 2012-10-09 22:23 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: linuxppc-dev, Anton Blanchard

On Wed, Oct 10, 2012 at 01:20:37AM +1100, Michael Ellerman wrote:
> We have over 15 routines that implement essentially the same logic
> in terms of catching faults. Pull the logic out into two helper
> routines.
> 
> The pattern becomes:
> 
> 	if (start_bus_error_jump() == 0) {
> 		<do potentially faulting things>
> 
> 		end_bus_error_jump();
> 	} else {
> 		printf("Faulting thing faulted!\n");
> 	}

NAK...  think about how setjmp() works.  You can't return from the
function that called setjmp() while there is any possibility that
longjmp() could be called for the same jmp_buf.

Paul.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 10/20] powerpc/xmon: Factor out the oft-repeated setjmp logic
  2012-10-09 22:23   ` Paul Mackerras
@ 2012-10-10  0:59     ` Michael Ellerman
  0 siblings, 0 replies; 25+ messages in thread
From: Michael Ellerman @ 2012-10-10  0:59 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev, Anton Blanchard

On Wed, 2012-10-10 at 09:23 +1100, Paul Mackerras wrote:
> On Wed, Oct 10, 2012 at 01:20:37AM +1100, Michael Ellerman wrote:
> > We have over 15 routines that implement essentially the same logic
> > in terms of catching faults. Pull the logic out into two helper
> > routines.
> > 
> > The pattern becomes:
> > 
> > 	if (start_bus_error_jump() == 0) {
> > 		<do potentially faulting things>
> > 
> > 		end_bus_error_jump();
> > 	} else {
> > 		printf("Faulting thing faulted!\n");
> > 	}
> 
> NAK...  think about how setjmp() works.  You can't return from the
> function that called setjmp() while there is any possibility that
> longjmp() could be called for the same jmp_buf.

Sigh, yeah. Somehow I'd convinced myself that it worked in this case,
but after a night's sleep I'm not sure what my logic was.

cheers

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 06/20] powerpc/xmon: Remove renaming #defines of scanhex() and skipbl()
  2012-10-09 22:15   ` Paul Mackerras
@ 2012-10-10  1:00     ` Michael Ellerman
  0 siblings, 0 replies; 25+ messages in thread
From: Michael Ellerman @ 2012-10-10  1:00 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev, Anton Blanchard

On Wed, 2012-10-10 at 09:15 +1100, Paul Mackerras wrote:
> On Wed, Oct 10, 2012 at 01:20:33AM +1100, Michael Ellerman wrote:
> > We have two #defines that rename scanhex() and skipbl() to
> > xmon_scanhex() and xmon_skipbl() - but no one ever uses those
> > names.
> > 
> > So the only effect is to rename the actual symbols in the generated
> > code, and AFACIS there is no reason to do that, so drop them.
> 
> You might as well make scanhex() and skipbl() static while you're at
> it.

Actually I was hoping to move the spu code that uses them into a
separate file, so I'll leave them for now.

cheers

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2012-10-10  1:00 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-09 14:20 [PATCH 01/20] powerpc/udbg: Remove unused udbg_read() Michael Ellerman
2012-10-09 14:20 ` [PATCH 02/20] powerpc/xmon: Remove unused xmon_expect() & xmon_read_poll() Michael Ellerman
2012-10-09 14:20 ` [PATCH 03/20] powerpc/xmon: Remove empty xmon_map_scc() Michael Ellerman
2012-10-09 14:20 ` [PATCH 04/20] powerpc/xmon: Make xmon_getchar() static Michael Ellerman
2012-10-09 14:20 ` [PATCH 05/20] powerpc/xmon: Merge start.c into nonstdio.c Michael Ellerman
2012-10-09 14:20 ` [PATCH 06/20] powerpc/xmon: Remove renaming #defines of scanhex() and skipbl() Michael Ellerman
2012-10-09 14:59   ` David Laight
2012-10-09 22:15   ` Paul Mackerras
2012-10-10  1:00     ` Michael Ellerman
2012-10-09 14:20 ` [PATCH 07/20] powerpc/xmon: Remove unused #defines Michael Ellerman
2012-10-09 14:20 ` [PATCH 08/20] powerpc/xmon: Use STACK_FRAME_OVERHEAD in xmon_show_stack() Michael Ellerman
2012-10-09 14:20 ` [PATCH 09/20] powerpc/xmon: Fiddle xmon_depth_to_print logic " Michael Ellerman
2012-10-09 14:20 ` [PATCH 10/20] powerpc/xmon: Factor out the oft-repeated setjmp logic Michael Ellerman
2012-10-09 22:23   ` Paul Mackerras
2012-10-10  0:59     ` Michael Ellerman
2012-10-09 14:20 ` [PATCH 11/20] powerpc/xmon: Move handle_fault() next to related routines Michael Ellerman
2012-10-09 14:20 ` [PATCH 12/20] powerpc/xmon: Do so simple conversions to start/end_bus_error_jump() Michael Ellerman
2012-10-09 14:20 ` [PATCH 13/20] powerpc/xmon: Use start/end_bus_error_jump() in more routines Michael Ellerman
2012-10-09 14:20 ` [PATCH 14/20] powerpc/xmon: Convert read/write_spr() to use start_bus_error_jump() Michael Ellerman
2012-10-09 14:20 ` [PATCH 15/20] powerpc/xmon: Deindent stop/restart_spus() Michael Ellerman
2012-10-09 14:20 ` [PATCH 16/20] powerpc/xmon: Use start_bus_error_jump() in spu routines Michael Ellerman
2012-10-09 14:20 ` [PATCH 17/20] powerpc/xmon: Make less variables global Michael Ellerman
2012-10-09 14:20 ` [PATCH 18/20] powerpc/xmon: Use kallsyms_lookup_size_offset() in get_function_bounds() Michael Ellerman
2012-10-09 14:20 ` [PATCH 19/20] powerpc/xmon: Remove externs for non-existant routines Michael Ellerman
2012-10-09 14:20 ` [PATCH 20/20] powerpc/xmon: Fallback to printk() in xmon_printf() if udbg is not setup Michael Ellerman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.