riscv / riscv-control-transfer-records

This repo contains a RISC-V ISA extension (proposal) to allow recording of control transfer history to on-chip registers, to support usages associated with profiling and debug.
https://jira.riscv.org/browse/RVG-62
Creative Commons Attribution 4.0 International
15 stars 4 forks source link

hstateen0.CTR does not affect access to sctrdepth #21

Closed jhauser-us closed 6 months ago

jhauser-us commented 7 months ago

Chapter 5, "State Enable Access Control", says:

If the H extension is implemented and mstateen0.CTR=1, the hstateen0.CTR bit controls access to supervisor CTR state when V=1. This state includes ... sctrdepth ....

Actually, an attempt to access sctrdepth when virtualization mode V = 1 always raises an exception, either an illegal-instruction exception if mstateen0.CTR = 0 or a virtual-instruction exception if mstateen0.CTR = 1. The value of hstateen0.CTR is irrelevant to this case.