CHERIoT

References:

Overview

Smallest CHERI (Portmeirion Project)

  • RISC-V32.
  • C extension required.
  • 15 registers
  • 32-bit address space
  • A signle privilege level: Machine mode only.
  • No virtual memory.
  • Optional PMP.
  • Optional floating point.

Based on ibex.

Ibex Implementation

cite: https://github.com/Microsoft/cheriot-ibex

RV32IMCB + CHERI.

Either with 2-stage or 3-stage pipeline, configurable.

Passed FPGA validation, and undergoing synthesization and PPA analysis (as of 20230204, commit)

Instructions

CHERI-ibex ISA: 30+ instructions, including:

  • query or test capabilities (10)
    • cgetaddr, cgetbase, cgetlen, cgetperm, cgettag, cgettop, cgettype, ctestsubset, csetequalexact, csub
  • modify or derive capabilities (15)
    • auicgp, auipcc, candperm, ccleartag, cincaddr, cincaddrimm, cmove, cram, crrl, csetaddr, csetbounds, csetboundsexact, csetboundsimm, cseal, cunseal
  • load/store capabilities from memory (2)
    • clc, csc
  • control the program flow (2)
    • cjal, cjalr
  • access special cap registers (SCR): cspecailrw

  • compressed instructions are extended for capabilities:

    • c.incaddr4cspn
    • c.incaddr16csp
    • c.jal
    • c.jalr
    • RV64 c.ld reused for c.clc
    • RV64 c.sd reused for c.csc

Register File

Cheri-Ibex: cheri_regfile.sv, configurable number of general purpose registers -> CherIoT Capabilities.

Load-store unit

Cheri-Ibex:

  • data bus 33-bit, MSB 1-bit is used as a valid tag to differentiate between capabilities and normal integer data.

  • modified LSU to support atomic capability load/store transactions.

Configuration and status registers

CSRs defined in rtl/ibex_cs_registers.sv

Newly added as in iot spec:

  • MTCC (address 28), replaces mtvec
  • MTDC (address 29)
  • MScratchC (address 30)
  • MEPCC (address 31)
  • PCC (address?)

For debug support:

  • CDPC (24)
  • CDScratch0 (25)
  • CDScratch1 (26)
  • CDBGCTRL (27)

Backward Compatibility

when cheri_pmode_i=1, CHERIoT instructions can still execute, however all access rules are disabled and any binary code generated by non-Cheri RV32 compilers can run unmodified in cheri-ibex.

More

Created Feb 16, 2023 // Last Updated Feb 22, 2023

If you could revise
the fundmental principles of
computer system design
to improve security...

... what would you change?