Please do not duplicate code, for example:
On 3/4/22 20:49, isaku.yamahata@xxxxxxxxx wrote:
+void tdx_apicv_post_state_restore(struct kvm_vcpu *vcpu)
+{
+ struct vcpu_tdx *tdx = to_tdx(vcpu);
+
+ pi_clear_on(&tdx->pi_desc);
+ memset(tdx->pi_desc.pir, 0, sizeof(tdx->pi_desc.pir));
+}
This is the same as vmx_apicv_post_state_restore. Please write this like:
void vt_apicv_post_state_restore(struct kvm_vcpu *vcpu)
{
struct pi_desc *pi = vcpu_to_pi_desc(vcpu);
pi_clear_on(pi);
memset(pi->pir, 0, sizeof(pi->pir));
}
Otherwise,
Reviewed-by: Paolo Bonzini <pbonzini@xxxxxxxxxx>
Paolo