]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KVM: VMX: Move vt_apicv_pre_state_restore() to posted_intr.c and tweak name
authorVishal Verma <vishal.l.verma@intel.com>
Tue, 18 Mar 2025 06:35:07 +0000 (00:35 -0600)
committerSean Christopherson <seanjc@google.com>
Fri, 2 May 2025 20:37:25 +0000 (13:37 -0700)
commit84ad4d834ce98542ad2910cecb409ba8fcfffa4b
tree7f6ff0b06c6ad0133efacf838c565f59eb11efbf
parentf2d7993314a31bc3acd3cb224f9866e90c5c96d8
KVM: VMX: Move vt_apicv_pre_state_restore() to posted_intr.c and tweak name

In preparation for a cleanup of the kvm_x86_ops struct for TDX, all vt_*
functions are expected to act as glue functions that route to either tdx_*
or vmx_* based on the VM type. Specifically, the pattern is:

vt_abc:
    if (is_td())
        return tdx_abc();
    return vmx_abc();

But vt_apicv_pre_state_restore() does not follow this pattern. To
facilitate that cleanup, rename and move vt_apicv_pre_state_restore() into
posted_intr.c.

Opportunistically turn vcpu_to_pi_desc() back into a static function, as
the only reason it was exposed outside of posted_intr.c was for
vt_apicv_pre_state_restore().

No functional change intended.

Suggested-by: Sean Christopherson <seanjc@google.com>
Link: https://lore.kernel.org/kvm/Z6v9yjWLNTU6X90d@google.com/
Cc: Sean Christopherson <seanjc@google.com>
Cc: Rick Edgecombe <rick.p.edgecombe@intel.com>
Reviewed-by: Binbin Wu <binbin.wu@linxu.intel.com>
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
Link: https://lore.kernel.org/r/20250318-vverma7-cleanup_x86_ops-v2-2-701e82d6b779@intel.com
[sean: apply Chao's suggestions, massage shortlog]
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/vmx/main.c
arch/x86/kvm/vmx/posted_intr.c
arch/x86/kvm/vmx/posted_intr.h