Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a1a64387 authored by Christoffer Dall's avatar Christoffer Dall
Browse files

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: default avatarMarc Zynger <marc.zyngier@arm.com>
Signed-off-by: default avatarChristoffer Dall <christoffer.dall@linaro.org>
parent 989c6b34
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -137,6 +137,8 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type)
	if (ret)
		goto out_free_stage2_pgd;

	kvm_timer_init(kvm);

	/* Mark the initial VMID generation invalid */
	kvm->arch.vmid_gen = 0;

+0 −1
Original line number Diff line number Diff line
@@ -1409,7 +1409,6 @@ int kvm_vgic_init(struct kvm *kvm)
	for (i = VGIC_NR_PRIVATE_IRQS; i < VGIC_NR_IRQS; i += 4)
		vgic_set_target_reg(kvm, 0, i);

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