Commit 7a2ff14b authored by Atul Khare's avatar Atul Khare
Browse files

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: default avatarAtul Khare <atulkhare@rivosinc.com>
parent bb631e66
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment