-
Notifications
You must be signed in to change notification settings - Fork 45
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
[DRAFT] #741
Closed
Closed
[DRAFT] #741
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EVT::getTypeForEVT currently returns a PointerType for MVT::cN, but this has a couple of issues. The first issue is we have to hard-code the address space, though that's not such a big deal given we do that elsewhere too. The bigger issue is that, when we later pass that to MVT::getVT or EVT::getEVT, it doesn't know what the right size is, so returns MVT::cPTR instead, which is not a true value type, and is supposed to only be used by TableGen. This has been seen to confuse TargetLoweringBase::getTypeConversion, as when presented with a vector of capability pointers it can end up trying to recreate a smaller vector of the same type, but this trips up various assertions for the MVT::cPTR as both the IR methods and the code here are expecting to be dealing with actual value types. Borrowing the idea of TypedPointerType (DXILPointerTyID) a bit, introduce a new IR type, SizedCapabilityType, to represent a fixed-size capability during CodeGen, which allows lossless roundtripping from MVT to Type and back. This fixes building cheritest, which has crashed since the introduction of cPTR due to cPTR not being a value type, mirroring iPTR, unlike the old iFATPTRAny which was its own weird beast, but wouldn't have tripped up these assertions. It probably didn't do the most sensible things though. Fixes: 7aa7f2e ("[CodeGen] Rework MVT representation of capabilities and add type inference")
This now preserves typedefs where possible, and the generalisation allows us to remove the special enum case from its caller.
These are an artifact of how types are structured but serve little purpose, merely showing that the type is sugared in some way. For example, ElaboratedType's existence means struct S gets printed as 'struct S':'struct S' in the AST, which is unnecessary visual clutter. Note that skipping the second print when the types have the same string matches what we do for diagnostics, where the aka will be skipped. (cherry picked from commit f9ead46931aef2978ddf350ba6523638175d7861)
Under the benchmark ABI, when making a function call that never returns, the link register might contain an untagged capability generated by a previous function return (Recall that returning under the benchmark ABI involves clearing the LSB of the address, clearing the tag at the same time).
This commit adds support for backtrace and exception handling in libunwind when the process is running with the compartmentalization runtime linker. The unwinding process remains the same until a trampoline is encountered as the return address. This means that we are crossing compartment boundaries and we need to gather the unwind information from the runtime linker. We do this by reading information from the executive stack that the runtime linker populates for us in unw_getcontext. It also adds a new class, CompartmentInfo, which is responsible for abstracting away the details of c18n compartments. Currently, it is only used to define the constants relating to the trusted frame layout. The otype allocated to libunwind is given to libunwind by the runtime linker via the _rtld_unw_getsealer function, and as such this code is guarded by a LIBUNWIND_CHERI_C18N_SUPPORT define. The sealer is used to internally access the executive stack pointer in order to unwind through compartment boundaries. This design may change in the future. This functionality only works on Morello right now.
subrepo: subdir: "libunwind" merged: "af9f3c32d12f" upstream: origin: "https://github.com/CTSRD-CHERI/libunwind" branch: "monorepo-mirror" commit: "af9f3c32d12f" git-subrepo: version: "0.4.1" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "1f13869"
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.