Skip to content

Commit 9dc15fc

Browse files
committed
Continued a little more reading; John, please check two pgnotes
1 parent 77ec4ae commit 9dc15fc

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

chap-rationale.tex

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
\chapter{Detailed Design Rationale}
1+
vvggg\chapter{Detailed Design Rationale}
22
\label{chap:rationale}
33

44
During the design of CHERI that began in 2010, we considered many
@@ -184,7 +184,7 @@ \section{The Compiler is Not Part of the TCB for Isolated Code}
184184
goal of CHERI that it be able to run legacy code written in C.
185185

186186
Some earlier capability machines, such as the Burroughs B5000, made the compiler
187-
a privileged program. We have followed the approach taken in capability machines
187+
a privileged program. We have followed the altenative approach taken in capability machines
188188
such as CAP, in which the compiler was not privileged.
189189

190190
\mrnote{We could expand on this, perhaps in the high-assurance section. We do depend
@@ -199,15 +199,15 @@ \section{The Compiler is Not Part of the TCB for Isolated Code}
199199
\section{Base and Length Versus Lower and Upper Bounds}
200200

201201
The CHERI architecture permits two different interpretations of capabilities:
202-
as a virtual address paired with lower and upper bounds; and as a base,
202+
as a virtual address paired with lower and upper bounds, and as a base,
203203
length, and current offset.
204204
These different interpretations support differing C-language models for
205205
pointers.
206-
The former, in which pointer casts to integers return their virtual addresses, is more compatible with current software, but risks leaking those virtual
206+
The former, in which pointer-casts to integers return their virtual addresses, is more compatible with current software, but risks leaking those virtual
207207
addresses (or their implications) out of tagged values where they cannot be
208208
found for the purposes of pointer-transformation techniques such as copying
209209
garbage collection.
210-
The latter, in which pointer casts to integers return their offsets, is less
210+
The latter, in which pointer-casts to integers return their offsets, is less
211211
compatible (as comparisons between pointers into different buffers may give
212212
surprising equality results), but avoids leakage of virtual address out of
213213
tagged values, enabling techniques such as copying garbage collection.
@@ -221,28 +221,31 @@ \section{Base and Length Versus Lower and Upper Bounds}
221221
For example, run-time linkers and memory allocators both naturally consider
222222
integer virtual addresses as part of their operation.
223223
More subtly, techniques such as ordering locks for objects based on object
224-
address, or sorting trees based on object address, makes copying garbage
224+
address, or sorting trees based on object address, make copying garbage
225225
collection a difficult prospect.
226+
\pgnnote{copying???}
226227
Compressed capabilities further complicate this story, as a precise lower
227228
bound may not be possible without padding; this is easy to arrange within
228229
memory allocators for new allocations, but when subsetting an existing
229230
allocation (e.g., to describe the bounds of an array embedded within another
230231
structure), the 0 offset from the bottom of the embedded structure may not
231232
carry over to being a 0 offset relative to the base address of a capability.
232233

233-
In recent versions of the CHERI C compiler, we have shifted to preferring a
234-
virtual-address interpretation of pointers in all cases except those where
235-
specific built-in functions are used to query the offset.
236-
We retain an optional compiler mode utilizing an offset interpretation, which
237-
will be suitable for future experimentation with copying garbage collection.
234+
In recent versions of the CHERI C compiler (with the CHERI-LLVM
235+
back-end), we have shifted to preferring a virtual-address
236+
interpretation of pointers in all cases except those where specific
237+
built-in functions are used to query the offset. We retain an
238+
optional compiler mode utilizing an offset interpretation, which will
239+
be suitable for future experimentation with copying garbage
240+
collection.
238241

239242
\section{Signed and Unsigned Offsets}
240243

241244
In the CHERI instructions that take both a register offset and an immediate
242245
offset, the register offset is treated as unsigned integer, whereas the
243246
immediate offset is treated as a signed integer.
244247

245-
Register offsets are treated as unsigned so that given a capability to
248+
Register offsets are treated as unsigned, so that given a capability to
246249
the entire address space (except for the very last byte, as
247250
explained above), a register offset can be used to access any byte within it.
248251
Signed register offsets would have the disadvantage that negative offsets

0 commit comments

Comments
 (0)