Skip to content

Commit a1a6438

Browse files
committed
arm/arm64: KVM: arch_timer: Initialize cntvoff at kvm_init
Initialize the cntvoff at kvm_init_vm time, not before running the VCPUs at the first time because that will overwrite any potentially restored values from user space. Cc: Andre Przywara <andre.przywara@linaro.org> Acked-by: Marc Zynger <marc.zyngier@arm.com> Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
1 parent 989c6b3 commit a1a6438

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

‎arch/arm/kvm/arm.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type)
137137
if (ret)
138138
goto out_free_stage2_pgd;
139139

140+
kvm_timer_init(kvm);
141+
140142
/* Mark the initial VMID generation invalid */
141143
kvm->arch.vmid_gen = 0;
142144

‎virt/kvm/arm/vgic.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1409,7 +1409,6 @@ int kvm_vgic_init(struct kvm *kvm)
14091409
for (i = VGIC_NR_PRIVATE_IRQS; i < VGIC_NR_IRQS; i += 4)
14101410
vgic_set_target_reg(kvm, 0, i);
14111411

1412-
kvm_timer_init(kvm);
14131412
kvm->arch.vgic.ready = true;
14141413
out:
14151414
mutex_unlock(&kvm->lock);

0 commit comments

Comments
 (0)