Thanks Daniel for reply.

On 01/07/15 10:01, Prafull Suryawanshi wrote:
>> Hi,
>>
>>Anyone can point me what function of KGDB code gets called when
>>hardware watchpoint or breakpoint hits.
>>I earlier asked question about aarch64 hardware watchpoint but I think
>> this is proper question.

>You mean how does the arm64 specific trap handling code actually enter
>kgdb? It calls kgdb_handle_exception.

ok. In my case, this is not getting called. I am not sure how aarch64
triggers this exception though.

>For software breakpoint and single step exceptions the code in
>arch/arm64/kernel/debug-monitors.c calls into kgdb from hooks registered
>using register_step_hook() and register_break_hook().

Are you suggesting that we might need to add hook here for hw
watchpoint handler?

>Hardware breakpoints and watchpoint are handled by
>arch/arm64/kernel/hw_breakpoint.c . You have extended this code?

Not actually. I extended code in arch/arm64/kernel/kgdb.c. I
implemented the arch_kgdb_ops for set_hw_breakpoint and siblings.
It is similar like how x86 handled.
In case of x86, arch_kgdb_ops.*hw*break* related functions calls from
kgdb.c to hw_breakpoint.c.
So I have implemented in similar fashion.

>> I have implemented support for aarch64 and can see one CPU halt on the
>> code where watchpoint being getting written.

>If you have not entered kgdb by calling kgdb_handle_exception() I think
>this is expected. When kgdb enters it will automatically generate IPIs
>to get the other CPUs to halt.

That might explain the situation I am facing. By the way there is hook
handler already in arch/arm64/kernel/hw_breakpoint.c in
arch_hw_breakpoint_init which is watchpoint_handler.
I checked it but this also does not get called.

As we can set hardware watchpoint in usermode on aarch64 which goes
through ptrace->arch/arm64/kernel/hw_breakpoint.c. So there must be
getting some callback called when watchpoint being hit.
I was hoping similar would work in kgdb case as well.

So far, I verified that one of CPU halts at watchpoint update code and
other 3 are loops in cpu-idle.
Any suggestion how to proceed will really help here.

>Daniel.

Thanks Prafull.

On Wed, Jul 1, 2015 at 3:06 PM, Daniel Thompson
<daniel.thomp...@linaro.org> wrote:
> On 01/07/15 10:01, Prafull Suryawanshi wrote:
>> Hi,
>>
>> Anyone can point me what function of KGDB code gets called when
>> hardware watchpoint or breakpoint hits.
>> I earlier asked question about aarch64 hardware watchpoint but I think
>> this is proper question.
>
> You mean how does the arm64 specific trap handling code actually enter
> kgdb? It calls kgdb_handle_exception.
>
> For software breakpoint and single step exceptions the code in
> arch/arm64/kernel/debug-monitors.c calls into kgdb from hooks registered
> using register_step_hook() and register_break_hook().
>
> Hardware breakpoints and watchpoint are handled by
> arch/arm64/kernel/hw_breakpoint.c . You have extended this code?
>
>
>> I have implemented support for aarch64 and can see one CPU halt on the
>> code where watchpoint being getting written.
>
> If you have not entered kgdb by calling kgdb_handle_exception() I think
> this is expected. When kgdb enters it will automatically generate IPIs
> to get the other CPUs to halt.
>
>
> Daniel.
>
>
> ------------------------------------------------------------------------------
> Don't Limit Your Business. Reach for the Cloud.
> GigeNET's Cloud Solutions provide you with the tools and support that
> you need to offload your IT needs and focus on growing your business.
> Configured For All Businesses. Start Your Cloud Today.
> https://www.gigenetcloud.com/
> _______________________________________________
> Kgdb-bugreport mailing list
> Kgdb-bugreport@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/kgdb-bugreport

------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Kgdb-bugreport mailing list
Kgdb-bugreport@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kgdb-bugreport

Reply via email to