diff mbox

[8/8] s390: Fix the storage increment size calculation

Message ID 1338984323-21914-9-git-send-email-jfrei@de.ibm.com
State New
Headers show

Commit Message

Jens Freimann June 6, 2012, 12:05 p.m. UTC
From: Nick Wang <jfwang@us.ibm.com>

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 <jfwang@us.ibm.com>
Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
---
 hw/s390-sclp.c   |    2 +-
 hw/s390-virtio.c |    6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

Comments

Alexander Graf June 12, 2012, 11:53 a.m. UTC | #1
On 06/06/2012 02:05 PM, Jens Freimann wrote:
> From: Nick Wang<jfwang@us.ibm.com>
>
> 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<jfwang@us.ibm.com>
> Signed-off-by: Jens Freimann<jfrei@linux.vnet.ibm.com>

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);
Jeng-fang Wang June 12, 2012, 2:57 p.m. UTC | #2
Yes, you can refer to AR10040-03-POK, Service-Call Logical Processor
Architecture for S/390 and z/Architecture, Figure 2-6 Minimum storage
increment and subincrement size.  :)

Nick






From:	Alexander Graf <agraf@suse.de>
To:	Jens Freimann <jfrei@de.ibm.com>
Cc:	Jens Freimann <jfrei@linux.vnet.ibm.com>, Cornelia Huck
            <cornelia.huck@de.ibm.com>, qemu-devel <qemu-devel@nongnu.org>,
            Heinz Graalfs <graalfs@linux.vnet.ibm.com>, Jeng-fang
            Wang/Poughkeepsie/IBM@IBMUS
Date:	06/12/2012 07:53 AM
Subject:	Re: [PATCH 8/8] s390: Fix the storage increment size
            calculation



On 06/06/2012 02:05 PM, Jens Freimann wrote:
> From: Nick Wang<jfwang@us.ibm.com>
>
> 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<jfwang@us.ibm.com>
> Signed-off-by: Jens Freimann<jfrei@linux.vnet.ibm.com>

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);
Alexander Graf June 18, 2012, 1:46 p.m. UTC | #3
On 12.06.2012, at 16:57, Jeng-fang Wang wrote:

> Yes, you can refer to AR10040-03-POK, Service-Call Logical Processor Architecture for S/390 and z/Architecture, Figure 2-6 Minimum storage increment and subincrement size.  :)
> 

Is that one publicly available anywhere?


Alex
Christian Borntraeger June 18, 2012, 7:30 p.m. UTC | #4
On 18/06/12 15:46, Alexander Graf wrote:

> Is that one publicly available anywhere?

Unfortunately no. Sorry.
diff mbox

Patch

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);