From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:35893) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QKQnd-0003kg-Bb for qemu-devel@nongnu.org; Thu, 12 May 2011 03:59:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QKQnc-0008Ma-9k for qemu-devel@nongnu.org; Thu, 12 May 2011 03:59:09 -0400 Received: from mtagate4.uk.ibm.com ([194.196.100.164]:60849) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QKQnb-0008MQ-UE for qemu-devel@nongnu.org; Thu, 12 May 2011 03:59:08 -0400 Received: from d06nrmr1507.portsmouth.uk.ibm.com (d06nrmr1507.portsmouth.uk.ibm.com [9.149.38.233]) by mtagate4.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p4C7x6mi003419 for ; Thu, 12 May 2011 07:59:06 GMT Received: from d06av09.portsmouth.uk.ibm.com (d06av09.portsmouth.uk.ibm.com [9.149.37.250]) by d06nrmr1507.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p4C7x5gh2007050 for ; Thu, 12 May 2011 08:59:06 +0100 Received: from d06av09.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p4C7x1K3030744 for ; Thu, 12 May 2011 01:59:02 -0600 Message-ID: <4DCB9345.9000804@de.ibm.com> Date: Thu, 12 May 2011 09:59:01 +0200 From: Christian Borntraeger MIME-Version: 1.0 References: <4DC9346B.9050309@de.ibm.com> <1AFDA82C-ED1F-44AB-A9F0-B53416E15581@suse.de> <4DCB9137.70008@de.ibm.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PatchV2] s390x: fix memory detection for guests > 64GB List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: Carsten Otte , "qemu-devel@nongnu.org" On 12/05/11 09:55, Alexander Graf wrote: >> + /* s390x ram size detection needs a 16bit multiplier + an increment. So >> + guests > 64GB can be specified in 2MB steps etc */ >> + if (strstr(machine->name, "s390")) { >> + int shift = 0; >> + >> + while ((ram_size >> (20 + shift)) > 65535) { >> + shift++; >> + } >> + ram_size = ram_size >> (20 + shift) << (20 + shift); > > This one really belongs to hw/s390-virtio.c. Just move the same code to s390_init there and it should work out. The less hacks we can have in generic code, the better :). Unfortunately this does not work. The slcp op helper uses the global variable ram_size fro vl.c. I could change the global ram_size in s390_init, but this is also pretty ugly. Christian