From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Denis V. Lunev" Subject: Re: [PATCH] kvm_irqchip_assign_irqfd: just set irqfd in case of kvm_irqfds_enabled() Date: Fri, 26 Dec 2014 13:16:10 +0300 Message-ID: <549D356A.4050506@parallels.com> References: <1419581126-12927-1-git-send-email-tiejun.chen@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit Cc: QEMU Trivial , Paolo Bonzini , QEMU Developers , kvm-devel To: Peter Maydell , Tiejun Chen Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org Sender: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org List-Id: kvm.vger.kernel.org On 26/12/14 13:00, Peter Maydell wrote: > On 26 December 2014 at 08:05, Tiejun Chen wrote: >> We should avoid to set irqfd{} unconditionally. >> >> Signed-off-by: Tiejun Chen > > Is there a hot path that we use this on such that the difference > in code order matters at all? > > thanks > -- PMM > IMHO the patch does not change anything even on hot-hot path. the declaration 'struct kvm_irqfd irqfd = {};' will result in memset inside. Thus in order to achieve declared goal author should declare struct kvm_irqfd irqfd; and perform memset(&irqfd, 0, sizeof(irqfd)); later after the check. Regards, Den