CHERIoT-Platform/llvm-project
View on GitHubReplace various macros from compartment-macros with compiler builtins.
Open
#6 opened on Nov 24, 2023
good first issue
Repository metrics
- Stars
- (9 stars)
- PR merge metrics
- (PR metrics pending)
Description
A lot of things in compartment-macros.h that should be compiler builtins:
- MMIO_CAPABILITY, should be
__builtin_cheriot_mmio_capability(type, identifier), lowered tollvm.cheriot.mmio_capability, which is attributed so that optimisers know that it always returns the same value, and then expanded to something equivalent to the current assembly in the back end (ideally with the permissions handled more sensibly). -
CHERIOT_EMIT_STATIC_SEALING_TYPEshould be__builtin_cheriot_sealing_type(identifier), generating an LLVM intrinsic that then expanding in the back end to something equivalent to the current assembly. -
DECLARE_STATIC_SEALED_VALUEshould be replaced with a[[cheriot::sealed(identifier, identifier)]]attribute on a structure. This should use the attribute that will be introduced in #5, the only thing allowed on these globals is taking their address.STATIC_SEALED_VALUEthen is replaced with simply taking the address of a global declared with thecheriot::sealedattribute.