]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
arm/arm64: KVM: arch_timer: Initialize cntvoff at kvm_init
authorChristoffer Dall <christoffer.dall@linaro.org>
Sat, 16 Nov 2013 18:51:25 +0000 (10:51 -0800)
committerJiri Slaby <jslaby@suse.cz>
Thu, 30 Apr 2015 09:14:59 +0000 (11:14 +0200)
commit a1a64387adeeba7a34ce06f2774e81f496ee803b upstream.

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>
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
arch/arm/kvm/arm.c
virt/kvm/arm/vgic.c

index 9c697db2787e2a524cf59db4519f5272fa2918b0..847d2804253c624b6df5ccf88ef8ba512748304e 100644 (file)
@@ -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;
 
index b001dbff0f38fcdc3e33dc80a2f149484de3afee..14d7b51bb22354fc10fcb32b75c66783c06419b0 100644 (file)
@@ -1410,7 +1410,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);