]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
Merge tag 'kvm-x86-pmu-6.7' of https://github.com/kvm-x86/linux into HEAD
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 31 Oct 2023 14:22:23 +0000 (10:22 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 31 Oct 2023 14:22:23 +0000 (10:22 -0400)
KVM PMU change for 6.7:

 - Handle NMI/SMI requests after PMU/PMI requests so that a PMI=>NMI doesn't
   require redoing the entire run loop due to the NMI not being detected until
   the final kvm_vcpu_exit_request() check before entering the guest.

arch/x86/kvm/x86.c

index 34a6c7b267c5d3bc80bc852442ffec1343899244..761e0b3c9be01d21aba7a807c70a114cc5fff40e 100644 (file)
@@ -10698,16 +10698,16 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu)
                }
                if (kvm_check_request(KVM_REQ_STEAL_UPDATE, vcpu))
                        record_steal_time(vcpu);
+               if (kvm_check_request(KVM_REQ_PMU, vcpu))
+                       kvm_pmu_handle_event(vcpu);
+               if (kvm_check_request(KVM_REQ_PMI, vcpu))
+                       kvm_pmu_deliver_pmi(vcpu);
 #ifdef CONFIG_KVM_SMM
                if (kvm_check_request(KVM_REQ_SMI, vcpu))
                        process_smi(vcpu);
 #endif
                if (kvm_check_request(KVM_REQ_NMI, vcpu))
                        process_nmi(vcpu);
-               if (kvm_check_request(KVM_REQ_PMU, vcpu))
-                       kvm_pmu_handle_event(vcpu);
-               if (kvm_check_request(KVM_REQ_PMI, vcpu))
-                       kvm_pmu_deliver_pmi(vcpu);
                if (kvm_check_request(KVM_REQ_IOAPIC_EOI_EXIT, vcpu)) {
                        BUG_ON(vcpu->arch.pending_ioapic_eoi > 255);
                        if (test_bit(vcpu->arch.pending_ioapic_eoi,