Skip to content

Commit

Permalink
AR: tcontrol.mie applies to all traps, not just breakpoints
Browse files Browse the repository at this point in the history
Reverts #723, which would result in mepc etc. being clobbered if a
breakpoint trigger would fire in the most privileged mode.

Specifically, consider:
1. icount is set so that it'll trigger on the first instruction of an exception handler.
2. Code takes an exception, saving mepc etc.
3. Now icount fires causing a breakpoint exception, clobbering mepc.
  • Loading branch information
timsifive committed Sep 19, 2023
1 parent f546ddf commit 5ddb7fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions introduction.tex
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@ \subsubsection{Incompatible Changes During 1.0 Stable}
command is available as argument to the next abstract command. \PR{728}
\item It may not be possible to read the contents of the Program Buffer using
the {\tt progbuf} registers. \PR{731}
\item \RcsrTcontrol fields apply to all traps, not just breakpoint traps. This
reverts \PR{723}. \PR{TODO}
\end{steps}

\section{About This Document}
Expand Down
4 changes: 2 additions & 2 deletions xml/hwbp_registers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@
regarding triggers with action=0 firing in M-mode trap handlers. See
Section~\ref{sec:nativetrigger} for more details.

When a breakpoint trap into M-mode is taken, \FcsrTcontrolMpte is set to the value of
When any trap into M-mode is taken, \FcsrTcontrolMpte is set to the value of
\FcsrTcontrolMte.
</field>
<field name="0" bits="6:4" access="R" reset="0" />
Expand All @@ -211,7 +211,7 @@
Triggers do match/fire while the hart is in M-mode.
</value>

When a breakpoint trap into M-mode is taken, \FcsrTcontrolMte is set to 0. When {\tt
When any trap into M-mode is taken, \FcsrTcontrolMte is set to 0. When {\tt
mret} is executed, \FcsrTcontrolMte is set to the value of \FcsrTcontrolMpte.
</field>
<field name="0" bits="2:0" access="R" reset="0" />
Expand Down

0 comments on commit 5ddb7fe

Please sign in to comment.