From 3b9744f8dcf013a2ba2065c574ce1ad672414ae6 Mon Sep 17 00:00:00 2001 From: Beeman Strong <97133824+bcstrongx@users.noreply.github.com> Date: Tue, 4 Mar 2025 16:23:03 -0800 Subject: [PATCH] add non-normative warning about perf implications if CTR is implemented without State Enable (#1886) --- src/smctr.adoc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/smctr.adoc b/src/smctr.adoc index 9f54203f0..6560a9f44 100644 --- a/src/smctr.adoc +++ b/src/smctr.adoc @@ -425,6 +425,12 @@ When `hstateen0`.CTR=0, qualified control transfers executed while V=1 will cont _See <> 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: