Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
L
llvm-project
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 17
    • Issues 17
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 7
    • Merge Requests 7
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Metrics
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Repository
    • Value Stream
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Morello
  • llvm-project
  • Issues
  • #10

Closed
Open
Opened Dec 01, 2020 by Jessica Clarke@jrtc27Developer

AArch64 backend incorrectly maps __builtin_cheri_[gs]et_flags to [GS]CFLGS

As discussed on Slack a couple of times, the aforementioned builtin is being used by Morello for what it calls the flags field, which differs from what CHERI ISAv7/8 define as the flags field (CHERI defines it to be a set of architectural hardware-interpreted bits and CHERI-RISC-V uses this for its mode bit, rather than the LSB of the address like Morello, whereas Morello defines it to be the top byte of the address and has no other architectural meaning).

Thus, the Morello-extended CHERI-LLVM should instead map __builtin_cheri_get_flags to the constant 0 and __builtin_cheri_set_flags to a no-op (or perhaps not provide the builtin at all; unclear what's best). If intrinsics to access the Morello user flags are deemed useful they can be added as __builtin_morello_*, with suitable bike-shedding for an acceptable name (things involving "user", "software" and "top byte" may make useful disambiguation qualifiers).

Note that this difference between CHERI-MIPS/CHERI-RISC-V and Morello broke generic CHERI code in CheriBSD's printf, which was consulting the result of __builtin_cheri_get_flags and relied on it being as defined by CHERI ISAv7/8 (specifically, checking if it was zero in the context of null-derived capabilities).

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: morello/llvm-project#10