Skip to content

Commit

Permalink
PermitStoreLocalCap removed from error demo
Browse files Browse the repository at this point in the history
  • Loading branch information
marnovandermaas committed Oct 17, 2024
1 parent 2d4608e commit 49c78ba
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions sw/cheri/error_leds/error.S
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,17 @@ start:
la_abs t0, trap
csetaddr ct0, ca1, t0
cspecialw mtcc, ct0
// Enable trap on permit store local capability violation.
li t0, 1
csrw 0xBC4, t0
// Keeps track of which violation to cause next.
// Start at 8 because first thing we do is add one and wrap to zero.
li s0, 8
li s0, 7

.section .text

nextviolation:
addi s0, s0, 1 // Go to next exception.
addi t0, s0, -9 // Check if we hit 9.
addi t0, s0, -8 // Check if we hit 8.
bnez t0, checkvalues
li s0, 0 // Wrap to zero if we hit 9.
li s0, 0 // Wrap to zero if we hit 8.
checkvalues:
li t0, 0
beq s0, t0, bounds
Expand All @@ -50,8 +47,6 @@ checkvalues:
addi t0, t0, 1
beq s0, t0, permitstorecap
addi t0, t0, 1
beq s0, t0, permitstoreloccap
addi t0, t0, 1
beq s0, t0, permitaccsysreg
j fail // We should never get here.

Expand Down Expand Up @@ -101,14 +96,6 @@ permitstorecap:
csc ct0, 0(ct0)
j fail // We should never get here.

permitstoreloccap:
// Create capability write only capability that is local.
li t0, 0x44
candperm ct0, ca0, t0
// Cause store local capability permission violation.
csc ct0, 0(ct0)
j fail // We should never get here.

permitaccsysreg:
// Remove access system register permission from PCC,
// as well as permissions: GL, LM, LG, EX, LD, MC
Expand Down

0 comments on commit 49c78ba

Please sign in to comment.