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:
- Set
MDSCR_EL1.KDE
andMDSCR_EL1.MDE
to1
to enable debug exception in EL1. - Configure the
OSLAR_EL1
register to unlocked. - Configure
DBGWVR0_EL1
andDBGWCR0_EL1
, and make sure store instruction (LSC == 0b10) to the address inDBGWVR0_EL1
will trap.
I use mrs Instruction to read the relevant register, but can not find the reason. My machine as follows:
- ARM A76+Threadx Rtos
- 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.
You set
DBGWCR0_EL1.PAC
to0b00
, which selects neither EL1 nor EL0. Set it to0b01
for EL1,0b10
for EL0, or0b11
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
to0xfb
.