Skip to contentSkip to conversation

target-arm: do not change CNTVOFF_EL2

RFC In review [email protected] 2 participants 2 messages Jul 9, 2015

lore
Share & tools
lore
#0 lore raw

RFC 1/1 target-arm: do not change CNTVOFF_EL2

From: Claudio Fontana <[email protected]>

after a vm is created, the cntvoff_el2 is already calculated for us by kvm, do not attempt to change it.

---
 target-arm/kvm.c | 5 +++++
 1 file changed, 5 insertions(+)

This is just an RFC to show where QEMU is causing the change of CNTVOFF_EL2. This fixes the issue for me, but maybe this is not the right way to do it?

Thanks,

Claudio

target-arm/kvm.c +5 -0
index 548bfd7..c5ad580 100644
@@ -421,6 +421,11 @@ bool write_list_to_kvmstate(ARMCPU *cpu)
         uint32_t v32;
         int ret;
 
+	if (regidx == KVM_REG_ARM_TIMER_CNT) {
+            /* do not cause a change of CNTVOFF_EL2. */
+            continue;
+	}
+
         r.id = regidx;
         switch (regidx & KVM_REG_SIZE_MASK) {
         case KVM_REG_SIZE_U32:
Signature · 1 line
1.8.5.3
#1 lore raw
Quoted 5 lines · On 9 July 2015 at 15:38, <[email protected]> wrote:

From: Claudio Fontana <[email protected]>

after a vm is created, the cntvoff_el2 is already calculated for us by kvm, do not attempt to change it.

Quoted 8 lines
---
 target-arm/kvm.c | 5 +++++
 1 file changed, 5 insertions(+)

This is just an RFC to show where QEMU is causing the change of CNTVOFF_EL2. This fixes the issue for me, but maybe this is not the right way to do it?

Yeah, pretty sure it isn't -- see the discussion in the kvmarm thread. We do want to fix this on the QEMU side, but not like this...

-- PMM