From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] kvm-userspace: fix memslot assignment Date: Thu, 31 Jul 2008 14:24:13 +0300 Message-ID: <4891A0DD.5000503@qumranet.com> References: <200807251738.29171.borntraeger@de.ibm.com> <200807281855.04681.borntraeger@de.ibm.com> <488F18B9.1010700@qumranet.com> <200807311001.07426.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 , Izik Eidus To: Christian Borntraeger Return-path: Received: from il.qumranet.com ([212.179.150.194]:46538 "EHLO il.qumranet.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751873AbYGaLYP (ORCPT ); Thu, 31 Jul 2008 07:24:15 -0400 In-Reply-To: <200807311001.07426.borntraeger@de.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: Christian Borntraeger wrote: > Am Dienstag, 29. Juli 2008 schrieb Avi Kivity: > >> They all start with 0 AFAIK (kvm also starts with 0, it just wants it to >> be a special slot). >> > > Now my brain hurts.... > Ok, so I read this as: ppc, ia64 and s390 can start with slot 0 and it is not a special slot. > On x86 slot 0 is special, if > * KVM_CAP_SET_TSS_ADDR is not available > or > * The ioctl VM_CAP_SET_TSS_ADDR returns <=0 > > I think this is right. Izik can you confirm? > +#if defined(__x86_64__) || defined(__i386__) > +#if defined(KVM_CAP_SET_TSS_ADDR) > + if (ioctl(kvm->fd, KVM_CHECK_EXTENSION, KVM_CAP_SET_TSS_ADDR) > 0) > Should be <= here? > + i++; > +#else > + i++; > +#endif > +#endif > Suggest a helper, kvm_supports_set_tss_addr(), to reduce further braindamage. -- error compiling committee.c: too many arguments to function