From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:42325) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QKI1N-0000b6-7E for qemu-devel@nongnu.org; Wed, 11 May 2011 18:36:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QKI1M-0008Fv-5y for qemu-devel@nongnu.org; Wed, 11 May 2011 18:36:45 -0400 Received: from cantor2.suse.de ([195.135.220.15]:44814 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QKI1L-0008Ef-Tx for qemu-devel@nongnu.org; Wed, 11 May 2011 18:36:44 -0400 Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Alexander Graf In-Reply-To: <4DC9346B.9050309@de.ibm.com> Date: Thu, 12 May 2011 00:36:40 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <1AFDA82C-ED1F-44AB-A9F0-B53416E15581@suse.de> References: <4DC9346B.9050309@de.ibm.com> Subject: Re: [Qemu-devel] s390x: fix memory detection for guests > 64GB List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christian Borntraeger Cc: Carsten Otte , "qemu-devel@nongnu.org" On 10.05.2011, at 14:49, Christian Borntraeger wrote: > Alex, >=20 > the s390 memory detection has a 16bit field that specifies the amount = of > increments. This patch adopts the memory size to always fit into that > scheme. This also fixes virtio detection for these guests, since the=20= > descriptor page is located after the main memory. >=20 > Signed-off-by: Christian Borntraeger >=20 > --- a/target-s390x/op_helper.c > +++ b/target-s390x/op_helper.c > @@ -2361,6 +2361,7 @@ static void ext_interrupt(CPUState *env, int = type, uint32_t param, > int sclp_service_call(CPUState *env, uint32_t sccb, uint64_t code) > { > int r =3D 0; > + int shift =3D 0; >=20 > #ifdef DEBUG_HELPER > printf("sclp(0x%x, 0x%" PRIx64 ")\n", sccb, code); > @@ -2375,8 +2376,10 @@ int sclp_service_call(CPUState *env, uint32_t = sccb, uint64_t code) > switch(code) { > case SCLP_CMDW_READ_SCP_INFO: > case SCLP_CMDW_READ_SCP_INFO_FORCED: > - stw_phys(sccb + SCP_MEM_CODE, ram_size >> 20); > - stb_phys(sccb + SCP_INCREMENT, 1); > + while ((ram_size >> (20 + shift)) > 65535) > + shift++; Please run scripts/checkpatch.pl on your patch. Alex