[BUG] mtinst corrupted #2831
Labels
notCV32A65X
It is not an CV32A65X issue
Type:Bug
For bugs in the RTL, Documentation, Verification environment or Tool and Build system
Is there an existing CVA6 bug for this?
Bug Description
Hello,
I have noticed an unexpected behavior.
The signal x_exception_o in cvxif_fu has several unconnected fields, which is partially intentional (at least for tval) according to the specification.
In certain scenarios, and with the hypervisor extension enabled, it is possible that these undriven fields are read and the CSR mtinst is written with these arbitrary values.
I have created a small test bench here: https://github.com/KatCe/cva6/tree/bug_mtinst_corruption/bug_simulations/x_exception_mtinst
In this test bench, the bug is triggered by an unexpected bus response that also triggers an assertion:
To model what would happen in silicon I have initialized the tinst field of x_exception_o with an arbitrary value for demonstration (https://github.com/KatCe/cva6/blob/bug_mtinst_corruption/core/cvxif_fu.sv#66) and converted the assertion to a warning (https://github.com/KatCe/cva6/blob/bug_mtinst_corruption/core/cva6_fifo_v3.sv#228).
In that case we see the arbitrary value written to the mtinst CSR.
While this exact scenario can only happen if cva6 is integrated with another component that does not follow the bus protocol, I believe that cva6 should not rely on a bug free external world. Furthermore, a fault injection attack could trigger this CSR corruption.
I have not yet investigated whether this corruption can also be triggered by other scenarios.
The text was updated successfully, but these errors were encountered: