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

ARMv8 AArch64: trapping hardware breakpoint to EL2

Hi everyone!

I want to set and then trap EL1 hardware breakpoints to EL2. I didn't perfectly understand if such an action is possible at all. In some places the documentation said that MDCR_EL2.TDE enables *Software Breakpoints* trapping to EL2, but on other places it showed that Hardware Breakpoints were part of the exceptions being trapped as well.
Anyway, to achieve that, I 've done the following:

* Enabling and setting EL1 hardware breakpoint:
MDSCR_EL1 = MDE | KDE
PSTATE.D = 0
DBGBCR_EL1 = E | HMC | PMC.EL2
DBGBVR_EL1[48:2] = <instruction_address_to_catch>[48:2]

* Enabling trapping of breakpoints to EL2
MDCR_EL2 = TDE

When testing it, I can see that EL1 registers accesses are trapped to EL2, but there doesn't seem to be any hardware breakpoint exception when the desired address is executed - so I guess I'm configuring my breakpoint wrong. But I can't seem to find how...

Can somebody shed some light?
Thank you!