Skip to content
This repository was archived by the owner on Dec 3, 2024. It is now read-only.
This repository was archived by the owner on Dec 3, 2024. It is now read-only.

a review of v0.1 focusing on VMs and forward compatibility #2

@sorear

Description

@sorear
  1. "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?

  2. 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.

  3. SEN has the function of a mstateen bit and should be required to be 0 at reset for the reasons described in the Smstateen specification.

  4. VSTE is the only control bit not allocated an index in mctrcontrol. If it had one, M-mode code would not need to reference vsctrcontrol for emulation or context swaps.

  5. We don't need names for VS or VU in sctrcontrol since they are also available in vsctrcontrol. Bits [4:3] in both CSRs can be defined as read-only zero, saving two of the three fake-virtualization bits.

  6. 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 new hctrcontrol, or vsctrcontrol, assuming in the latter case that the new bit is hidden when it is accessed as sctrcontrol in VS-mode).

  7. I think that the current handling of DEPTH in vsctrcontrol and sctrcontrol is fine, since it can be configured in a privilege mode iff filtering can be configured in that privilege mode.

  8. Clarify accessibility of vsctrcontrol. Since it contains the only name of VSTE, 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 is prv = M OR (prv = HS AND mctrcontrol.SEN).

  9. We should specify the behavior of attempting to access entry registers using vsireg. (Always illegal instruction?)

  10. WPRI should only apply to the undefined portions of the Entry Registers, not the whole registers.

  11. Why are ctrsource.V and ctrtarget.MISP in address fields when we have a perfectly good ctrdata?

  12. Is there a difference between TYPE 0 or 4 (Undefined) and 7 (Reserved)?

  13. It could be a little clearer (in the ctrdata and mctrcontrol 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.

  14. If one of ctrtarget and ctrdata.CC is going to be optional, only one of them can be inferred from ctrsource in most dynamical cases.

  15. 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.

  16. "Target Mode > Source Mode" column header is unclear, suggest explicit column headers.

  17. Are the filtering bits in mctrcontrol honored when RASEMU=1?

  18. 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?

  19. If an ebreak instruction is executed with dcsr.ebreakx=1 and Debug Mode is entered, is this considered a "breakpoint exception" for the purposes of BPFRZ?

  20. "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"?

  21. 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions