Skip to content

Commit

Permalink
Fix initialisation of MTCC register.
Browse files Browse the repository at this point in the history
The ISA doc says that MTCC should be initialised to the executable
root. This makes sense as it needs to be executable to be used as the
trap vector. Sail was erroneously setting it to the memory RW root, so
fix it here. cheriot-rtos never actually uses this initial value:
instead it writes MTCC with a PCC derived capability, hence why this
was not noticed before. Spotted by @kliuMsft .
  • Loading branch information
ronorton authored and rmn30 committed Nov 6, 2023
1 parent 19ad1e9 commit e0c5663
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cheri_regs.sail
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ function ext_init_regs () = {
PCC = root_cap_exe;
nextPCC = root_cap_exe;

MTCC = root_cap_mem;
MTCC = root_cap_exe;
MTDC = root_cap_mem;
MScratchC = root_cap_seal;
MEPCC = root_cap_exe;
Expand Down

0 comments on commit e0c5663

Please sign in to comment.