Skip to content

Commit

Permalink
swap rules 9 and 10, update (former) rules 9, and change quadrant 1 6…
Browse files Browse the repository at this point in the history
…-7 value of SL to match the rules
  • Loading branch information
tariqkurd-repo committed Nov 4, 2024
1 parent 49d85ca commit 8b6c370
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions src/insns/acperm_32bit.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ The rules from <<acperm_rules>> must be followed when removing permissions.

[#acperm_rules]
.ACPERM common rules
[float="center",align="center",cols="2,2,3",options="header"]
[float="center",align="center",cols="2,2,4",options="header"]
|===
| Rule | Permission | Only valid if
| 1 (RV32 only) | <<asr_perm>> | All other permissions are set.
Expand All @@ -54,12 +54,15 @@ The rules from <<acperm_rules>> must be followed when removing permissions.
| 6 (RV32 only) | <<x_perm>> | <<w_perm>> or <<c_perm>>
| 7 | <<el_perm>> | <<c_perm>> and <<r_perm>>
| 8 | <<lm_perm>> | <<c_perm>> and <<r_perm>>
| 9 (RV32 only) | <<x_perm>> | (<<c_perm>> == <<lm_perm>> == <<el_perm>>) and (<<sl_perm>> == ∞)
| 10 | <<sl_perm>> | <<c_perm>>
| 9 | <<sl_perm>> | <<c_perm>>
| 10 (RV32 only) | <<x_perm>> | (<<c_perm>> and <<lm_perm>> and <<el_perm>> and (<<sl_perm>> == ∞)) or +
(not(<<c_perm>> and not(<<lm_perm>>) and not(<<el_perm>>) and (<<sl_perm>>==0)))^1^
| 11 | <<asr_perm>> | <<x_perm>>
| 12 | <<m_bit>> | <<x_perm>>
|===

^1^ All the listed permissions in the set are either minimum or maximum.

The behaviour 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_)).

* For RV64 all such combinations may be redefined by future extensions.
Expand Down
4 changes: 2 additions & 2 deletions src/level-ext.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ endif::[]
| 0-1 | ✔ | ✔ | ✔ | ✔ | ✔ | ∞ | ✔ | ✔ | Mode^1^ | Execute + ASR (see <<infinite-cap>>)
| 2-3 | ✔ | | ✔ | ✔ | ✔ | ∞^1^| ✔ | | Mode^1^ | Execute + Data & Cap RO
| 4-5 | ✔ | ✔ | ✔ | ✔ | ✔ | ∞ | ✔ | | Mode^1^ | Execute + Data & Cap RW
| 6-7 | ✔ | ✔ | | | | ^1^| ✔ | | Mode^1^ | Execute + Data RW
| 6-7 | ✔ | ✔ | | | | 0^1^| ✔ | | Mode^1^ | Execute + Data RW
11+| *Quadrant 2: Restricted capability data read/write*
11+| bit[2] = write, bit[1:0] = store level. R and C implicitly granted, LM dependent on W permission.
|Bits[4:3]| R | W | C | LM | EL | SL | X | ASR | Mode^1^ |
Expand All @@ -98,7 +98,7 @@ endif::[]
| 7 | ✔ | ✔ | ✔ | ✔ | ✔ | 0 | | | N/A | Data & Cap RW (no store _local_)
|==============================================================================

^1^ SL isn't applicable in these cases, but reports this value in <<GCPERM>> to simplify the rules followed by <<ACPERM>>
^1^ SL isn't applicable in these cases, but this value is reported by <<GCPERM>> to simplify the rules followed by <<ACPERM>>

[#section_cap_level_change]
=== Changing capability levels and permissions
Expand Down

0 comments on commit 8b6c370

Please sign in to comment.