From patchwork Wed Jun 6 12:05:23 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Freimann X-Patchwork-Id: 163379 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 77D86B6F62 for ; Wed, 6 Jun 2012 23:34:39 +1000 (EST) Received: from localhost ([::1]:56605 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ScF0j-0000Se-0N for incoming@patchwork.ozlabs.org; Wed, 06 Jun 2012 08:06:49 -0400 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 d06nrmr1507.portsmouth.uk.ibm.com (9.149.38.233) by e06smtp17.uk.ibm.com (192.168.101.147) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 6 Jun 2012 13:05:42 +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 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q56C5b1F001898; Wed, 6 Jun 2012 06:05:38 -0600 Received: by tuxmaker.boeblingen.de.ibm.com (Postfix, from userid 1122) id 79E5B122443E; Wed, 6 Jun 2012 14:05:37 +0200 (CEST) From: Jens Freimann To: Alexander Graf Date: Wed, 6 Jun 2012 14:05:23 +0200 Message-Id: <1338984323-21914-9-git-send-email-jfrei@de.ibm.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1338984323-21914-1-git-send-email-jfrei@de.ibm.com> References: <1338984323-21914-1-git-send-email-jfrei@de.ibm.com> x-cbid: 12060612-0542-0000-0000-000002132BB4 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 195.75.94.113 Cc: Cornelia Huck , Nick Wang , Jens Freimann , Heinz Graalfs , qemu-devel Subject: [Qemu-devel] [PATCH 8/8] s390: Fix the storage increment size calculation X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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);