On Tue, Mar 18, 2025 at 12:35:07AM -0600, Vishal Verma wrote: >In preparation for a cleanup of the x86_ops struct for TDX, which turns >several of the ops definitions to macros, move the >vt_apicv_pre_state_restore() helper into posted_intr.c. This doesn't explain how the movement is related to that cleanup. how about: 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. > >Based on a patch by Sean Christopherson <seanjc@xxxxxxxxxx> You can consider adding his Suggested-by. >-static void vt_apicv_pre_state_restore(struct kvm_vcpu *vcpu) >-{ >- struct pi_desc *pi = vcpu_to_pi_desc(vcpu); With this removal, vcpu_to_pi_desc() is only used within posted_intr.c. no need to expose it.