From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] kvm-userspace: fix memslot assignment Date: Sun, 27 Jul 2008 11:18:26 +0300 Message-ID: <488C2F52.4030209@qumranet.com> References: <200807251738.29171.borntraeger@de.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm , Carsten Otte , Olaf Schnapper , Christian Ehrhardt To: Christian Borntraeger Return-path: Received: from il.qumranet.com ([212.179.150.194]:10712 "EHLO il.qumranet.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750940AbYG0IS2 (ORCPT ); Sun, 27 Jul 2008 04:18:28 -0400 In-Reply-To: <200807251738.29171.borntraeger@de.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: Christian Borntraeger wrote: > Hello Avi, > > seems that I mixed up the slot initialization, instead of making the first > slot always 0 I made it always 1. Lets go back to Carstens variant, since I > dont like nested ifdefs. The compiler will remove the dead code anyway. > > Signed-off-by: Christian Borntraeger > > --- > libkvm.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > Index: libkvm/libkvm.c > =================================================================== > --- libkvm.orig/libkvm.c > +++ libkvm/libkvm.c > @@ -78,7 +78,7 @@ int get_free_slot(kvm_context_t kvm) > int i; > int tss_ext; > > -#if defined(KVM_CAP_SET_TSS_ADDR) && !defined(__s390__) > +#if defined(KVM_CAP_SET_TSS_ADDR) > tss_ext = ioctl(kvm->fd, KVM_CHECK_EXTENSION, KVM_CAP_SET_TSS_ADDR); > #else > tss_ext = 0; > This is really a no-op, since s390 will nack a KVM_CAP_SET_TSS_ADDR query. Of course, the change is an improvement. > @@ -92,8 +92,11 @@ int get_free_slot(kvm_context_t kvm) > if (tss_ext > 0) > i = 0; > else > +#if !defined(__s390__) > i = 1; > - > +#else > + i = 0; > +#endif > ppc and ia64 also don't care about TSS_ADDR. Care to make this depend on x86, rather than on s390? -- error compiling committee.c: too many arguments to function