From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:56493) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SelxK-0006vM-Ge for qemu-devel@nongnu.org; Wed, 13 Jun 2012 07:41:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SelxI-00059d-QV for qemu-devel@nongnu.org; Wed, 13 Jun 2012 07:41:46 -0400 Received: from david.siemens.de ([192.35.17.14]:16994) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SelxI-00059J-Gu for qemu-devel@nongnu.org; Wed, 13 Jun 2012 07:41:44 -0400 Message-ID: <4FD87C6F.8050007@siemens.com> Date: Wed, 13 Jun 2012 13:41:35 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <1338984323-21914-1-git-send-email-jfrei@de.ibm.com> <1338984323-21914-3-git-send-email-jfrei@de.ibm.com> <4FD70CC0.7000901@suse.de> <4FD725EB.7050501@de.ibm.com> <4FD72EC2.2010105@suse.de> <4FD72FD4.6020008@de.ibm.com> <4FD73220.5000408@suse.de> <4FD86BB1.9060900@siemens.com> <4FD87156.10705@suse.de> <4FD8724A.6020704@siemens.com> <4FD87939.8060304@de.ibm.com> In-Reply-To: <4FD87939.8060304@de.ibm.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/8] s390: autodetect map private List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christian Borntraeger Cc: Jens Freimann , Heinz Graalfs , Alexander Graf , qemu-devel , Jens Freimann , Cornelia Huck On 2012-06-13 13:27, Christian Borntraeger wrote: > On 13/06/12 12:58, Jan Kiszka wrote: >>> Thinking about this a bit more, how about >>> >>> } else if (!kvm_arch_vmalloc(size, &new_block->host)) { >>> >>> } >>> > > I like that. Of course, we have to have a generic kvm_arch_vmalloc implementation > then. Then better go for kvm_vmalloc calling kvm_arch_vmalloc (in the s390 case). However, I do not like the variation of parameters and return value compared to normal *alloc. Better: memory = kvm_vmalloc(size); if (!memory) memory = qemu_vmalloc(size); But more regular (when looking at the Xen block) is guarding the call with kvm_enabled() and embedding qemu_vmalloc in kvm_vmalloc. > >>> Then the arch specific code could do the check and the implementation of >>> vmalloc, but only has to return -1 if we don't need it and things still >>> fall back to the generic code. >> >> But you would have to walk a while to find out that only s390x on (old) >> KVM actually returns success here and does some allocation. > > > It that such a problem? What about adding a comment then, otherwise we just > use ifdef as a comment, which isnt nice either. Any kind of comment is definitely a good idea. Jan -- Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux