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

Tag memory PMA would be useful #84

Closed
tariqkurd-repo opened this issue Feb 1, 2024 · 4 comments
Closed

Tag memory PMA would be useful #84

tariqkurd-repo opened this issue Feb 1, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@tariqkurd-repo
Copy link
Collaborator

tariqkurd-repo commented Feb 1, 2024

In a real CHERI system it is useful to distinguish memory which is tag aware and memory which is not - i.e. doesn't support tags.

This will allow a CHERI core to mark memory bus transactions as tag aware or non-tag aware, to allow efficient handling.

It seems reasonable that all cached memory is tag aware, but this may not be a firm requirement.

Therefore I propose adding a new PMA attribute for this, with a recommendation that cached memory is tag aware.

@tariqkurd-repo tariqkurd-repo added the bug Something isn't working label Feb 1, 2024
@tariqkurd-repo
Copy link
Collaborator Author

@andresag01 has pointed out that this is included already.
with options that LC/SC with the tag set can either cause an access fault exception, or store the tag as zero.

I think clearing the tag is useful in both directions (load and store) so that LC/SC can be used for performance. Therefore they become double width load/store which don't affect the tag state.

So I think that the spec should be updated to include loading tags as zero as an option.

@andresag01
Copy link
Collaborator

Yes, there is currently a short section in Chapter 3. This is what it says:

Physical Memory Attributes (PMA)
Typically, the entire memory space need not support tagged data. Therefore, it is desirable that harts
supporting Zcheri_purecap extend PMAs with a taggable attribute indicating whether a memory
region allows storing tagged data.
When the hart attempts to store or load data with the tag set to memory regions that are not taggable,
the implementation may:
• Cause an access fault exception
• Implicitly set the stored tag to 0

Yes, sorry, I missed the load-side of this.

@andresag01
Copy link
Collaborator

@andresag01 andresag01 mentioned this issue Feb 2, 2024
@tariqkurd-repo
Copy link
Collaborator Author

yes - this was fixed by https://github.com/riscv/riscv-cheri/pull/54

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants