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

Change representation of the SeqSet #568

Merged
merged 14 commits into from
Oct 28, 2022
Merged

Change representation of the SeqSet #568

merged 14 commits into from
Oct 28, 2022

Conversation

mjp41
Copy link
Member

@mjp41 mjp41 commented Oct 24, 2022

This changes the representation of SeqSet to be doubly linked. This is required to enable tracking fully used slabs.

  • Currently debug_check_empty can say empty when it isn't as a slab is fully used.
  • Implementing a heap walk we will also need to track fully used slabs.

Future PR will use this to track fully used slabs.

This changes the representation of SeqSet to be doubly linked.  This is
required to enable tracking fully used slabs.

* Currently debug_check_empty can say empty when it isn't as a slab is
fully used.
* Implementing a heap walk we will also need to track fully used slabs.

Future PR will use this to track fully used slabs.
@mjp41 mjp41 requested a review from nwf-msr October 24, 2022 13:55
Copy link
Contributor

@nwf-msr nwf-msr left a comment

Choose a reason for hiding this comment

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

LGTM but I'm sorry you had to go through all that. I suspect moving back to an AuthMap design will simplify some of this and the unfortunate interaction with the StrictProvenance arenas. I did not foresee this (and other fun) when #402 was being developed.

NextPtr* end{&head};
};
// We could use -static_cast<ptrdiff_t>(offsetof(T, node)) here but CHERI
// compiler complains. So we restrict to first entries only.
Copy link
Contributor

Choose a reason for hiding this comment

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

It's not really the CHERI compiler's fault per se, it's just that StrictProvenanceSlabMetadataMixin defines members atop the FrontendSlabMetadata parameter and so makes the Pagemap's SlabMetadata parameter not a Standard Layout type, and so offsetof is not defined.

I'm kind of surprised it works in the static_assert below.... oh, because T here is the superclass and the caller's done the non-Standard-Layout shift for us. It looks like we never need to perform the downcast?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think T is StrictProvenanceSlabMetadata for CHERI here. That class ties the parameter back in using F-Bounded polymorphism.

@mjp41 mjp41 merged commit 0a5eb40 into microsoft:main Oct 28, 2022
@mjp41 mjp41 deleted the cyclicdll branch October 28, 2022 12:14
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.

None yet

2 participants