From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pekka Enberg Subject: Re: [PATCH] kvm tools: virtio-mmio: init_ioeventfd should use MMIO for ioeventfd__add_event() Date: Wed, 04 Sep 2013 12:21:26 +0300 Message-ID: <5226FB96.1040001@iki.fi> References: <1377871094-7253-1-git-send-email-yingshiuan.pan@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, yspan@itri.org.tw, Asias He , Sasha Levin , Will Deacon , Marc Zyngier To: Ying-Shiuan Pan Return-path: Received: from out3-smtp.messagingengine.com ([66.111.4.27]:37582 "EHLO out3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762117Ab3IDJVa (ORCPT ); Wed, 4 Sep 2013 05:21:30 -0400 In-Reply-To: <1377871094-7253-1-git-send-email-yingshiuan.pan@gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: On 8/30/13 4:58 PM, Ying-Shiuan Pan wrote: > From: Ying-Shiuan Pan > > This patch fixes a bug that vtirtio_mmio_init_ioeventfd() passed a wrong > value when it invoked ioeventfd__add_event(). True value of 2nd parameter > indicates the eventfd uses PIO bus which is used by virito-pci, however, > for virtio-mmio, the value should be false. > > Signed-off-by: Ying-Shiuan Pan Will, Marc? It would probably be good to change the two boolean arguments into one "flags" argument to avoid future bugs. > --- > tools/kvm/virtio/mmio.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/tools/kvm/virtio/mmio.c b/tools/kvm/virtio/mmio.c > index afa2692..3838774 100644 > --- a/tools/kvm/virtio/mmio.c > +++ b/tools/kvm/virtio/mmio.c > @@ -55,10 +55,10 @@ static int virtio_mmio_init_ioeventfd(struct kvm *kvm, > * Vhost will poll the eventfd in host kernel side, > * no need to poll in userspace. > */ > - err = ioeventfd__add_event(&ioevent, true, false); > + err = ioeventfd__add_event(&ioevent, false, false); > else > /* Need to poll in userspace. */ > - err = ioeventfd__add_event(&ioevent, true, true); > + err = ioeventfd__add_event(&ioevent, false, true); > if (err) > return err; >