ARM A76 watchpoint does not work, after correctly configuring the register

76 Views Asked by At

I want to monitor a specified address on an ARM A76 machine and enter an exception when the address is loaded from. However, I did the configuration and did not get the exception.

My process is as follows:

  1. Set MDSCR_EL1.KDE and MDSCR_EL1.MDE to 1 to enable debug exception in EL1.
  2. Configure the OSLAR_EL1 register to unlocked.
  3. Configure DBGWVR0_EL1 and DBGWCR0_EL1, and make sure store instruction (LSC == 0b10) to the address in DBGWVR0_EL1 will trap.

I use mrs Instruction to read the relevant register, but can not find the reason. My machine as follows:

  1. ARM A76+Threadx Rtos
  2. The exception to running the program is EL1.
    Register print as follows:
    DAIF: 0x0
    OSLSR_EL1: 0x8
    CurrentEL: 0x4
    MDSCR_EL1: 0xa000
    DBGWVR0_EL1: 0xd021b600
    DBGWCR0_EL1: 0xf9

I configured MDSCR_EL1.SS to 1, and the CPU entered an exception.

1

There are 1 best solutions below

0
On

You set DBGWCR0_EL1.PAC to 0b00, which selects neither EL1 nor EL0. Set it to 0b01 for EL1, 0b10 for EL0, or 0b11 for both (see "Table D2-13 Summary of watchpoint HMC, SSC, and PAC encodings" in the manual for a complete overview).

So if you want your watchpoint to only hit at EL1, set DBGWCR0_EL1 to 0xfb.