arm: Save VCPU virt timer registers when disabled

The virtual timer registers managed within a VCPU context are
not saved if written to, if the VCPU in question is disabled. This
results in any updates to the virtual timer registers being
lost/written over when that VCPU is next scheduled and context
switched in.

Co-authored-by: Gerwin Klein <gerwin.klein@proofcraft.systems>

Signed-off-by: Kent McLeod <kent@kry10.com>
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
This commit is contained in:
Alison Felizzi 2023-06-27 14:23:46 +10:00 committed by Gerwin Klein
parent e820aa91fe
commit 73e6b2e07a
2 changed files with 8 additions and 0 deletions

View file

@ -848,6 +848,11 @@ static inline bool_t vcpu_reg_saved_when_disabled(word_t field)
{
switch (field) {
case seL4_VCPUReg_SCTLR:
case seL4_VCPUReg_CNTV_CTL:
case seL4_VCPUReg_CNTV_CVALhigh:
case seL4_VCPUReg_CNTV_CVALlow:
case seL4_VCPUReg_CNTVOFFhigh:
case seL4_VCPUReg_CNTVOFFlow:
return true;
default:
return false;

View file

@ -744,6 +744,9 @@ static inline bool_t vcpu_reg_saved_when_disabled(word_t field)
switch (field) {
case seL4_VCPUReg_SCTLR:
case seL4_VCPUReg_CNTV_CTL:
case seL4_VCPUReg_CNTV_CVAL:
case seL4_VCPUReg_CNTVOFF:
case seL4_VCPUReg_CNTKCTL_EL1:
#ifdef CONFIG_HAVE_FPU
case seL4_VCPUReg_CPACR:
#endif