diff options
author | Atul Khare <atulkhare@rivosinc.com> | 2023-05-16 15:11:44 -0700 |
---|---|---|
committer | Atul Khare <atulkhare@rivosinc.com> | 2023-05-17 13:04:14 -0700 |
commit | 7a2ff14bff461f2c7adfbf407e11527f55d920db (patch) | |
tree | 27100973d65ac99e8d76b20413c513156cef455c /riscv/insns/dret.h | |
parent | bb631e660fcb5ad4836b1f7c33db5c0a903272c1 (diff) | |
download | spike-7a2ff14bff461f2c7adfbf407e11527f55d920db.zip spike-7a2ff14bff461f2c7adfbf407e11527f55d920db.tar.gz spike-7a2ff14bff461f2c7adfbf407e11527f55d920db.tar.bz2 |
triggers: Fix etrigger match on exceptions
The etrigger match on exceptions doesn't work properly in cases like
the following:
1) M-mode delegates ECALLs to S-mode
2) A CPU hardware point mechanism is used to place a breakpoint on the
Umode instruction that executes the ECALL from Umode to Smode. In
effect, this creates a breakpoint etrigger based on Umode.
In the above, the expectation is that #2 will first cause an exit to
the Smode handler (stvec), and the hardware breakpoint exception will
be triggered following an entry into the handler.
However, since etrigger currently checks the current privilege mode, we
will never get a match on conditions like #2.
The patch attempts to address the issue by using the stashed version of
the previous privilege mode for the etrigger match.
cc: YenHaoChen <howard25336284@gmail.com>
Signed-off-by: Atul Khare <atulkhare@rivosinc.com>
Diffstat (limited to 'riscv/insns/dret.h')
0 files changed, 0 insertions, 0 deletions