Skip to content

Commit fe775f7

Browse files
fix issue 504
1 parent 76fd3e4 commit fe775f7

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

Diff for: src/insns/acperm_32bit.adoc

+4-2
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,12 @@ The rules from <<acperm_rules>> must be followed when removing permissions.
6161
| 13 (RV32 only) | <<x_perm>> | (<<c_perm>> and <<lm_perm>> and <<el_perm>> and (<<sl_perm>> == ∞)) or +
6262
(not(<<c_perm>> and not(<<lm_perm>>) and not(<<el_perm>>) and (<<sl_perm>>==0)))^1^
6363
| 14 | <<asr_perm>> | <<x_perm>>
64-
| 15 | <<m_bit>> | <<x_perm>>
64+
| 15^2^ | <<m_bit>> | <<x_perm>>
6565
|===
6666

67-
^1^ All the listed permissions in the set are either minimum or maximum.
67+
^1^ All the listed permissions in the set are either minimum or maximum. +
68+
^2^ This rule is only relevant, and the <<m_bit>> only exists, if {cheri_default_ext_name} is implemented.
69+
If this bit is set when {cheri_default_ext_name} is _not_ implemented, then the permissions are invalid.
6870

6971
The behavior of currently illegal combinations from <<acperm_rules>> is to clear the permission if invalid (or in the case of <<sl_perm>> set it to 0 (_local_)).
7072

Diff for: src/level-ext.adoc

+12-10
Original file line numberDiff line numberDiff line change
@@ -75,32 +75,34 @@ endif::[]
7575
11+| bit[0] - <<m_bit>> ({CAP_MODE_VALUE}-{cheri_cap_mode_name}, {INT_MODE_VALUE}-{cheri_int_mode_name})
7676
|Bits[4:3]| R | W | C | LM | EL | SL | X | ASR | Mode^1^ |
7777
| 0-1 | ✔ | ✔ | ✔ | ✔ | ✔ | ∞ | ✔ | ✔ | Mode^1^ | Execute + ASR (see <<infinite-cap>>)
78-
| 2-3 | ✔ | | ✔ | ✔ | ✔ | ∞^1^| ✔ | | Mode^1^ | Execute + Data & Cap RO
78+
| 2-3 | ✔ | | ✔ | ✔ | ✔ | ∞^2^| ✔ | | Mode^1^ | Execute + Data & Cap RO
7979
| 4-5 | ✔ | ✔ | ✔ | ✔ | ✔ | ∞ | ✔ | | Mode^1^ | Execute + Data & Cap RW
80-
| 6-7 | ✔ | ✔ | | | | 0^1^| ✔ | | Mode^1^ | Execute + Data RW
80+
| 6-7 | ✔ | ✔ | | | | 0^2^| ✔ | | Mode^1^ | Execute + Data RW
8181
11+| *Quadrant 2: Restricted capability data read/write*
8282
11+| bit[2] = write, bit[1:0] = store level. R and C implicitly granted, LM dependent on W permission.
8383
|Bits[4:3]| R | W | C | LM | EL | SL | X | ASR | Mode^1^ |
8484
| 0-2 10+| reserved
8585
| 3 | ✔ | | ✔ | | | 0^1^ | | | N/A | Data & Cap R0 (without <<lm_perm>>)
86-
| 4 | ✔ | ✔ | ✔ | ✔ | | _(3)_ | | | N/A | _Reserved_ when `LVLBITS=1` ^2^
87-
| 5 | ✔ | ✔ | ✔ | ✔ | | _(2)_ | | | N/A | _Reserved_ when `LVLBITS=1` ^2^
86+
| 4 | ✔ | ✔ | ✔ | ✔ | | _(3)_ | | | N/A | _Reserved_ when `LVLBITS=1` ^3^
87+
| 5 | ✔ | ✔ | ✔ | ✔ | | _(2)_ | | | N/A | _Reserved_ when `LVLBITS=1` ^3^
8888
| 6 | ✔ | ✔ | ✔ | ✔ | | 1 | | | N/A | Data & Cap RW (with store _local_, no <<el_perm>>)
8989
| 7 | ✔ | ✔ | ✔ | ✔ | | 0 | | | N/A | Data & Cap RW (no store _local_, no <<el_perm>>)
9090
11+| *Quadrant 3: Capability data read/write*
9191
11+| bit[2] = write, bit[1:0] = store level. R and C implicitly granted.
9292
11+| _Reserved bits for future extensions must be 1 so they are implicitly granted_
93-
|Bits[4:3]| R | W | C | LM | EL | SL | X | ASR | Mode^1^ |
93+
|Bits[4:3]| R | W | C | LM | EL | SL | X | ASR | Mode^2^ |
9494
| 0-2 10+| reserved
95-
| 3 | ✔ | | ✔ | ✔ | ✔ | 0^1^ | | | N/A | Data & Cap R0
96-
| 4 | ✔ | ✔ | ✔ | ✔ | ✔ | _(3)_ | | | N/A | _Reserved_ when `LVLBITS=1` ^2^
97-
| 5 | ✔ | ✔ | ✔ | ✔ | ✔ | _(2)_ | | | N/A | _Reserved_ when `LVLBITS=1` ^2^
95+
| 3 | ✔ | | ✔ | ✔ | ✔ | 0^2^ | | | N/A | Data & Cap R0
96+
| 4 | ✔ | ✔ | ✔ | ✔ | ✔ | _(3)_ | | | N/A | _Reserved_ when `LVLBITS=1` ^3^
97+
| 5 | ✔ | ✔ | ✔ | ✔ | ✔ | _(2)_ | | | N/A | _Reserved_ when `LVLBITS=1` ^3^
9898
| 6 | ✔ | ✔ | ✔ | ✔ | ✔ | 1 | | | N/A | Data & Cap RW (with store _local_)
9999
| 7 | ✔ | ✔ | ✔ | ✔ | ✔ | 0 | | | N/A | Data & Cap RW (no store _local_)
100100
|==============================================================================
101101

102-
^1^ SL isn't applicable in these cases, but this value is reported by <<GCPERM>> to simplify the rules followed by <<ACPERM>> +
103-
^2^ These entries are reserved when `LVLBITS=1` and in use when `LVLBITS=2`
102+
^1^ _Mode (<<m_bit>>) can only be set on a tagged capability when {cheri_default_ext_name}
103+
is supported. Despite being encoded here it is *not* an architectural permission._ +
104+
^2^ SL isn't applicable in these cases, but this value is reported by <<GCPERM>> to simplify the rules followed by <<ACPERM>> +
105+
^3^ These entries are reserved when `LVLBITS=1` and in use when `LVLBITS=2`
104106

105107
[#section_cap_level_change]
106108
=== Changing capability levels and permissions

0 commit comments

Comments
 (0)