From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Ehrhardt Subject: Re: [PATCH v2/RFC] libkvm-s390 Date: Thu, 17 Jul 2008 13:08:56 +0200 Message-ID: <487F2848.3020303@linux.vnet.ibm.com> References: <1215797386.6014.4.camel@cotte.boeblingen.de.ibm.com> <200807161728.58658.borntraeger@de.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Avi Kivity , Carsten Otte , kvm , Olaf Schnapper , Hollis Blanchard To: Christian Borntraeger Return-path: Received: from mtagate1.de.ibm.com ([195.212.29.150]:16298 "EHLO mtagate1.de.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756072AbYGQLJT (ORCPT ); Thu, 17 Jul 2008 07:09:19 -0400 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate1.de.ibm.com (8.13.8/8.13.8) with ESMTP id m6HB8x8b308404 for ; Thu, 17 Jul 2008 11:08:59 GMT Received: from d12av01.megacenter.de.ibm.com (d12av01.megacenter.de.ibm.com [9.149.165.212]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v9.0) with ESMTP id m6HB8xEb1294362 for ; Thu, 17 Jul 2008 13:08:59 +0200 Received: from d12av01.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av01.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m6HB8wVP010452 for ; Thu, 17 Jul 2008 13:08:58 +0200 In-Reply-To: <200807161728.58658.borntraeger@de.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: Christian Borntraeger wrote: > This is an update patch for libkvm to build and work on s390 [...] > Index: kvm-userspace/libkvm/libkvm-s390.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- /dev/null > +++ kvm-userspace/libkvm/libkvm-s390.c > @@ -0,0 +1,137 @@ > +/* > + * This file contains the s390 specific implementation for the > + * architecture dependent functions defined in kvm-common.h and > + * libkvm.h > + * > + * Copyright (C) 2006 Qumranet > + * Copyright IBM Corp. 2008 > + * > + * Authors: > + * Carsten Otte > + * Christian Borntraeger > =20 whitespace error - well just in the comment, but if you resubmit it=20 anyway this space could be removed ;-) [...] > + > +int handle_dcr(struct kvm_run *run, kvm_context_t kvm, int vcpu) > +{ > + fprintf(stderr, "%s: Operation not supported\n", __FUNCTION__); > + return -1; > +} > + > =20 I think Carsten started with the powerpc file here. This function is powerpc only and even in our code only called later on= =20 in this libkvm-$arch.c file. Maybe we should patch our file and make it static to clarify that. Since you don't have that call its superfluous, you should be able to=20 drop it without consequence. [...] > Index: kvm-userspace/libkvm/libkvm.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- kvm-userspace.orig/libkvm/libkvm.c > +++ kvm-userspace/libkvm/libkvm.c > @@ -48,6 +48,10 @@ > #include "kvm-powerpc.h" > #endif > > +#if defined(__s390__) > +#include "kvm-s390.h" > +#endif > + > int kvm_abi =3D EXPECTED_KVM_API_VERSION; > int kvm_page_size; > > @@ -88,7 +92,11 @@ int get_free_slot(kvm_context_t kvm) > if (tss_ext > 0) > i =3D 0; > else > +#if !defined(__s390__) > i =3D 1; > +#else > + i =3D 0; > +#endif > > =20 This looks a bit complicated, but when thinking of the result this just= =20 means that i is always 0 on s390. Therefore I think it would look less confusing when the ifdef would not= =20 be in the else part of that tss_ext if. Since i will always be zero in s390 case you could do things like - initialize i with 0 and let the whole block until the for loop run in= =20 "if !defined(__s390__)" That way you would additionally stop modifying the tss_ext variable=20 which is not used in the s390 case anyway. [...] --=20 Gr=FCsse / regards,=20 Christian Ehrhardt IBM Linux Technology Center, Open Virtualization