]> git.ipfire.org Git - thirdparty/kernel/stable.git/blobdiff - arch/arm64/kvm/reset.c
Merge tag 'clang-format-for-linus-v5.1-rc5' of git://github.com/ojeda/linux
[thirdparty/kernel/stable.git] / arch / arm64 / kvm / reset.c
index f16a5f8ff2b41fa4284da58d1d2caf7af7b46e7b..e2a0500cd7a27c9ecc5326dd2380f23917309f91 100644 (file)
@@ -123,6 +123,9 @@ int kvm_reset_vcpu(struct kvm_vcpu *vcpu)
        int ret = -EINVAL;
        bool loaded;
 
+       /* Reset PMU outside of the non-preemptible section */
+       kvm_pmu_vcpu_reset(vcpu);
+
        preempt_disable();
        loaded = (vcpu->cpu != -1);
        if (loaded)
@@ -170,9 +173,6 @@ int kvm_reset_vcpu(struct kvm_vcpu *vcpu)
                vcpu->arch.reset_state.reset = false;
        }
 
-       /* Reset PMU */
-       kvm_pmu_vcpu_reset(vcpu);
-
        /* Default workaround setup is enabled (if supported) */
        if (kvm_arm_have_ssbd() == KVM_SSBD_KERNEL)
                vcpu->arch.workaround_flags |= VCPU_WORKAROUND_2_FLAG;