Skip to contentSkip to conversation

From: Andrew Morton <[email protected]>

PATCH Paul Mackerras 5 participants 9 messages Oct 3, 2006 3 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#2 lore raw
In reply to a message not in the archive
Quoted 8 lines · Jeremy Fitzhardinge

When my test machine hits a BUG, it simply returns from the exception handler after a second or so and reexecutes the bug.

This is independent of the use-generic-bug changes and might be related to XMON.

So it's some unknonw bug, and this change makes the powerpc kernel behave better when that bug hits.

NACK as to this part:

Review

Quoted 2 lines
(quoted diff) +2 -0
+			if (btt == BUG_TRAP_TYPE_BUG)
+				do_exit(SIGSEGV);

since it makes the kernel behave distinctly *worse* for me.

Paul.

#3 lore raw
Quoted 11 lines · On Tue, 3 Oct 2006 14:23:06 +1000 Paul Mackerras <[email protected]> wrote:
Quoted 8 lines · Jeremy Fitzhardinge

When my test machine hits a BUG, it simply returns from the exception handler after a second or so and reexecutes the bug.

This is independent of the use-generic-bug changes and might be related to XMON.

So it's some unknonw bug, and this change makes the powerpc kernel behave better when that bug hits.

Quoted 7 lines

NACK as to this part:

Review

Quoted 2 lines
(quoted diff) +2 -0
+			if (btt == BUG_TRAP_TYPE_BUG)
+				do_exit(SIGSEGV);

since it makes the kernel behave distinctly *worse* for me.

It makes it heaps better here.

Did you try my .config on the g5?

#4 lore raw
Quoted 1 line · Andrew Morton

It makes it heaps better here.

The patch below should fix it properly.

Quoted 1 line

Did you try my .config on the g5?

Not yet; I can't find your .config in my inbox - maybe I deleted that message by mistake. Resend?

Paul.

arch/powerpc/xmon/xmon.c +1 -1
index 8adad14..40e5e0d 100644
@@ -503,7 +503,7 @@ #endif
 
 	mtmsr(msr);		/* restore interrupt enable */
 
-	return cmd != 'X';
+	return cmd != 'X' && cmd != EOF;
 }
 
 int xmon(struct pt_regs *excp)
#5 lore raw

arch/powerpc/xmon/xmon.c #endif · line 509

Quoted 11 lines · On Tue, 3 Oct 2006 15:19:50 +1000 Paul Mackerras <[email protected]> wrote:
arch/powerpc/xmon/xmon.c +1 -1
@@ -503,7 +503,7 @@ #endif
 
 	mtmsr(msr);		/* restore interrupt enable */
 
-	return cmd != 'X';
+	return cmd != 'X' && cmd != EOF;
 }
 
 int xmon(struct pt_regs *excp)

That fixes it.

I still get crap all over the screen when xmon is tring to print something (at least, I assume that's what causes it). See
http://userweb.kernel.org/~akpm/s5000334.jpg

#6 lore raw
Quoted 3 lines · Andrew Morton

I still get crap all over the screen when xmon is tring to print something (at least, I assume that's what causes it). See
http://userweb.kernel.org/~akpm/s5000334.jpg

That is because the nvidia console driver has changed the line pitch from what the firmware set it to. This should fix it by making the nvidia driver inform the btext engine (which xmon uses if the screen is its output device) about changes to display resolution.

---

drivers/video/nvidia/nvidia.c +10 -0
index d4f8501..18b9101 100644
@@ -28,6 +28,9 @@ #ifdef CONFIG_PPC_OF
 #include <asm/prom.h>
 #include <asm/pci-bridge.h>
 #endif
+#ifdef CONFIG_BOOTX_TEXT
+#include <asm/btext.h>
+#endif
 
 #include "nv_local.h"
 #include "nv_type.h"
@@ -681,6 +684,13 @@ #endif
 
 	nvidia_vga_protect(par, 0);
 
+#ifdef CONFIG_BOOTX_TEXT
+	/* Update debug text engine */
+	btext_update_display(info->fix.smem_start,
+			     info->var.xres, info->var.yres,
+			     info->var.bits_per_pixel, info->fix.line_length);
+#endif
+
 	NVTRACE_LEAVE();
 	return 0;
 }
#7 lore raw
Quoted 22 lines · On Tue, 3 Oct 2006 16:55:52 +1000 Paul Mackerras <[email protected]> wrote:

That is because the nvidia console driver has changed the line pitch from what the firmware set it to. This should fix it by making the nvidia driver inform the btext engine (which xmon uses if the screen is its output device) about changes to display resolution.

---

drivers/video/nvidia/nvidia.c +3 -0
index d4f8501..18b9101 100644
@@ -28,6 +28,9 @@ #ifdef CONFIG_PPC_OF
 #include <asm/prom.h>
 #include <asm/pci-bridge.h>
 #endif
+#ifdef CONFIG_BOOTX_TEXT
+#include <asm/btext.h>
+#endif
 
 #include "nv_local.h"
 #include "nv_type.h"

drivers/video/nvidia/nvidia.c #endif · line 692

Quoted 9 lines
drivers/video/nvidia/nvidia.c +6 -0
@@ -681,6 +684,13 @@ #endif
 
 	nvidia_vga_protect(par, 0);
 
+#ifdef CONFIG_BOOTX_TEXT
+	/* Update debug text engine */
+	btext_update_display(info->fix.smem_start,
+			     info->var.xres, info->var.yres,
+			     info->var.bits_per_pixel, info->fix.line_length);
+#endif

yup, that fixed it. xmon apparently doesn't know where fbcon's output cursor is, but the characters are now readable.

#8 lore raw
Quoted 3 lines

yup, that fixed it. xmon apparently doesn't know where fbcon's output cursor is, but the characters are now readable.

The low level text engine used by xmon (and my some early console/debug stuff on powerpc as well) really doesn't have any link to fbcon... doing that would be hard and ugly and take the risk of making it fragile, which isn't what we want to do... usually, when you fall into xmon, you don't care about your console cursor :) (In fact, that stuff can even blast on top of X if the later has the UseFBDev option).

Ben.

#10 lore raw

Re: [PATCH 1/6] Generic implemenatation of BUG.

In reply to a message not in the archive
Quoted 3 lines

Because powerpc also records the function name, I added this to i386 and x86-64 for consistency. Strictly speaking the function name is redundant with kallsyms, so perhaps it can be dropped from powerpc.

It would be good to change it to use kallsyms() then.

Review

Quoted 11 lines

#ifdef CONFIG_BUG

(quoted diff) +9 -0
+
+#ifdef CONFIG_GENERIC_BUG
+struct bug_entry {
+	unsigned long	bug_addr;
+#ifdef CONFIG_DEBUG_BUGVERBOSE
+	const char	*file;
+	unsigned short	line;
+#endif
+	unsigned short	flags;

Can't you put the flags into the high bits of the line? I don't think we have any 64kLOC files.

-Andi

#11 lore raw

Re: [PATCH 1/6] Generic implemenatation of BUG.

Quoted 7 lines · Andi Kleen
Quoted 4 lines

Because powerpc also records the function name, I added this to i386 and x86-64 for consistency. Strictly speaking the function name is redundant with kallsyms, so perhaps it can be dropped from powerpc.

It would be good to change it to use kallsyms() then.

It does, in effect, when it prints the oops message and backtrace.

Quoted 15 lines

Review

Quoted 12 lines

#ifdef CONFIG_BUG

(quoted diff) +9 -0
+
+#ifdef CONFIG_GENERIC_BUG
+struct bug_entry {
+	unsigned long	bug_addr;
+#ifdef CONFIG_DEBUG_BUGVERBOSE
+	const char	*file;
+	unsigned short	line;
+#endif
+	unsigned short	flags;

Can't you put the flags into the high bits of the line? I don't think we have any 64kLOC files.

I thought about it, but it would still be padded out to 12 bytes on i386, and more on 64-bit platforms. And it doesn't matter that much.

J