[Cbe-oss-dev] Hardware watchpoints cause kernel hang

Arnd Bergmann arnd at arndb.de
Fri Feb 16 06:53:14 EST 2007


On Thursday 15 February 2007 19:39, Paul_Rasmussen at playstation.sony.com wrote:
> Benjamin Herrenschmidt wrote:
> 
> >On Tue, 2007-02-13 at 13:12 -0800, Paul_Rasmussen at playstation.sony.com
> >wrote:
> >  
> >
> >>I have discovered that setting a hardware watchpoint in PPE code with 
> >>ptrace(PTRACE_SET_DEBUGREG, tid, 0, 6) for example and then continuing 
> >>the program causes our current version of the cell-linux OS to hang (its 
> >>a complete hang, not a panic and is repeatable every time).  Is this 
> >>something that someone could take a look at?  If there's any more 
> >>information you would like about this, please let me know.

I tried this on my QS20 cell blade, but the version of gdb that comes
with fedora core 7 apparently doesn't use PTRACE_SET_DEBUGREG, so it
did not hang.

However, looking at the kernel code, I found that the celleb platform
provides an implementation of ppc_md.set_dabr() using an hcall, while
the ps3 platform doesn't.

While this is only a wild guess, I would think that your problem might
get solved by the untested patch below.

	Arnd <><
---

[PATCH] ps3: add set_dabr function

The lv1 hypervisor silently kills the partition if the kernel attempts
to access the dabr register directly. Instead, it needs to be set using
an hcall. Since both pseries and celleb have the same function, the guess
is that the implementation on ps3 is also the same.

Signed-off-by: Arnd Bergmann <arnd.bergmann at de.ibm.com>

--- a/arch/powerpc/platforms/ps3/setup.c
+++ b/arch/powerpc/platforms/ps3/setup.c
@@ -120,6 +120,16 @@ early_param("ps3fb", early_parse_ps3fb);
 #define prealloc_ps3fb_videomemory()	do { } while (0)
 #endif
 
+static int ps3_set_dabr(unsigned long dabr)
+{
+	enum {
+		DABR_KERNEL = 2,
+		DABR_USER = 1,
+	};
+	if (lv1_set_dabr(dabr, DABR_KERNEL | DABR_USER))
+		return -1;
+	return 0;
+}
 
 static void __init ps3_setup_arch(void)
 {
@@ -217,6 +227,7 @@ define_machine(ps3) {
 	.get_boot_time			= ps3_get_boot_time,
 	.set_rtc_time			= ps3_set_rtc_time,
 	.get_rtc_time			= ps3_get_rtc_time,
+	.set_dabr			= ps3_set_dabr,
 	.calibrate_decr			= ps3_calibrate_decr,
 	.progress			= ps3_progress,
 #if defined(CONFIG_KEXEC)



More information about the cbe-oss-dev mailing list