[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <220361fd-6375-5874-cb1c-f7c22794f64f@redhat.com>
Date: Wed, 6 Apr 2022 13:47:56 +0200
From: Paolo Bonzini <pbonzini@...hat.com>
To: isaku.yamahata@...el.com, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: isaku.yamahata@...il.com, Jim Mattson <jmattson@...gle.com>,
erdemaktas@...gle.com, Connor Kuehl <ckuehl@...hat.com>,
Sean Christopherson <seanjc@...gle.com>
Subject: Re: [RFC PATCH v5 078/104] KVM: TDX: Implement interrupt injection
Please do not duplicate code, for example:
On 3/4/22 20:49, isaku.yamahata@...el.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@...hat.com>
Paolo
Powered by blists - more mailing lists