From 51fc0955d4893142cba6e3e183c0207fa230146f Mon Sep 17 00:00:00 2001 From: Tim Newsome Date: Tue, 19 Sep 2023 16:44:40 -0700 Subject: [PATCH] AR: tcontrol.mie applies to all traps, not just breakpoints 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. --- introduction.tex | 2 ++ xml/hwbp_registers.xml | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/introduction.tex b/introduction.tex index 21dcbe93..b6ca85c4 100644 --- a/introduction.tex +++ b/introduction.tex @@ -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{880} \end{steps} \section{About This Document} diff --git a/xml/hwbp_registers.xml b/xml/hwbp_registers.xml index bf1e28d9..8a5a7fa4 100755 --- a/xml/hwbp_registers.xml +++ b/xml/hwbp_registers.xml @@ -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. @@ -211,7 +211,7 @@ Triggers do match/fire while the hart is in M-mode. - 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.