-
Notifications
You must be signed in to change notification settings - Fork 112
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
CHERI prep: stave off amplification for Remote routing #266
Conversation
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.
LGTM
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.
Code looks fine, but it could do with a few comments explaining what a 'truncated' ID is.
* pairings will substantially decrease performance and so we prohibit them | ||
* and use SNMALLOC_ASSERT to verify that they do not exist in debug builds. | ||
*/ | ||
alloc_id_t alloc_id_and_sizeclass; |
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.
Can this be a class type? We have some helpers for bitfield extracts, so we could easily provide an abstract interface for getting the two bits.
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.
So this is pretty contained in a single class already adding another layer of abstraction probably wouldn't buy us much.
8be3480
to
6a89bd8
Compare
Squeeze some bits out of allocator IDs so that we can land the sizeclass in each Remote object. The intent is that, on StrictProvenance architectures like CHERI, we will be able to route Remote messages through RemoteCache-s without needing to amplify back to read the sizeclass metadata field out of the slab headers.
This removes a bunch of pointer math (which would need amplification) to find and read the sizeclass from slab headers.
When forwarding a Remote message, we can now operate entirely with local state: access to our RemoteCache and the message itself.
6a89bd8
to
a7fa8a6
Compare
Smuggle the size class in Remote objects, so that we can leave Remote pointers bounded to their underlying allocation and yet forward a Remote message using only local state. That is, we need to avoid going to the {Alloc,Super,Medium,Meta}slab headers unless we're consuming the Remote message back into our free lists.