You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In general we should assume that writing to CSRs could do something that potentially violates the Rust abstract model.
Macros like write_csr_as and write_csr_as_usize should at least default to unsafe, and maybe have an option to make a safe variant on a CSR by CSR basis.
The text was updated successfully, but these errors were encountered:
romancardenas
changed the title
All the CSR write operations should be unsafe by defaultriscv: All the CSR write operations should be unsafe by default
May 14, 2024
I agree. Writing to RISC-V CSRs can cause all sorts of unsafe behaviour. There are a few that probably aren't unsafe but they need some reasoning about why they aren't. unsafe by default is the way to go
In general we should assume that writing to CSRs could do something that potentially violates the Rust abstract model.
Macros like
write_csr_as
andwrite_csr_as_usize
should at least default tounsafe
, and maybe have an option to make a safe variant on a CSR by CSR basis.The text was updated successfully, but these errors were encountered: