Description
This is a question for ARC review.
In the current CHERI specification, we report an exception sub-code in mtval2/stval2/etc. The upside of this approach is that it does not impact other extensions, but the downside is that we add new CSRs that were not previously required just to report a few bits of extra information.
Would it be cleaner to reserve the high 8 or 16 bits of the *cause CSR to report this additional sub-cause? mcause >= 64 is reserved, so this could be possible? Thena CHERI-aware operating system could to check cause & 0xffffff
in the trap handler and obtain the remaining information form cause & 0xff000000
instead of having to read the new *tval2 register.
This would also make it easier to reuse the software check exception code instead of the custom 0x1c (#60).
Original discussion: #379 (review)?