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

CHERI prep: stave off amplification for Remote routing #266

Merged
merged 3 commits into from
Dec 21, 2020

Conversation

nwf
Copy link
Collaborator

@nwf nwf commented Dec 14, 2020

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.

@nwf nwf requested review from mjp41 and davidchisnall December 14, 2020 19:16
Copy link
Member

@mjp41 mjp41 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@davidchisnall davidchisnall left a 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;
Copy link
Collaborator

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.

Copy link
Member

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.

@nwf nwf force-pushed the 202012-remote-size-class branch from 8be3480 to 6a89bd8 Compare December 15, 2020 14:37
@nwf nwf mentioned this pull request Dec 16, 2020
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.
@nwf nwf force-pushed the 202012-remote-size-class branch from 6a89bd8 to a7fa8a6 Compare December 16, 2020 17:22
@mjp41 mjp41 merged commit 975a2bd into microsoft:master Dec 21, 2020
@nwf nwf deleted the 202012-remote-size-class branch December 21, 2020 17:10
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.

4 participants