lkml.org 
[lkml]   [2022]   [Apr]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    SubjectRe: [RFC PATCH v5 078/104] KVM: TDX: Implement interrupt injection
    From
    Please do not duplicate code, for example:

    On 3/4/22 20:49, isaku.yamahata@intel.com 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@redhat.com>

    Paolo

    \
     
     \ /
      Last update: 2022-04-06 17:04    [W:4.053 / U:0.096 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site