Skip to content

Commit

Permalink
Invalid addresses might not match. (#911)
Browse files Browse the repository at this point in the history
* Clarify matching on invalid virtual addresses behavior

See:
* https://lists.riscv.org/g/tech-debug/message/1407
* https://lists.riscv.org/g/tech-debug/files/meetings%202023/2023-01-10%20Debug%20Task%20Group%20Call%20Notes.pdf
* https://lists.riscv.org/g/tech-debug/files/meetings%202023/2023-01-10%20Debug%20Task%20Group%20Call%20Slides.pdf

* Allow invalid addresses not to match at all.

Also clarify tdata2 requirements for triggers that are only used for
address matches.
  • Loading branch information
timsifive authored Dec 7, 2023
1 parent 40b9a05 commit 359bedc
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 12 deletions.
29 changes: 29 additions & 0 deletions Sdtrig.tex
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,35 @@ \subsection{Cache Operations}
\end{steps}
\end{commentary}

\subsection{Address Matches}

For address matches without a mask, \RcsrTdataTwo must be able to hold all valid
addresses in all supported translation modes. That means that after writing any
of these valid addresses, the exact same value XLEN-wide value is read back,
including any high bits. An implementation may be able to optimize the storage
required, depending on the widest addresses it supports.

\begin{commentary}
If physical addresses are less than XLEN bits wide, they are zero-extended.
If virtual addresses are less than XLEN bits wide, they are sign-extended.
\RcsrTdataTwo must be implemented with enough bits of storage to represent
the full range of supported physical and virtual address values when read by
software and used by hardware.
\end{commentary}

\subsubsection{Invalid Addresses}

If \RcsrTdataTwo can hold any invalid addresses, then writes of an
invalid address that can not be represented as-is should be converted to
a different invalid address that can be represented.

For invalid instruction fetch addresses and load and store effective addresses,
the compare value may be changed to a different invalid address.

In addition, an implementation may choose to inhibit all trigger matching
against invalid addresses, especially if there is no support for storage of any
invalid address values in tdata2.

\section{Multiple State Change Instructions} \label{sec:multistate}

An instruction that performs multiple architectural state changes (e.g.,
Expand Down
12 changes: 0 additions & 12 deletions xml/hwbp_registers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -325,12 +325,6 @@
Table~\ref{tab:hwbp_timing}, both timings should be supported on load
address triggers.

This trigger type may be limited to address comparisons (\FcsrMcontrolSelect is
always 0) only. If that is the case and masking is not supported (match
values 4, 5, 12, 13), then \RcsrTdataTwo must be able to
hold all valid virtual addresses but it need not be capable of holding
other values.

The Privileged Spec says that breakpoint exceptions that occur on
instruction fetches, loads, or stores update the {\tt tval} CSR
with either zero or the faulting virtual address. The faulting
Expand Down Expand Up @@ -685,12 +679,6 @@
A chain of triggers must only fire if every trigger in the chain was
matched by the same instruction.

This trigger type may be limited to address comparisons (\FcsrMcontrolSixSelect is
always 0) only. If that is the case and masking is not supported (match
values 4, 5, 12, 13), then \RcsrTdataTwo must be able to
hold all valid virtual addresses but it need not be capable of holding
other values.

The Privileged Spec says that breakpoint exceptions that occur on
instruction fetches, loads, or stores update the {\tt tval} CSR
with either zero or the faulting virtual address. The faulting
Expand Down

0 comments on commit 359bedc

Please sign in to comment.