This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

About watch point debug excption on Cortex-A53

Now we are researching watch point function on A53. We simply write a driver, hook debug exception handler aml_watchpoint_handler instead of default watch point handler.

In our watch point handler, we first disabled watch point control, then handle debug exception, after handler finished, we re-enable this watch point control and exit exception.

Theoretically when we trigger a watch point event once, watch point exception should taken once. but we found if we re-enable watch point at the end of handler, A53 CPU re-entered this exception again and again and this event will last a long time, some times it will not end. If we don't re-enable watch point in exception handler but re-enable it in a work_struct after a short time sleeping(1ms is enough), then this exception can only take once. But this method may cause lost of watch point event during disable period.

We don't know the detailed behavior of watch point exception and why watch point exception will enter again and again and how to exit watch point handler safely. Who can help us for this issue?

Parents
  • Watchpoints are synchronous and precise on ARMv8, which means they are taken in the same way as an MMU fault, *before* the access is visible to the memory system. If you just return from the watchpoint handler, it will return to re-execute the instruction that triggered the watchpoint, and naturally trigger it again.

    The normal way to deal with this is:

    * Disable the watchpoint.

    * Single step the instruction (using Software Step exception).

    * Re-enable the watchpoint.

Reply
  • Watchpoints are synchronous and precise on ARMv8, which means they are taken in the same way as an MMU fault, *before* the access is visible to the memory system. If you just return from the watchpoint handler, it will return to re-execute the instruction that triggered the watchpoint, and naturally trigger it again.

    The normal way to deal with this is:

    * Disable the watchpoint.

    * Single step the instruction (using Software Step exception).

    * Re-enable the watchpoint.

Children