Skip to content

Commit 5086891

Browse files
Merge branch 'main' into 202410-reserve-ls-c0
Signed-off-by: Tariq Kurd <tariq.kurd@codasip.com>
2 parents 779b887 + 9f17dee commit 5086891

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+603
-160
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ GEN_SCRIPT = $(SCRIPTS_DIR)/generate_tables.py
1818

1919
# Version and date
2020
DATE ?= $(shell date +%Y-%m-%d)
21-
VERSION ?= v0.8.3
21+
VERSION ?= v0.9.0
2222
REVMARK ?= Draft
2323

2424
# URLs for downloaded CSV files

src/attributes.adoc

+5
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ endif::[]
4646
:cheri_default_ext_name: Zcherihybrid
4747
// Extension for CHERI PTE bits
4848
:cheri_pte_ext_name: Zcheripte
49+
// Extension for capability levels (flow control)
50+
:cheri_levels_ext_name: Zcherilevels
4951
// Extension for thread identification
5052
:tid_ext_name: Zstid
5153

@@ -77,7 +79,10 @@ endif::[]
7779
:cap_rv32_mw_width: 10
7880
:cap_rv64_mw_width: 14
7981
:cap_rv32_perms_width: 5
82+
//including Zcherilevels, 6 without
8083
:cap_rv64_perms_width: 6
84+
//CL is not a permission, so 8 not 9
85+
:cap_rv64_perms_levels_width: 8
8186
:cap_rv32_addr_width: 32
8287
:cap_rv64_addr_width: 64
8388
:cap_rv32_exp_width: 5

src/cap-description.adoc

+14-4
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ Reserved bits are available for future extensions to {cheri_base_ext_name}.
6060

6161
NOTE: Reserved bits must be 0 in tagged capabilities.
6262

63+
NOTE: The CL field is only present if {cheri_levels_ext_name} is implemented, otherwise it is reserved.
64+
6365
=== Components of a Capability
6466

6567
Capabilities contain the software accessible fields described in this section.
@@ -102,6 +104,7 @@ The byte-address of a memory location is encoded as MXLEN integer value.
102104
ifdef::cheri_v9_annotations[]
103105
WARNING: *CHERI v9 Note:* The permissions are encoded differently in this
104106
specification.
107+
Additionally, this specification incorporates permissions that were present in Morello and/or CHERIoT but not CHERI v9.
105108
endif::[]
106109

107110
This field encodes architecturally defined permissions of the capability.
@@ -166,6 +169,8 @@ Therefore, it is only possible to encode a subset of all combinations.
166169
^| 64 | {cap_rv64_perms_width} | Separate bits for each architectural permission.
167170
|==============================================================================
168171

172+
NOTE: if {cheri_levels_ext_name} is supported then there are {cap_rv64_perms_levels_width} architectural permission bits.
173+
169174
For MXLEN=32, the permissions encoding is split into four quadrants.
170175
The quadrant is taken from bits [4:3] of the permissions encoding.
171176
The meaning for bits [2:0] are shown in <<cap_perms_encoding32>> for each quadrant.
@@ -222,8 +227,8 @@ reserved values as if it were 0b00000 (no permissions). Future extensions may as
222227
meanings to the reserved bit patterns, in which case <<GCPERM>> is allowed to report a
223228
non-zero value.
224229

225-
A {cap_rv64_perms_width}-bit vector encodes the permissions when MXLEN=64. In
226-
this case, there is a bit per permission as shown in
230+
A {cap_rv64_perms_width}-bit vector encodes the permissions when MXLEN=64 ({cap_rv64_perms_levels_width}-bit if {cheri_levels_ext_name} is supported).
231+
In this case, there is a bit per permission as shown in
227232
xref:cap_perms_encoding64[xrefstyle=short]. A permission is granted if its
228233
corresponding bit is set, otherwise the capability does not grant that
229234
permission.
@@ -240,8 +245,10 @@ permission.
240245
| 3 | <<x_perm>>
241246
| 4 | <<asr_perm>>
242247
| 5 | <<lm_perm>>
243-
//| 6 | <<m_bit>>
248+
| 6 | <<el_perm>>^1^
249+
| 7 | <<sl_perm>>^1^
244250
|==============================================================================
251+
^1^ This permission is only supported if the implementation supports <<section_ext_cheri_levels,{cheri_levels_ext_name}>>.
245252

246253
The <<m_bit>> is only assigned meaning when the
247254
implementation supports {cheri_default_ext_name} _and_ <<x_perm>> is set.
@@ -617,8 +624,9 @@ or 'root' capability.
617624
| SDP | ones | Grants all permissions
618625
| AP (MXLEN=32) | 0x8/0x9^1^ (see xref:cap_perms_encoding32[xrefstyle=short])
619626
| Grants all permissions
620-
| AP (MXLEN=64) | 0x3F (see xref:cap_perms_encoding64[xrefstyle=short])
627+
| AP (MXLEN=64) | 0xFF (see xref:cap_perms_encoding64[xrefstyle=short])
621628
| Grants all permissions
629+
| CL | one^2^| _Global_
622630
| CT | zero | Unsealed
623631
| EF | zero | Internal exponent format
624632
| L~8~ | zero | Top address reconstruction bit (MXLEN=32 only)
@@ -636,6 +644,8 @@ or 'root' capability.
636644
* For MXLEN=32, the <<m_bit>> is set to {INT_MODE_VALUE} in the AP field, giving the value 0x9
637645
* For MXLEN=64, the <<m_bit>> is set to {INT_MODE_VALUE} in a separate M field which is _not shown_ in the table above.
638646

647+
^2^ This field only exists if {cheri_levels_ext_name} is implemented.
648+
639649
[#section_cap_representable_check, reftext="Representable Range"]
640650
=== Representable Range Check
641651

src/csv/CHERI_ISA.csv

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@
5252
"GCTYPE","✔","✔","","","","✔","✔","Both","","","","","","","","","","","","","","","","","OP","1-src 1-dst","","","Get capability type","","","","","","","",""
5353
"SCMODE","✔","✔","","","","✔","","Both","","","","","","","","","","","","","","","","","OP","1-src 1-dst","","","Set the mode bit of a capability, no permissions required","","","","","","","",""
5454
"GCMODE","✔","✔","","","","✔","","Both","","","","","","","","","","","","","","","","","OP","1-src 1-dst","","","Get the mode bit of a capability, no permissions required","","","","","","","",""
55-
"MODESW","✔","✔","","","","✔","","Both","","","","","","","","","","","","","","","","","OP","no operands","","","Directly switch mode ({cheri_int_mode_name}/ {cheri_cap_mode_name})","mode==D (optional)","","","","","","",""
56-
"C.MODESW","✔","✔","","","","✔","","Both","","","","","","","","","","","","","","","","","C1","no operands","","","Directly switch mode ({cheri_int_mode_name}/ {cheri_cap_mode_name})","mode==D (optional)","","","","","","",""
55+
"MODESW.CAP","✔","✔","","","","✔","","Both","","","","","","","","","","","","","","","","","OP","no operands","","","Directly switch mode into {cheri_cap_mode_name}","","","","","","","",""
56+
"MODESW.INT","✔","✔","","","","✔","","Both","","","","","","","","","","","","","","","","","OP","no operands","","","Directly switch mode into {cheri_int_mode_name}","","","","","","","",""
5757
"C.ADDI16SP","✔","✔","","","","✔","✔","Both","","","","✔","","","","","","","","","","","","","C0","","","","ADD immediate to stack pointer, CADD in Capability Mode","","","","","","","",""
5858
"C.ADDI4SPN","✔","✔","","","","✔","✔","Both","","","","✔","","","","","","","","","","","","","C0","","","","ADD immediate to stack pointer, CADDI in Capability Mode","","","","","","","",""
5959
"C.MV","✔","✔","","","","✔","✔","Both","","","","✔","","","","","","","","","","","","","C2","","","","Register Move, cap reg move in Capability Mode","","","","","","","",""

src/debug-integration.adoc

+7-8
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ include::img/dpccreg.edn[]
108108
Upon entry to debug mode, cite:[riscv-debug-spec], does not specify how to
109109
update the PC, and says PC relative instructions may be illegal. This concept
110110
is extended to include any instruction which reads or updates <<pcc>>, which refers to
111-
all jumps, conditional branches and <<AUIPC>>. The exception is <<MODESW>>
112-
which _is_ supported if {cheri_default_ext_name} is implemented, see <<dinfc>>
111+
all jumps, conditional branches and <<AUIPC>>. The exceptions are <<MODESW_CAP>> and <<MODESW_INT>>
112+
which _are_ supported if {cheri_default_ext_name} is implemented, see <<dinfc>>
113113
for details.
114114

115115
As a result, the value of <<pcc>> is UNSPECIFIED in debug mode according
@@ -180,13 +180,12 @@ The reset value is the <<infinite-cap>> capability.
180180
If {cheri_default_ext_name} is implemented:
181181

182182
* The <<m_bit>> is reset to {cheri_int_mode_name} ({INT_MODE_VALUE}).
183-
* The debugger can set the <<m_bit>> to {cheri_cap_mode_name} ({CAP_MODE_VALUE}) by executing <<MODESW>> from the program buffer
184-
** if <<MODESW>> is not supported in debug mode then the same can be done by reading the CSR, using <<SCMODE>> and then writing the CSR.
185-
** This only needs doing once after resetting the core.
186-
* The <<m_bit>> is used on debug mode entry to determine which CHERI execution mode to enter.
183+
* The debugger can set the <<m_bit>> to {cheri_cap_mode_name} ({CAP_MODE_VALUE}) by executing <<MODESW_CAP>> from the program buffer.
184+
** Executing <<MODESW_CAP>> causes subsequent instruction execution from the program buffer, starting from the next instruction, to be executed in {cheri_cap_mode_name}. It also sets the CHERI execution mode to {cheri_cap_mode_name} on future entry into debug mode.
185+
** Therefore to enable use of a CHERI debugger, a single <<MODESW_CAP>> only needs to be executed once from the program buffer after resetting the core.
186+
** The debugger can also execute <<MODESW_INT>> to change the mode back to {cheri_int_mode_name}, which also affects the execution of the next instruction in the program buffer, updates the <<m_bit>> of <<dinfc>> and controls which CHERI execution mode to enter on the next entry into debug mode.
187187

188-
The <<m_bit>> is the only writeable field in <<dinfc>>.
189-
Therefore if {cheri_default_ext_name} is not implemented then it is read-write with no writeable fields.
188+
The <<m_bit>> of <<dinfc>> is _only_ updated by executing <<MODESW_CAP>> or <<MODESW_INT>> from the program buffer.
190189

191190
NOTE: A future version of this specification may add writeable fields to allow creation
192191
of other capabilities, if, for example, a future extension requires multiple formats for

src/img/acperm_bit_field.edn

+8-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
(def left-margin 100)
77
(def right-margin 100)
88
(def boxes-per-row 32)
9-
(draw-column-headers {:height 20 :font-size 18 :labels (reverse ["0" "1" "2" "" "4" "5" "6" "" "" "SDPLEN+5" "" "" "" "" "" "15" "16" "17" "18" "19" "" "" "" "" "" "" "" "" "" "" "" "XLEN-1"])})
9+
(draw-column-headers {:height 20 :font-size 18 :labels (reverse ["0" "1" "2" "3" "4" "5" "6" "" "" "SDPLEN+5" "" "" "" "" "" "15" "16" "17" "18" "19" "" "" "" "" "" "" "" "" "" "" "" "XLEN-1"])})
1010

1111
(draw-box "Reserved" {:span 13})
1212
(draw-box "R" {:span 1})
@@ -15,18 +15,22 @@
1515
(draw-box "Reserved" {:span 6})
1616
(draw-box "SDP" {:span 4})
1717
(draw-box "C" {:span 1})
18-
(draw-box "Reserved" {:span 3})
18+
(draw-box "CL" {:span 1})
19+
(draw-box "SL" {:span 1})
20+
(draw-box "EL" {:span 1})
1921
(draw-box "LM" {:span 1})
2022
(draw-box "W" {:span 1})
2123

2224
(draw-box "XLEN-19" {:span 13 :borders {}})
2325
(draw-box "1" {:span 1 :borders {}})
2426
(draw-box "1" {:span 1 :borders {}})
2527
(draw-box "1" {:span 1 :borders {}})
26-
(draw-box "8" {:span 6 :borders {}})
28+
(draw-box "10-SDPLEN" {:span 6 :borders {}})
2729
(draw-box "SDPLEN" {:span 4 :borders {}})
2830
(draw-box "1" {:span 1 :borders {}})
29-
(draw-box "3" {:span 3 :borders {}})
31+
(draw-box "1" {:span 1 :borders {}})
32+
(draw-box "1" {:span 1 :borders {}})
33+
(draw-box "1" {:span 1 :borders {}})
3034
(draw-box "1" {:span 1 :borders {}})
3135
(draw-box "1" {:span 1 :borders {}})
3236
----

src/img/cap-encoding-xlen32.edn

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66
(def left-margin 100)
77
(def right-margin 100)
88
(def boxes-per-row 32)
9-
(draw-column-headers {:height 50 :font-size 22 :labels (reverse ["0" "1" "2" "" "" "" "" "" "" "9" "10" "11" "12" "" "" "" "" "17" "18" "19" "20" "21" "" "" "24" "25" "" "" "" "29" "30" "31"])})
9+
(draw-column-headers {:height 50 :font-size 22 :labels (reverse ["0" "1" "2" "" "" "" "" "" "" "9" "10" "11" "12" "" "" "" "" "17" "18" "19" "20" "21" "" "23" "24" "25" "" "" "" "29" "30" "31"])})
1010

1111
(draw-box "SDP" {:span 2})
1212
(draw-box "AP, M" {:span 5})
13-
(draw-box "Reserved" {:span 4})
13+
(draw-box "CL" {:span 1})
14+
(draw-box "Reserved" {:span 3})
1415
(draw-box "CT" {:span 1})
1516
(draw-box "EF" {:span 1})
1617
(draw-box "L8" {:span 1})

src/img/cap-encoding-xlen64.edn

+4-3
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@
66
(def left-margin 100)
77
(def right-margin 100)
88
(def boxes-per-row 32)
9-
(draw-column-headers {:height 50 :font-size 22 :labels (reverse ["0" "2" "3" "" "" "" "13" "14" "16" "17" "" "" "25" "26" "27" "28" "" "" "" "" "45" "46" "" "" "51" "52" "53" "56" "57" "" "" "63"])})
9+
(draw-column-headers {:height 50 :font-size 22 :labels (reverse ["0" "2" "3" "" "" "" "13" "14" "16" "17" "" "" "25" "26" "27" "28" "" "42" "43" "44" "" "" "" "" "51" "52" "53" "56" "57" "" "" "63"])})
1010

1111
(draw-box "Reserved" {:span 4})
1212
(draw-box "SDP" {:span 2})
1313
(draw-box "M" {:span 1})
14-
(draw-box "AP" {:span 4})
15-
(draw-box "Reserved" {:span 6})
14+
(draw-box "AP" {:span 6})
15+
(draw-box "CL" {:span 1})
16+
(draw-box "Reserved" {:span 3})
1617
(draw-box "CT" {:span 1})
1718
(draw-box "EF" {:span 1})
1819
(draw-box "T[11:3]" {:span 4})

src/img/htval2reg.edn

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
(def boxes-per-row 32)
99
(draw-column-headers {:height 20 :font-size 18 :labels (reverse ["0" "" "" "3" "4" "" "" "" "" "" "" "" "" "" "" "15" "16" "" "" "19" "20" "" "" "" "" "" "" "" "" "" "" "HSXLEN-1"])})
1010

11-
(draw-box "Reserved" {:span 12})
11+
(draw-box "WPRI" {:span 12})
1212
(draw-box "TYPE" {:span 4})
13-
(draw-box "Reserved" {:span 12})
13+
(draw-box "WPRI" {:span 12})
1414
(draw-box "CAUSE" {:span 4})
1515

1616
(draw-box "HSXLEN-20" {:span 12 :borders {}})
50.3 KB
Loading

src/img/large_cheri_system.drawio.png

65.9 KB
Loading

src/img/mtval2reg.edn

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
(def boxes-per-row 32)
99
(draw-column-headers {:height 20 :font-size 18 :labels (reverse ["0" "" "" "3" "4" "" "" "" "" "" "" "" "" "" "" "15" "16" "" "" "19" "20" "" "" "" "" "" "" "" "" "" "" "MXLEN-1"])})
1010

11-
(draw-box "Reserved" {:span 12})
11+
(draw-box "WPRI" {:span 12})
1212
(draw-box "TYPE" {:span 4})
13-
(draw-box "Reserved" {:span 12})
13+
(draw-box "WPRI" {:span 12})
1414
(draw-box "CAUSE" {:span 4})
1515

1616
(draw-box "MXLEN-20" {:span 12 :borders {}})

src/img/small_cheri_system.drawio.png

25.8 KB
Loading

src/img/stval2reg.edn

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
(def boxes-per-row 32)
99
(draw-column-headers {:height 20 :font-size 18 :labels (reverse ["0" "" "" "3" "4" "" "" "" "" "" "" "" "" "" "" "15" "16" "" "" "19" "20" "" "" "" "" "" "" "" "" "" "" "SXLEN-1"])})
1010

11-
(draw-box "Reserved" {:span 12})
11+
(draw-box "WPRI" {:span 12})
1212
(draw-box "TYPE" {:span 4})
13-
(draw-box "Reserved" {:span 12})
13+
(draw-box "WPRI" {:span 12})
1414
(draw-box "CAUSE" {:span 4})
1515

1616
(draw-box "SXLEN-20" {:span 12 :borders {}})

src/img/vstval2reg.edn

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
(def boxes-per-row 32)
99
(draw-column-headers {:height 20 :font-size 18 :labels (reverse ["0" "" "" "3" "4" "" "" "" "" "" "" "" "" "" "" "15" "16" "" "" "19" "20" "" "" "" "" "" "" "" "" "" "" "VSXLEN-1"])})
1010

11-
(draw-box "Reserved" {:span 12})
11+
(draw-box "WPRI" {:span 12})
1212
(draw-box "TYPE" {:span 4})
13-
(draw-box "Reserved" {:span 12})
13+
(draw-box "WPRI" {:span 12})
1414
(draw-box "CAUSE" {:span 4})
1515

1616
(draw-box "VSXLEN-20" {:span 12 :borders {}})

src/insns/acperm_32bit.adoc

+8
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ The common rules are:
5050
.. Clear <<m_bit>> unless <<x_perm>> is set
5151
. <<lm_perm>> cannot be set without <<c_perm>> being set
5252
.. Clear <<lm_perm>> unless <<c_perm>> is set.
53+
. <<sl_perm>> cannot be set without <<c_perm>> being set
54+
.. Zero <<sl_perm>> unless <<c_perm>> is set.
55+
. <<el_perm>> cannot be set without <<c_perm>> being set
56+
.. Zero <<sl_perm>> unless <<c_perm>> is set.
5357

5458
NOTE: The combination of <<x_perm>> clear and <<m_bit>> set is reserved for future extensions.
5559

@@ -64,6 +68,10 @@ The MXLEN=32 additional rules are:
6468
[#acperm_bit_field]
6569
include::../img/acperm_bit_field.edn[]
6670

71+
NOTE: The <<el_perm,EL>>, <<sl_perm,SL>> and <<section_cap_level,CL>> fields are only defined if the implementation supports <<section_ext_cheri_levels,{cheri_levels_ext_name}>>.
72+
73+
NOTE: Even though being included here <<section_cap_level,CL>> is not considered an architectural permission.
74+
6775
Exceptions::
6876
include::require_cre.adoc[]
6977

src/insns/atomic_exceptions.adoc

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ Requires <<r_perm>> and <<w_perm>> in the authorising capability.
66
+
77
If <<c_perm>> is not granted then store the memory tag as zero, and load `cd.tag` as zero.
88
+
9-
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 final permissions on `cd` (see <<LC>>).
9+
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` (see <<LC>>).
10+
+
11+
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 <<section_cap_level>> to the level of the authorizing capability is performed to obtain the final permissions on `cd` (see <<LC>>).
1012
+
1113
endif::[]
1214
ifndef::cap_atomic[]

src/insns/auipc_32bit.adoc

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
Synopsis::
77
Add upper immediate to *pc*/<<pcc>>
88

9+
NOTE: CHERI extensions which use an alternative capability format may choose to redefine the handling of the immediate operand for this instruction in {cheri_cap_mode_name}.
10+
911
{cheri_cap_mode_name} Mnemonic::
1012
`auipc cd, imm`
1113

src/insns/hypv-virt-loadx.adoc

+4-6
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,19 @@
55

66
See <<HLVX_WU>>.
77

8-
<<<
9-
108
[#HLVX_WU,reftext="HLVX.WU"]
119
==== HLVX.WU
1210

1311
Synopsis::
1412
Hypervisor virtual machine load from executable memory
1513

1614
{cheri_cap_mode_name} Mnemonics::
17-
`hlv.hu rd, cs1` +
18-
`hlv.wu rd, cs1`
15+
`hlvx.hu rd, cs1` +
16+
`hlvx.wu rd, cs1`
1917

2018
{cheri_int_mode_name} Mnemonics::
21-
`hlv.hu rd, rs1` +
22-
`hlv.wu rd, rs1`
19+
`hlvx.hu rd, rs1` +
20+
`hlvx.wu rd, rs1`
2321

2422
Encoding::
2523
include::wavedrom/hypv-virt-loadx.adoc[]

src/insns/hypv-virt-store-cap.adoc

+4-6
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,17 @@ include::wavedrom/hypv-virt-store-cap.adoc[]
1919
Store a CLEN+1 bit value in `cs2` to memory as though V=1; i.e., with the
2020
address translation and protection, and endianness, that apply to memory
2121
accesses in either VS-mode or VU-mode. The effective address is the address of
22-
`cs1`. The authorising capability for the operation is `cs1`. The capability
23-
written to memory has the tag set to 0 if the tag of `cs2` is 0 or `cs1` does
24-
not grant <<c_perm>>.
22+
`cs1`. The authorising capability for the operation is `cs1`.
2523
+
2624
include::load_store_c0.adoc[]
2725

2826
{cheri_int_mode_name} Description::
2927
Store a CLEN+1 bit value in `cs2` to memory as though V=1; i.e., with the
3028
address translation and protection, and endianness, that apply to memory
3129
accesses in either VS-mode or VU-mode. The effective address is the `rs1`. The
32-
authorising capability for the operation is <<ddc>>. The capability written to
33-
memory has the tag set to 0 if the tag of `cs2` is 0 or <<ddc>> does not grant
34-
<<c_perm>>.
30+
authorising capability for the operation is <<ddc>>.
31+
32+
include::store_tag_perms.adoc[]
3533

3634
include::malformed_no_check.adoc[]
3735

src/insns/load_tag_perms.adoc

+6-1
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@ Resulting value of `cd`::
22
The tag value written to `cd` is 0 if the tag of the memory location loaded is
33
0 or the authorizing capability (<<ddc>> or `cs1`) does not grant <<c_perm>>.
44
+
5-
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 final permissions on `cd`.
5+
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`.
6+
+
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 <<section_cap_level>> to the level of the authorizing capability is performed to obtain the final permissions on `cd`.
68

79
NOTE: Missing <<lm_perm>> does not affect untagged values since this could result in surprising bit patterns when copying non-capability data.
810
Similarly, sealed capabilities are not modified as they are not directly dereferenceable.
911

12+
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.
13+
However, untagged values are not affected by <<el_perm>>.
14+
1015
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>>.

0 commit comments

Comments
 (0)