From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cornelia Huck Subject: Re: [PATCH v3 1/2] KVM: kvm-io: support cookies Date: Wed, 3 Jul 2013 16:14:39 +0200 Message-ID: <20130703161439.579c3a0f@gondolin> References: <1372859439-18733-1-git-send-email-cornelia.huck@de.ibm.com> <1372859439-18733-2-git-send-email-cornelia.huck@de.ibm.com> <20130703135642.GC32123@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20130703135642.GC32123@redhat.com> Sender: kvm-owner@vger.kernel.org List-Archive: List-Post: To: Gleb Natapov Cc: Paolo Bonzini , Christian Borntraeger , Heiko Carstens , Martin Schwidefsky , KVM , linux-s390 List-ID: On Wed, 3 Jul 2013 16:56:42 +0300 Gleb Natapov wrote: > On Wed, Jul 03, 2013 at 03:50:38PM +0200, Cornelia Huck wrote: > > Add new functions kvm_io_bus_{read,write}_cookie() that allows users of > > the kvm io infrastructure to use a cookie value to speed up lookup of a > > device on an io bus. > > > > kvm_io_bus_{read,write} now returns the index on the bus; existing callers > > have been fixed up to accept return codes > 0. > > > > Signed-off-by: Cornelia Huck > > --- > > arch/ia64/kvm/kvm-ia64.c | 2 +- > > arch/powerpc/kvm/powerpc.c | 4 +- > > arch/x86/kvm/x86.c | 6 +-- > > include/linux/kvm_host.h | 4 ++ > > virt/kvm/kvm_main.c | 102 ++++++++++++++++++++++++++++++++++++++------- > > 5 files changed, 97 insertions(+), 21 deletions(-) > > > > diff --git a/arch/ia64/kvm/kvm-ia64.c b/arch/ia64/kvm/kvm-ia64.c > > index 5b2dc0d..465ab54 100644 > > --- a/arch/ia64/kvm/kvm-ia64.c > > +++ b/arch/ia64/kvm/kvm-ia64.c > > @@ -250,7 +250,7 @@ mmio: > > else > > r = kvm_io_bus_write(vcpu->kvm, KVM_MMIO_BUS, p->addr, > > p->size, &p->data); > > - if (r) > > + if (r < 0) > No need to change kvm_io_bus_(read|write) return value now. Just do > there: > > r = __kvm_io_bus_write(bus, &range, val); > return r >=0 ? 0 : r; > Well, if the index is not interesting for anything but the cookie code, I can certainly drop it.