Skip to content

Commit 3082d62

Browse files
authored
Merge branch 'riscv:main' into faf28_spelling_fixes
2 parents 6fdd19a + 2f8d7b2 commit 3082d62

10 files changed

+83
-62
lines changed

Diff for: .github/dependabot.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#package-ecosystem
3+
version: 2
4+
updates:
5+
- package-ecosystem: gitsubmodule
6+
directory: /
7+
schedule:
8+
interval: daily

Diff for: docs-resources

Submodule docs-resources updated 48 files

Diff for: src/attributes.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ endif::[]
6565
:non-csrrw-and: <<CSRRWI>>, <<CSRRS>>, <<CSRRSI>>, <<CSRRC>> and <<CSRRCI>>
6666

6767
:TAG_RESET_CSR: The tag of the CSR must be reset to zero. The reset values of the metadata and address fields are UNSPECIFIED.
68-
:REQUIRE_CRE_CSR: Access to this CSR is illegal if <<section_cheri_disable,CHERI register access is disabled>> for the current privilege.
68+
:REQUIRE_CRE_CSR: Access to this CSR is illegal if <<section_cheri_disable,CHERI register and instruction access is disabled>> for the current privilege.
6969

7070
:CAP_MODE_VALUE: 0
7171
:INT_MODE_VALUE: 1

Diff for: src/csv/CHERI_ISA.csv

+35-35
Large diffs are not rendered by default.

Diff for: src/insns/load_tag_perms.adoc

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ The tag value written to `cd` is 0 if the tag of the memory location loaded is
44
+
55
If the authorizing capability does not grant <<lm_perm>>, and the tag of `cd` is 1 and `cd` is not sealed, then an implicit <<ACPERM>> clearing <<w_perm>> and <<lm_perm>> is performed to obtain the intermediate permissions on `cd`.
66
+
7-
If the authorizing capability does not grant <<el_perm>>, and the tag of `cd` is 1, then an implicit <<ACPERM>> clearing <<el_perm>> and restricting the <<section_cap_level>> to the level of the authorizing capability is performed to obtain the final permissions on `cd`.
8-
+
97
If the authorizing capability does not grant <<el_perm>>, and the tag of `cd` is 1, then an implicit <<ACPERM>> restricting the <<section_cap_level>> to the level of the authorizing capability is performed.
108
If `cd` is not sealed, this implicit <<ACPERM>> also clears <<el_perm>> to obtain the final permissions on `cd` (see <<cap_level_load_summary>>).
119

@@ -15,4 +13,6 @@ Similarly, sealed capabilities are not modified as they are not directly derefer
1513
NOTE: Missing <<el_perm>> also affects the level of sealed capabilities since notionally the <<section_cap_level>> of a capability is not a permission but rather a data flow label attached to the loaded value.
1614
However, untagged values are not affected by <<el_perm>>.
1715

18-
NOTE: While the implicit <<ACPERM>> introduces a dependency on the loaded data, microarchitectures can avoid this by deferring the actual masking of permissions until the loaded capability is dereferenced or the metadata bits are inspected using <<GCPERM>> or <<GCHI>>.
16+
NOTE: While the implicit <<ACPERM>> introduces a dependency on the loaded data, implementations can avoid this by deferring the actual masking of permissions until the loaded capability is dereferenced or the metadata bits are inspected using <<GCPERM>> or <<GCHI>>.
17+
18+
NOTE: When sending load data to a trace interface implementations can choose whether to trace the value before or after <<ACPERM>> has modified the data. The recommendation is to trace the value after <<ACPERM>>.

Diff for: src/insns/require_cre.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
This instruction is illegal if the <<section_cheri_disable,CHERI register access is disabled>> for the current privilege.
1+
This instruction is illegal if the <<section_cheri_disable,CHERI register and instruction access is disabled>> for the current privilege.

Diff for: src/introduction.adoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ CAUTION: The extension names are provisional and subject to change.
107107
|<<cheri_default_ext,{cheri_default_ext_name}>> | Stable | This extension is a candidate for freezing
108108
|<<sh4add_ext, {sh4add_ext_name}>> | Stable | This extension is a candidate for freezing
109109
|<<lr_sc_bh_ext, {lr_sc_bh_ext_name}>> | Stable | This extension is a candidate for freezing
110-
|<<cheri_pte_ext, {cheri_pte_ext_name}>> | Prototype | This extension is a prototype, software is being developed to use it to increase the maturity level
111-
|<<tid_ext, {tid_ext_name}>> | Prototype | This extension is a prototype, software is being developed to use it to increase the maturity level
110+
|<<cheri_pte_ext, {cheri_pte_ext_name}>> | Stabilizing | This extension is a candidate for freeze, software evaluation currently ongoing
111+
|<<tid_ext, {tid_ext_name}>> | Stabilizing | This extension is a candidate for freeze, software evaluation currently ongoing
112112
|<<cheri_levels_ext, {cheri_levels_ext_name}>> with `LVLBITS=1` | Prototype | This extension is a prototype, software is being developed to use it to increase the maturity level.
113113
|==============================================================================
114114

Diff for: src/level-ext.adoc

+2-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ With `LVLBITS=1` there is a single bit comparison, so it behaves as follows:
4848
NOTE: For `LVLBITS=1` this permission is equivalent to _StoreLocal_ in CHERI v9, Morello and CHERIoT.
4949

5050
[#el_perm,reftext="EL-permission"]
51-
Elevate Level Permission (EL):: Any capability with its tag set to 1 that is loaded from memory has its <<el_perm>> cleared and its <<section_cap_level>> restricted to the authorizing capability's <<section_cap_level>> if the authorizing capability does not grant <<el_perm>>.
51+
Elevate Level Permission (EL):: Any unsealed capability with its tag set to 1 that is loaded from memory has its <<el_perm>> cleared and its <<section_cap_level>> restricted to the authorizing capability's <<section_cap_level>> if the authorizing capability does not grant <<el_perm>>.
52+
If sealed, then only <<section_cap_level,CL>> is modified, <<el_perm>> is unchanged.
5253
This permission is similar to the existing <<lm_perm>>, but instead of applying to the <<w_perm>> on the loaded capability it restricts the <<section_cap_level,CL>> field.
5354

5455

Diff for: src/riscv-hybrid-integration.adoc

+10-8
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ In both encodings:
7979
* Mode (M)={CAP_MODE_VALUE} indicates {cheri_cap_mode_name}.
8080
* Mode (M)={INT_MODE_VALUE} indicates {cheri_int_mode_name}.
8181
82-
The current CHERI execution mode is given by the <<m_bit>> of the <<pcc>> and the <<section_cheri_disable,CHERI register access settings>> as follows:
82+
The current CHERI execution mode is given by the <<m_bit>> of the <<pcc>> and the <<section_cheri_disable,CHERI register and instruction access settings>> as follows:
8383

84-
* The Mode is {cheri_cap_mode_name} when the <<m_bit>> of the <<pcc>> is {CAP_MODE_VALUE}, *and* <<section_cheri_disable,CHERI register access is enabled>> for the current privilege.
84+
* The Mode is {cheri_cap_mode_name} when the <<m_bit>> of the <<pcc>> is {CAP_MODE_VALUE}, *and* <<section_cheri_disable,CHERI register and instruction access is enabled>> for the current privilege.
8585
* Otherwise the Mode is {cheri_int_mode_name}.
8686
8787
When the <<m_bit>> can be set, the rules defined by <<ACPERM>> must be followed.
@@ -313,7 +313,7 @@ As shown in xref:CSR_exevectors[xrefstyle=short], <<dddc>> is a data pointer,
313313
so it does not need to be able to hold all possible invalid addresses.
314314

315315
[#section_cheri_disable]
316-
=== Disabling CHERI Registers
316+
=== Disabling CHERI Registers and Instructions
317317

318318
ifdef::cheri_v9_annotations[]
319319
NOTE: *CHERI v9 Note:* This feature is new and different from CHERI v9's
@@ -324,7 +324,7 @@ it is not possible to disable CHERI checks completely.
324324
endif::[]
325325

326326
{cheri_default_ext_name} includes functions to disable explicit access to CHERI
327-
registers. The following occurs when executing code in a privilege mode that
327+
registers and instructions. The following occurs when executing code in a privilege mode that
328328
has CHERI register access disabled:
329329

330330
* The CHERI instructions in xref:section_cap_instructions[xrefstyle=short] and
@@ -462,8 +462,9 @@ xref:menvcfgmodereg[xrefstyle=short].
462462
include::img/menvcfgmodereg.edn[]
463463

464464
The CHERI Register Enable (CRE) bit controls whether less privileged levels can
465-
perform explicit accesses to CHERI registers. When <<menvcfg>>.CRE=1 and <<mseccfg>>.CRE=1,
466-
CHERI registers can be read and written by less privileged levels. When <<menvcfg>>.CRE=0,
465+
perform explicit accesses to CHERI registers and execute CHERI instructions.
466+
When <<menvcfg>>.CRE=1 and <<mseccfg>>.CRE=1, CHERI registers can be read and
467+
written by less privileged levels. When <<menvcfg>>.CRE=0,
467468
CHERI registers are disabled in less privileged levels as described in
468469
xref:section_cheri_disable[xrefstyle=short].
469470

@@ -495,8 +496,9 @@ xref:senvcfgreg[xrefstyle=short].
495496
include::img/senvcfgreg.edn[]
496497

497498
The CHERI Register Enable (CRE) bit controls whether U-mode can perform
498-
explicit accesses to CHERI registers. When <<senvcfg>>.CRE=1 and <<menvcfg>>.CRE=1 and
499-
<<mseccfg>>.CRE=1 CHERI registers can be read and written by U-mode. When <<senvcfg>>.CRE=0,
499+
explicit accesses to CHERI registers and execute CHERI instructions. When
500+
<<senvcfg>>.CRE=1 and <<menvcfg>>.CRE=1 and <<mseccfg>>.CRE=1 CHERI registers
501+
can be read and written by U-mode. When <<senvcfg>>.CRE=0,
500502
CHERI registers are disabled in U-mode as described in
501503
xref:section_cheri_disable[xrefstyle=short].
502504

Diff for: src/riscv-integration.adoc

+20-10
Original file line numberDiff line numberDiff line change
@@ -425,8 +425,7 @@ include::generated/csr_renamed_purecap_mode_u_table_body.adoc[]
425425
=== Machine-Level CSRs
426426

427427
{cheri_base_ext_name} extends some M-mode CSRs to hold capabilities or
428-
otherwise add new functions. <<pcc>> must grant <<asr_perm>> to access M-mode
429-
CSRs regardless of the RISC-V privilege mode.
428+
otherwise add new functions. <<asr-perm>> in the <<pcc>> is typically required for access.
430429

431430
[#mstatus,reftext="mstatus"]
432431
==== Machine Status Registers (mstatus and mstatush)
@@ -758,7 +757,7 @@ a CHERI fault taken into M-mode, <<mtval>> is written with the
758757
MXLEN-bit effective address which caused the fault according to the existing
759758
rules for reporting load/store addresses from cite:[riscv-priv-spec]. In this case
760759
the TYPE field of <<mtval2>> shown in xref:mtval2-cheri-type[xrefstyle=short] is
761-
set to {cheri_excep_type_data}. For all other CHERI faults it is set to zero.
760+
set to {cheri_excep_type_data}. For all other CHERI faults <<mtval>> is set to zero.
762761

763762
The behavior of <<mtval>> is otherwise as described in cite:[riscv-priv-spec].
764763

@@ -832,8 +831,7 @@ CHERI violations have the following order in priority:
832831
=== Supervisor-Level CSRs
833832

834833
{cheri_base_ext_name} extends some of the existing RISC-V CSRs to be able to
835-
hold capabilities or with other new functions. <<pcc>> must grant <<asr_perm>>
836-
to access S-mode CSRs regardless of the RISC-V privilege mode.
834+
hold capabilities or with other new functions. <<asr-perm>> in the <<pcc>> is typically required for access.
837835

838836
[#stvec,reftext="stvec"]
839837
==== Supervisor Trap Vector Base Address Register (stvec)
@@ -1050,7 +1048,8 @@ include::img/stval2reg.edn[]
10501048

10511049
=== Unprivileged CSRs
10521050

1053-
Unlike machine and supervisor level CSRs, {cheri_base_ext_name} does not require
1051+
In {cheri_base_ext_name}, the only register that requires <<asr_perm>> is <<utidc>>
1052+
(for updates but not for reads), and all other unprivileged CSRs do not require
10541053
<<pcc>> to grant <<asr_perm>> to access unprivileged CSRs.
10551054

10561055
=== CHERI Exception handling
@@ -1187,17 +1186,28 @@ this section describes how invalid address handling must be supported in
11871186
{cheri_base_ext_name} when accessing CSRs, branching and jumping, and
11881187
accessing memory.
11891188

1190-
===== Accessing CSRs
1189+
===== Updating CSRs
11911190

1192-
The following procedure must be used when executing instructions, such
1193-
as <<CSRRW>>, that write a capability A to a CSR that cannot hold all invalid
1194-
addresses:
1191+
Some capability-holding CSRs need not be able to hold all invalid virtual addresses.
1192+
Prior to writing to those CSRs, implementations may convert an invalid address into some other invalid address that the CSR is capable of holding.
1193+
This is problematic for CHERI as updating the address may invalidate the bounds as a result, if the bounds are not those of the <<infinite-cap>> capability.
1194+
1195+
Some situations may require that a CSR may be updated to hold a capability with an invalid address:
1196+
1197+
* executing instructions, such as <<CSRRW>>
1198+
* hardware updates to CSRs such as storing the <<pcc>> (which becomes capability A) into
1199+
<<mepcc>>/<<sepcc>> etc. when taking an exception.
1200+
1201+
In order to satisfy the definitions of such CSRs and preserve capability system invariants, the following procedure must be used as part of write-back to the CSR:
11951202

11961203
. If A's address is invalid and A does not have infinite bounds (see
11971204
xref:section_cap_encoding[xrefstyle=short]), then A's tag is set to 0.
11981205
. Write the final (potentially modified) version of capability A to the CSR e.g.
11991206
<<mtvecc>>, <<mepcc>>, etc.
12001207

1208+
NOTE: When A's address is invalid and happens to match an invalid address which the CSR
1209+
can hold, then it is implementation defined whether to clear A's tag.
1210+
12011211
===== Branches and Jumps
12021212

12031213
Control transfer instructions jump or branch to a capability A which can be:

0 commit comments

Comments
 (0)