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

Hardware revoker control re-mastered #358

Merged
merged 7 commits into from
Nov 22, 2024

Conversation

marnovandermaas
Copy link
Contributor

The hardware revoker was controlled by a memory mapped register from the CHERIoT Safe repository. This PR ports this to use reggen registers. This will make the IP more portable, specifically for the Sunburst chip repository.

Update code from upstream repository
https://github.com/microsoft/cheriot-safe.git to revision
5fd7f427a65da675bd214e752c3e30fc1d19a54a

* Factor tbre_go logic into write operations (Marno van der Maas)
* Fix interrupt status when interrupts are disabled (Marno van der
  Maas)
* Remove go and interrupt from read registers (Marno van der Maas)

Signed-off-by: Marno van der Maas <mvdmaas+git@lowrisc.org>
Including:
- Start address
- End address
- Go (hardware extended)
- Epoch
- Interrupt status (hardware extended)
- Interrupt enable
Copy link
Contributor

@GregAC GregAC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @marnovandermaas

We can address the potential testing extension in a follow up PR. For sunburst-chip we'll need to do a more in-depth test anyway so perhaps not worth spending time on this now.

rtl/ip/rev_ctl/rtl/rev_ctl.sv Outdated Show resolved Hide resolved
bnez t2, fail
li t2, 1
csw t2, 20(ct1) // Enable interrupts
csw t2, 8(ct1) // Start sweep
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we extend the test to ensure the revoker finishes and setup something for it to revoke? As is we're testing it doesn't report it's running if we haven't started it and that we're not immediately deadlocking the CPU by starting it off.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, at the moment I am running this test in simulation and checking the waveform to see if it does what I expect. Let me see if I can extend this a bit so that it at least tests something in case no-one looks at the waveform.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've at least checked the interrupt status now, but I agree we should probably add an actual revocation in here.

Implements the core logic of revocation control, mimicking the one found
in CHERIoT Safe but then using the registers generated by reggen.
@marnovandermaas
Copy link
Contributor Author

I've fixed the revocation control interrupt output, it wasn't working properly before. The CHERIoT RTOS test suite passes with these latest changes as well.

@marnovandermaas marnovandermaas merged commit 9fb95d0 into lowRISC:main Nov 22, 2024
3 checks passed
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 this pull request may close these issues.

2 participants