]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
KVM: nVMX: Read EXIT_QUAL and INTR_INFO only when needed for nested exit
authorSean Christopherson <sean.j.christopherson@intel.com>
Wed, 23 Sep 2020 20:13:49 +0000 (13:13 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 28 Sep 2020 11:57:53 +0000 (07:57 -0400)
Read vmcs.EXIT_QUALIFICATION and vmcs.VM_EXIT_INTR_INFO only if the
VM-Exit is being reflected to L1 now that they are no longer passed
directly to the kvm_nested_vmexit tracepoint.

No functional change intended.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Message-Id: <20200923201349.16097-8-sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx/nested.c

index 632b52e20383697a735d87eecfe09625de83e8d7..aa92047107054eeb227fc7cdb5153d43f10aa580 100644 (file)
@@ -5934,9 +5934,6 @@ bool nested_vmx_reflect_vmexit(struct kvm_vcpu *vcpu)
                goto reflect_vmexit;
        }
 
-       exit_intr_info = vmx_get_intr_info(vcpu);
-       exit_qual = vmx_get_exit_qual(vcpu);
-
        trace_kvm_nested_vmexit(exit_reason, vcpu, KVM_ISA_VMX);
 
        /* If L0 (KVM) wants the exit, it trumps L1's desires. */
@@ -5953,12 +5950,14 @@ bool nested_vmx_reflect_vmexit(struct kvm_vcpu *vcpu)
         * need to be synthesized by querying the in-kernel LAPIC, but external
         * interrupts are never reflected to L1 so it's a non-issue.
         */
+       exit_intr_info = vmx_get_intr_info(vcpu);
        if (is_exception_with_error_code(exit_intr_info)) {
                struct vmcs12 *vmcs12 = get_vmcs12(vcpu);
 
                vmcs12->vm_exit_intr_error_code =
                        vmcs_read32(VM_EXIT_INTR_ERROR_CODE);
        }
+       exit_qual = vmx_get_exit_qual(vcpu);
 
 reflect_vmexit:
        nested_vmx_vmexit(vcpu, exit_reason, exit_intr_info, exit_qual);