-
Notifications
You must be signed in to change notification settings - Fork 29
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
Basic multi-threaded capability tag implementation #158
base: dev
Are you sure you want to change the base?
Conversation
This may want a little more testing, but purecap riscv boots. |
I am seeing the following error booting a purecap kernel (looks like my initial atomics implementation is broken for multi-tcg):
|
28b843a
to
11e9301
Compare
|
||
static inline void cheri_tag_writer_release(tag_writer_lock_t lock) | ||
{ | ||
if (lock != TAG_LOCK_NONE && lock != NULL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably better to not permit NULL here and force callers to do the right thing. I think most do already, just store_cap_to_memory that doesn't check take_lock?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to distinguish between there being no locking due to being single core (NULL) and there being locking but no lock at this location (TAG_LOCK_NONE). The lock_for_x family will all return NULL if locking is off, which will then be ignored by release.
11e9301
to
a8fb070
Compare
a8fb070
to
0e36344
Compare
When MTTCG is enabled, this turns every tag bit into a write-preferring readers-writer lock. When single-threaded, the old one bit per tag is used.
Originally this was based on the morello branch, and so although I have tried to keep it separate, some general fixes I did there have crept in. Namely, the raw_tag version of capability loading (to get the un-squashed tag to implement atomics), and some sign fixes for TCG atomics.