[Cbe-oss-dev] Hardware watchpoints cause kernel hang
Geoff Levand
geoffrey.levand at am.sony.com
Fri Feb 16 11:09:04 EST 2007
Arnd Bergmann wrote:
> 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;
> +}
The args are:
s64 lv1_set_dabr(u64 dabr, u64 dabrx);
Good luck. I don't plan to do anything with this.
More information about the cbe-oss-dev
mailing list