diff --git a/chap-architecture.tex b/chap-architecture.tex index 80164fd7..b782b6bb 100644 --- a/chap-architecture.tex +++ b/chap-architecture.tex @@ -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 diff --git a/chap-rationale.tex b/chap-rationale.tex index b642ac0a..99923f0f 100644 --- a/chap-rationale.tex +++ b/chap-rationale.tex @@ -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.