Skip to content

Add support for CHERI "purecap" as an environment in target triples. #118927

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

Closed
wants to merge 1 commit into from

Conversation

resistor
Copy link
Collaborator

@resistor resistor commented Dec 6, 2024

For context, CHERI architectures can support two modes:

  • Hybrid mode, in which capabilities co-exist alongside normal pointers.
  • Pure capability mode, in which all pointers are replaced with capabilities.

Hybrid mode does not require any indication in the target triple, as it
is treated the same as any other extension to the parent ISA. Pure cap mode,
however, is a different ABI from the native ABI of the parent architecture.

For context, CHERI architectures can support two modes:
* Hybrid mode, in which capabilities co-exist alongside normal pointers.
* Pure capability mode, in which all pointers are replaced with capabilities.

Hybrid mode does not require any indication in the target triple, as it
is treated the same as any other extension to the parent ISA. Pure cap mode,
however, is a different ABI from the native ABI of the parent architecture.
@arichardson
Copy link
Member

While I i initially added this for MIPS I'm not 100% convinced it's the best approach to use an environment here as we might want the existing ones too. I'm starting to think using an architecture like riscv64c might be cleaner an less error prone. @jrtc27 what do you think?

@jrtc27
Copy link
Collaborator

jrtc27 commented Dec 9, 2024

Yeah this should not be part of the environment, it should be part of the CPU if anything.

@jrtc27
Copy link
Collaborator

jrtc27 commented Dec 9, 2024

Environment is way too overloaded already and the cross product of multiple things, this would jus make it even worse.

@jrtc27
Copy link
Collaborator

jrtc27 commented Dec 9, 2024

Also, you can’t just go upstreaming random bits of CHERI support. You need to talk to us first about it as CHERI LLVM maintainers, and you need to talk to the upstream LLVM community first. Triples aren’t exactly useful without something behind them…

Copy link
Collaborator

@jrtc27 jrtc27 left a comment

Choose a reason for hiding this comment

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

.

@resistor resistor marked this pull request as draft December 9, 2024 23:32
@resistor
Copy link
Collaborator Author

While I i initially added this for MIPS I'm not 100% convinced it's the best approach to use an environment here as we might want the existing ones too. I'm starting to think using an architecture like riscv64c might be cleaner an less error prone. @jrtc27 what do you think?

FWIW, we're planning to go a similar direction to what you're suggesting for CHERIoT, i.e. defining a riscv32cheriot sub-arch. There's a reasonable amount of precedent for similar sub-arch constructs in ARM and MIPS.

@resistor
Copy link
Collaborator Author

Abandoning this at it seems this is not the direction we want.

@resistor resistor closed this Dec 10, 2024
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.

3 participants