Skip to content

Commit

Permalink
Move proposal specific to split register-file
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterRugg authored and bsdjhb committed Aug 7, 2023
1 parent d156569 commit 0000cba
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
16 changes: 0 additions & 16 deletions chap-architecture.tex
Original file line number Diff line number Diff line change
Expand Up @@ -3173,22 +3173,6 @@ \section{Potential Future Changes to the CHERI Architecture}
represents, and the caller might want to restrict these permissions before
passing the sealed capability to another subsystem.

\item
Add instructions for copying non-capability data from a capability register
into a general-purpose integer register. A use case is when a function is called
with a parameter whose type is the union of a pointer and a non-pointer type,
such as an int. This parameter must be passed in a capability register, because
the tag needs to be preserved when it holds a capability. If the body of
the function accesses the non-capability branch of the union, it needs to
get the non-capability bits out of the capability register and into a general
purpose register. This can be done by spilling the capability register to the
stack and then reading it back into a general-purpose integer register, but a register
to register copy would be faster. (We need to investigate whether this happens
often enough for the optimization to be worthwhile).

With compressed 128-bit capabilities, two instructions are needed (to get
the upper and lower 64 bits of the capability register).

\item
Add an instruction that is like \insnref{CSetBounds} except that it
sets \cbase{} to the current \cbase{} $+$ \coffset{} and the new length
Expand Down
12 changes: 12 additions & 0 deletions chap-rationale.tex
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,18 @@ \section{Capability Register File}
might be quite different; effectively pinning the two to one another would
reduce the efficiency of both.

With a split register file, it may be useful for the architecture to add
instructions for copying non-capability data from a capability register
into a general-purpose integer register. A use case is when a function is called
with a parameter whose type is the union of a pointer and a non-pointer type,
such as an int. This parameter must be passed in a capability register, because
the tag needs to be preserved when it holds a capability. If the body of
the function accesses the non-capability branch of the union, it needs to
get the non-capability bits out of the capability register and into a general
purpose register. This can be done by spilling the capability register to the
stack and then reading it back into a general-purpose integer register, but a register
to register copy would be faster.

CHERI-RISC-V (Chapter~\ref{chap:cheri-riscv}),
Morello, and CHERI-x86-64 (Chapter~\ref{chap:cheri-x86-64}) use merged register files.

Expand Down

0 comments on commit 0000cba

Please sign in to comment.