Skip to content

Support for globals larger than 4kiB #185

@rmn30

Description

@rmn30

Currently the CHERIoT linkage model has a limitation that it cannot support globals larger than 4kiB. This is because instantiating pointers to globals does a sequence of auicgp, cincoffset, csetboundsimm and the set bounds instruction has a 12-bit immediate.

Some workarounds exist:

  • The compiler has a workaround for globals that are used in the same compilation unit (e.g. static) by generating a longer instruction sequence using the register operand version of csetbounds but this doesn't work for globals defined in different compilation units because we don't have the correct type of relocation.
  • In cheriot-rtos you can use a dynamic memory allocation, MMIO_CAPABILITY or SHARED_OBJECT

Although this hasn't been a huge issue so far we do need to fix it, especially as csetboundsimm is unlikely to be part of the riscv-cheri standard in the form we have it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions