Skip to content

Commit

Permalink
add non-normative warning about perf implications if CTR is implement…
Browse files Browse the repository at this point in the history
…ed without State Enable (#1886)
  • Loading branch information
bcstrongx authored Mar 5, 2025
1 parent 7d41254 commit 3b9744f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/smctr.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,12 @@ When `hstateen0`.CTR=0, qualified control transfers executed while V=1 will cont
_See <<indirect-csr>> for how bit 60 in `mstateen0` and `hstateen0` can also restrict access to `sireg*`/`siselect` and `vsireg*`/`vsiselect` from privilege modes less privileged than M-mode._
====

[NOTE]
[%unbreakable]
====
_Implementations that support Smctr/Ssctr but not Smstateen/Ssstateen may observe reduced performance. Because Smctr/Ssctr introduces a significant number of new CSRs, it is desirable to avoid save/restore of CTR state when possible. A hypervisor is likely to leverage State Enable to trap on the initial guest access to CTR state, delegating CTR and enabling save/restore of guest CTR state only once the guest has begun to use it. Without Smstateen/Ssstateen, a hypervisor is required to save/restore guest CTR state on every context switch._
====

=== Behavior

CTR records qualified control transfers. Control transfers are qualified if they meet the following criteria:
Expand Down

0 comments on commit 3b9744f

Please sign in to comment.