Re: Requirements on implementing cycle/instret/hpmcountern
On Thu, Jan 26, 2023 at 1:39 AM Greg Chadwick <gac@...> wrote:
We are not responsible for SW bugs - and that's clearly sa software bug. If it hurts when you do that, don't do that.
My understanding is that if it's listed in the spec, then it is required for M-mode (unless specifically called out, I guess). This is a U-mode CSR, and the expectation is that it performs identically regardless which mode it is executed in. So, it is entirely legal for an Mmode access to time CSR to trap. Similarly, if M-mode executes a Load or store with MPRV=1, and the translation is an illegal address (e.g. upper PA bits are non-zero, or PTE entry doesn't have the correct permissions) then that Mmode emulation access will trap - and if Mmode isn't prepared to handle that, you'll go into infinite trap hell. If it hurts when you do that, don't do that. |
|