From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:57353) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SePfG-0004kB-6o for qemu-devel@nongnu.org; Tue, 12 Jun 2012 07:53:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SePfE-0003Pu-CD for qemu-devel@nongnu.org; Tue, 12 Jun 2012 07:53:37 -0400 Received: from cantor2.suse.de ([195.135.220.15]:44558 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SePfE-0003Ny-2z for qemu-devel@nongnu.org; Tue, 12 Jun 2012 07:53:36 -0400 Message-ID: <4FD72DBB.50208@suse.de> Date: Tue, 12 Jun 2012 13:53:31 +0200 From: Alexander Graf MIME-Version: 1.0 References: <1338984323-21914-1-git-send-email-jfrei@de.ibm.com> <1338984323-21914-9-git-send-email-jfrei@de.ibm.com> In-Reply-To: <1338984323-21914-9-git-send-email-jfrei@de.ibm.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [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: Jens Freimann Cc: Cornelia Huck , Nick Wang , Jens Freimann , Heinz Graalfs , qemu-devel On 06/06/2012 02:05 PM, Jens Freimann wrote: > 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 Any references to documentation for this one? :) Alex > --- > 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);