Skip to content
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

Priority of CHERI page faults #484

Open
Timmmm opened this issue Dec 13, 2024 · 3 comments · May be fixed by #485
Open

Priority of CHERI page faults #484

Timmmm opened this issue Dec 13, 2024 · 3 comments · May be fixed by #485

Comments

@Timmmm
Copy link
Contributor

Timmmm commented Dec 13, 2024

It didn't matter before #480 because CHERI page faults were indistinguishable from standard page faults, but now we need to specify their priorities. There are a couple of sources of page faults that you could do before or after the CHERI checks:

  • Standard WRXU bit checks
  • Page fault if A/D bits need updating but hardware updates aren't supported

From a Sail point of view I think the easiest thing is if CHERI checks are the lowest priority; i.e. the above checks are done first.

Also there's a question of what happens if hardware A/D bit updates are supported but hardware CRG/CW bit updates are not, or vice versa. It would simplify the Sail implementation (and spec!) if they always had to be the same - either all hardware updates or none at all. Would that be acceptable?

@tariqkurd-repo
Copy link
Collaborator

we need to specify their priorities

The global rule is that CHERI checks come first - and anything existing in RISC-V comes after.
Is there any reason why this wouldn't work here?

(the only counter-example is a PC breakpoint - which is higher than CHERI checks on the PC - otherwise it's impossible to debug CHERI code)

Also there's a question of what happens if hardware A/D bit updates are supported but hardware CRG/CW bit updates are not, or vice versa. It would simplify the Sail implementation (and spec!) if they always had to be the same - either all hardware updates or none at all. Would that be acceptable?

I've already tied them together in section 5.4 (@buxtonpaul asked about this before)

@Timmmm
Copy link
Contributor Author

Timmmm commented Dec 13, 2024

The global rule is that CHERI checks come first - and anything existing in RISC-V comes after.
Is there any reason why this wouldn't work here?

Ah ok, no I think that should be fine. Is that general rule written down anywhere?

I've already tied them together in section 5.4 (@buxtonpaul asked about this before)

Ah ok I missed that, thanks!

@tariqkurd-repo
Copy link
Collaborator

Ah ok, no I think that should be fine. Is that general rule written down anywhere?

I think the correct solution here is to add the PTE page faults into the exception check information on the instruction pages, and add the statement that the PTE page faults come first.

PR to follow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants