-
Notifications
You must be signed in to change notification settings - Fork 0
a review of v0.1 focusing on VMs and forward compatibility #2
Description
-
"CTR" is likely to be confused with "counter" in the abbreviations of various CSRs. I suppose it's too late to use "CXR" or something else?
-
We need clear guidance about whether bits of
mctrcontrol
which are not defined in the current specification should be set to 0 or 1 by software. The forward compatibility requirements are presently inconsistent between hypothetical new control transfer types (which are 1 to ignore) and hypothetical new modes (0 to ignore). Current examples of unused portions of multi-function bitfield registers are either WPRI (mstatus, hstatus, menvcfg, mseccfg, fcsr) or have ad-hoc reserved rules (effectively WLRL); WARL seems inappropriate in either case. -
SEN
has the function of amstateen
bit and should be required to be 0 at reset for the reasons described in the Smstateen specification. -
VSTE
is the only control bit not allocated an index inmctrcontrol
. If it had one, M-mode code would not need to referencevsctrcontrol
for emulation or context swaps. -
We don't need names for
VS
orVU
insctrcontrol
since they are also available invsctrcontrol
. Bits[4:3]
in both CSRs can be defined as read-only zero, saving two of the three fake-virtualization bits. -
sctrcontrol.VSEN
should always exist as a writable field, regardless of the H extension, as part of the minimal support required to emulate the H-extension using M-mode primitives. Alternatively,VSEN
can be moved to a CSR accessible only in HS-mode (a newhctrcontrol
, orvsctrcontrol
, assuming in the latter case that the new bit is hidden when it is accessed assctrcontrol
in VS-mode). -
I think that the current handling of
DEPTH
invsctrcontrol
andsctrcontrol
is fine, since it can be configured in a privilege mode iff filtering can be configured in that privilege mode. -
Clarify accessibility of
vsctrcontrol
. Since it contains the only name ofVSTE
, it must be accessible for higher modes even if access to the CTR unit is disabled or mediated by VSEN=0. I think the correct check isprv = M OR (prv = HS AND mctrcontrol.SEN)
. -
We should specify the behavior of attempting to access entry registers using
vsireg
. (Always illegal instruction?) -
WPRI should only apply to the undefined portions of the Entry Registers, not the whole registers.
-
Why are
ctrsource.V
andctrtarget.MISP
in address fields when we have a perfectly goodctrdata
? -
Is there a difference between TYPE 0 or 4 (Undefined) and 7 (Reserved)?
-
It could be a little clearer (in the
ctrdata
andmctrcontrol
definitions) that the numeric values and precise definitions of the control transfer types are from "4.1D Instruction Trace Interface requirements" and "Table 4.4: Instruction Type (itype) encoding" in the E-trace spec, although the names are slightly different. In particular, there is no indication in this draft of which registers are used to distinguish calls, returns, and jumps. -
If one of
ctrtarget
andctrdata.CC
is going to be optional, only one of them can be inferred fromctrsource
in most dynamical cases. -
Clarify that unsupported fields will read as zero in newly added entries; the text as written implies that fields could be picked up from an unrelated entry.
-
"Target Mode > Source Mode" column header is unclear, suggest explicit column headers.
-
Are the filtering bits in
mctrcontrol
honored whenRASEMU
=1? -
A single trap can service multiple interrupts (e.g. using a loop on
mtopi
). At what point do we consider "a LCOFI is taken"? Would it be more appropriate for the freeze to occur at some point after the LCOFI becomes pending? -
If an
ebreak
instruction is executed withdcsr.ebreakx
=1 and Debug Mode is entered, is this considered a "breakpoint exception" for the purposes ofBPFRZ
? -
"Writing all 1s to the Entry Registers at entry 0" is not permissible because the Entry Registers are defined as WPRI, and therefore software may only change the defined portions. "Writing 1s to all defined fields of the Entry Registers at entry 0"?
-
Discovering xctrcontrol features by writing all 1s is similarly problematic if future fields have effects when written. Write all 1s to defined fields of xctrcontrol?