From mboxrd@z Thu Jan 1 00:00:00 1970 From: Izik Eidos Subject: Re: [PATCH] kvm-userspace: fix memslot assignment Date: Thu, 31 Jul 2008 15:03:12 +0300 Message-ID: <4891AA00.7060009@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> <4891A0DD.5000503@qumranet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Christian Borntraeger , kvm , Carsten Otte , Olaf Schnapper , Christian Ehrhardt , Izik Eidus To: Avi Kivity Return-path: Received: from il.qumranet.com ([212.179.150.194]:54933 "EHLO il.qumranet.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753540AbYGaMDR (ORCPT ); Thu, 31 Jul 2008 08:03:17 -0400 In-Reply-To: <4891A0DD.5000503@qumranet.com> Sender: kvm-owner@vger.kernel.org List-ID: Avi Kivity wrote: > 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? yea kernels that dont have KVM_CAP_SET_TSS_ADDR should be treated like that. > >> +#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. >