KVM: VMX: Modify NMI and INTR handlers to take intr_info as function argument
authorSean Christopherson <seanjc@google.com>
Mon, 22 Jan 2024 23:54:00 +0000 (15:54 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 12 Apr 2024 08:42:24 +0000 (04:42 -0400)
commit2325a21ac1e913de7723cdfef360e56319a268bf
treef8a527a4715ffe4fa9b49790c5c1021aab7f1c52
parent5f18c642ff7e2106559388b055ba291fb48f58a5
KVM: VMX: Modify NMI and INTR handlers to take intr_info as function argument

TDX uses different ABI to get information about VM exit.  Pass intr_info to
the NMI and INTR handlers instead of pulling it from vcpu_vmx in
preparation for sharing the bulk of the handlers with TDX.

When the guest TD exits to VMM, RAX holds status and exit reason, RCX holds
exit qualification etc rather than the VMCS fields because VMM doesn't have
access to the VMCS.  The eventual code will be

VMX:
  - get exit reason, intr_info, exit_qualification, and etc from VMCS
  - call NMI/INTR handlers (common code)

TDX:
  - get exit reason, intr_info, exit_qualification, and etc from guest
    registers
  - call NMI/INTR handlers (common code)

Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <0396a9ae70d293c9d0b060349dae385a8a4fbcec.1705965635.git.isaku.yamahata@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx/vmx.c