From 8ae8a62ba4c3b17508c3214acb94a49c08c7440a Mon Sep 17 00:00:00 2001 From: PeterRugg Date: Fri, 4 Aug 2023 17:49:34 +0100 Subject: [PATCH] Discuss DDC-base vs DDC-address offsetting (#87) --- chap-cheri-riscv.tex | 8 ++++++-- chap-rationale.tex | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/chap-cheri-riscv.tex b/chap-cheri-riscv.tex index 4bf78255..263581f7 100644 --- a/chap-cheri-riscv.tex +++ b/chap-cheri-riscv.tex @@ -1199,8 +1199,12 @@ \subsection{\DDC{} and \PCC{} Relocation} CHERI-RISC-V originally specified that legacy memory accesses using integer pointers were relocated by \DDC{} and \PCC{} in addition to being constrained. In this model, integer pointers were treated as -offsets relative to the base of \DDC{} and \PCC{} rather than -addresses. +offsets relative to the address of \DDC{} or base of \PCC{}\footnote{% +While offsetting with respect to \DDC{}'s address avoids unnecessary +alignment requirements, the base of \PCC{} must be used since its +address must change as the program runs, so cannot be used for +offsetting.} +rather than addresses. The current version of CHERI-RISC-V does not relocate integer pointers. However, it may be desirable to provide optional relocation diff --git a/chap-rationale.tex b/chap-rationale.tex index bbd2513b..b642ac0a 100644 --- a/chap-rationale.tex +++ b/chap-rationale.tex @@ -1470,7 +1470,9 @@ \section{\DDC{} and \PCC{} Offsetting} Originally, CHERI always treated integer pointers used for legacy memory accesses as offsets. For example, loads and stores using an integer pointer treated integer address as an offset relative to the -base of \DDC{}. Similarly, branch instructions which targeted an +base of \DDC{}\footnote{Some CHERI instantiations performed offsetting +with respect to the address of DDC, rather than the base.}. +Similarly, branch instructions which targeted an absolute integer pointer set the offset of \PCC{} to the value of the integer pointer.