Re: [PATCH] perf,hw_breakpoint: Initialize hardware api earlier

From: Frederic Weisbecker
Date: Fri Nov 05 2010 - 11:17:15 EST


2010/11/4 Jason Wessel <jason.wessel@xxxxxxxxxxxxx>:
>
> Hi Frederic,
>
> Per our conversation, here is a possible patch to fix the early
> debugging.  It might be the case that you can kill off the return code
> from the init_hw_breakpoint(), or at least do something with it.  It
> was not obvious to me what you might want to emit for a mess or act on
> if the initialization fails.



Ok, we can kill the return code from it, but we need to keep some
warnings in case
of failure.


>
>
> Thanks,
> Jason.
>
>
> --
> From 7c425dba3a4522343faf3519f3d0e99e2e55f30c Mon Sep 17 00:00:00 2001
> From: Jason Wessel <jason.wessel@xxxxxxxxxxxxx>
> Date: Thu, 4 Nov 2010 17:33:01 -0500
> Subject: [PATCH] perf,hw_breakpoint: Initialize hardware api earlier
>
> When using early debugging, the kernel does not initialize the
> hw_breakpoint API early enough and causes the late initialization of
> the kernel debugger to fail. The boot arguments are:
>
>    earlyprintk=vga ekgdboc=kbd kgdbwait
>
> Then simply type "go" at the kdb prompt and boot. The kernel will
> later emit the message:
>
>    kgdb: Could not allocate hwbreakpoints
>
> And at that point the kernel debugger will cease to work correctly.
>
> The solution is to initialize the hw_breakpoint at the same time that
> all the other perf call backs are initialized instead of using a
> core_initcall() initialization which happens well after the kernel
> debugger can make use of hardware breakpoints.
>
> Signed-off-by: Jason Wessel <jason.wessel@xxxxxxxxxxxxx>
> CC: Frederic Weisbecker <fweisbec@xxxxxxxxx>
> CC: Ingo Molnar <mingo@xxxxxxx>
> CC: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
> ---


For the rest, it looks good.

Thanks!
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/