From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55801) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ScF0P-0008Ik-39 for qemu-devel@nongnu.org; Wed, 06 Jun 2012 08:06:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ScF0E-0001ky-Gb for qemu-devel@nongnu.org; Wed, 06 Jun 2012 08:06:28 -0400 Received: from e06smtp17.uk.ibm.com ([195.75.94.113]:53495) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ScF0E-0001ia-8O for qemu-devel@nongnu.org; Wed, 06 Jun 2012 08:06:18 -0400 Received: from /spool/local by e06smtp17.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 6 Jun 2012 13:06:14 +0100 Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1507.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q56C5fmJ1556512 for ; Wed, 6 Jun 2012 13:05:41 +0100 Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q56C5c7p001932 for ; Wed, 6 Jun 2012 06:05:40 -0600 From: Jens Freimann Date: Wed, 6 Jun 2012 14:05:23 +0200 Message-Id: <1338984323-21914-9-git-send-email-jfrei@de.ibm.com> In-Reply-To: <1338984323-21914-1-git-send-email-jfrei@de.ibm.com> References: <1338984323-21914-1-git-send-email-jfrei@de.ibm.com> Subject: [Qemu-devel] [PATCH 8/8] s390: Fix the storage increment size calculation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: Cornelia Huck , Nick Wang , Jens Freimann , Heinz Graalfs , qemu-devel From: Nick Wang To comply with the SCLP architecture, the number of storage increments should be 512 or fewer. The increment size is a multiple of 1M and is a power of 2. Signed-off-by: Nick Wang Signed-off-by: Jens Freimann --- hw/s390-sclp.c | 2 +- hw/s390-virtio.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/s390-sclp.c b/hw/s390-sclp.c index 8f45773..3e91f93 100644 --- a/hw/s390-sclp.c +++ b/hw/s390-sclp.c @@ -32,7 +32,7 @@ int sclp_read_info(CPUS390XState *env, struct sccb *sccb) { int shift = 0; - while ((ram_size >> (20 + shift)) > 65535) { + while ((ram_size >> (20 + shift)) > 512) { shift++; } sccb->c.read_info.rnmax = cpu_to_be16(ram_size >> (20 + shift)); diff --git a/hw/s390-virtio.c b/hw/s390-virtio.c index 0babf27..9578d15 100644 --- a/hw/s390-virtio.c +++ b/hw/s390-virtio.c @@ -175,9 +175,9 @@ static void s390_init(ram_addr_t my_ram_size, int i; DeviceState *dev; - /* s390x ram size detection needs a 16bit multiplier + an increment. So - guests > 64GB can be specified in 2MB steps etc. */ - while ((my_ram_size >> (20 + shift)) > 65535) { + /* The storage increment size is a multiple of 1M and is a power of 2. + * The number of storage increments must be 512 or fewer. */ + while ((my_ram_size >> (20 + shift)) > 512) { shift++; } my_ram_size = my_ram_size >> (20 + shift) << (20 + shift); -- 1.7.10.4