-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Finalize sub-exception code reporting mechanism #536
Comments
In CHERIoT, we have a pending patch to the RTOS that does a mapping very like this for reporting to user code. Using the low bits would be a bit cleaner since it then makes the CHERI exceptions a range. Where you can check if it’s in the range with a single and and can then extract the CHERI cause with another one. |
I like the idea of using the low bits for the extra information. Right now mcause values > 64 are marked as reserved and we currently require 8 bits of mtval2 state (although only 4 bits are allocated so far). If we want to keep reserving 8 bits of exception space we could say 512->1023 is reserved for CHERI, i.e. CHERI exception was triggered if |
I just had a look at the CLIC spec and it appears it already adds sub-fields to mcause, so doing this for CHERI would also be consistent.
The current privilege spec states that anything from 64 is reserved, i.e. only bits 5:0 are allocated. Seeing as there are already new fields allocated above the exception code, maybe the cleanest approach would be to allocate the free bits 15:12 as the sub-code that reports tag violation etc.? Not sure if this is cleaner than allocating lots of values in the excode region using the approach in the previous comment |
AFAICT, the CLIC |
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 formcause & 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)?
The text was updated successfully, but these errors were encountered: