Clarify CHERI PTE fault priority when 2-stage translation is in use #547
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
CHERI PTE faults sometimes require a tag check which is not available until after two stage translation has completed and so can not be prioritised above guest page faults, even if other page faults are detected before completing translation.
There are occasions when a PTE permission fault can be taken, but the 2-stage translation hasn't finished, and so a load cannot have executed yet (as the physical address isn't available yet), and so the tag cannot be checked. In this case the page fault will be taken without reporting a CHERI PTE fault. It makes sense to say the same for the store.
the order is
possible page fault due to permissions
finish two-stage translation (possible guest page fault)
possible CHERI PTE fault
so it's not always possible to detect both the normal and the CHERI PTE page faults at once