[Qemu-devel] [PATCH] s390x/sclp: fixup highest CPU address

Christian Borntraeger posted 1 patch 6 years, 3 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20171219082807.84494-1-borntraeger@de.ibm.com
Test checkpatch passed
Test docker passed
Test ppc passed
Test s390x passed
hw/s390x/sclp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[Qemu-devel] [PATCH] s390x/sclp: fixup highest CPU address
Posted by Christian Borntraeger 6 years, 3 months ago
the highest cpu address is not the same as max_cpus. max_cpus
counts from 1 while the cpu address starts at 0.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: Jason J. Herne <jjherne@linux.vnet.ibm.com>
---
 hw/s390x/sclp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/s390x/sclp.c b/hw/s390x/sclp.c
index 9be0cb80ad..21351ffffc 100644
--- a/hw/s390x/sclp.c
+++ b/hw/s390x/sclp.c
@@ -67,7 +67,7 @@ static void read_SCP_info(SCLPDevice *sclp, SCCB *sccb)
     prepare_cpu_entries(sclp, read_info->entries, &cpu_count);
     read_info->entries_cpu = cpu_to_be16(cpu_count);
     read_info->offset_cpu = cpu_to_be16(offsetof(ReadInfo, entries));
-    read_info->highest_cpu = cpu_to_be16(max_cpus);
+    read_info->highest_cpu = cpu_to_be16(max_cpus - 1);
 
     read_info->ibc_val = cpu_to_be32(s390_get_ibc_val());
 
-- 
2.13.4


Re: [Qemu-devel] [PATCH] s390x/sclp: fixup highest CPU address
Posted by David Hildenbrand 6 years, 3 months ago
On 19.12.2017 09:28, Christian Borntraeger wrote:
> the highest cpu address is not the same as max_cpus. max_cpus
> counts from 1 while the cpu address starts at 0.
> 
> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
> Reviewed-by: Jason J. Herne <jjherne@linux.vnet.ibm.com>
> ---
>  hw/s390x/sclp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/s390x/sclp.c b/hw/s390x/sclp.c
> index 9be0cb80ad..21351ffffc 100644
> --- a/hw/s390x/sclp.c
> +++ b/hw/s390x/sclp.c
> @@ -67,7 +67,7 @@ static void read_SCP_info(SCLPDevice *sclp, SCCB *sccb)
>      prepare_cpu_entries(sclp, read_info->entries, &cpu_count);
>      read_info->entries_cpu = cpu_to_be16(cpu_count);
>      read_info->offset_cpu = cpu_to_be16(offsetof(ReadInfo, entries));
> -    read_info->highest_cpu = cpu_to_be16(max_cpus);
> +    read_info->highest_cpu = cpu_to_be16(max_cpus - 1);
>  
>      read_info->ibc_val = cpu_to_be32(s390_get_ibc_val());
>  
> 

Reviewed-by: David Hildenbrand <david@redhat.com>

-- 

Thanks,

David / dhildenb

Re: [Qemu-devel] [PATCH] s390x/sclp: fixup highest CPU address
Posted by Cornelia Huck 6 years, 3 months ago
On Tue, 19 Dec 2017 09:28:07 +0100
Christian Borntraeger <borntraeger@de.ibm.com> wrote:

> the highest cpu address is not the same as max_cpus. max_cpus

s/the/The/

> counts from 1 while the cpu address starts at 0.
> 
> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
> Reviewed-by: Jason J. Herne <jjherne@linux.vnet.ibm.com>
> ---
>  hw/s390x/sclp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/s390x/sclp.c b/hw/s390x/sclp.c
> index 9be0cb80ad..21351ffffc 100644
> --- a/hw/s390x/sclp.c
> +++ b/hw/s390x/sclp.c
> @@ -67,7 +67,7 @@ static void read_SCP_info(SCLPDevice *sclp, SCCB *sccb)
>      prepare_cpu_entries(sclp, read_info->entries, &cpu_count);
>      read_info->entries_cpu = cpu_to_be16(cpu_count);
>      read_info->offset_cpu = cpu_to_be16(offsetof(ReadInfo, entries));
> -    read_info->highest_cpu = cpu_to_be16(max_cpus);
> +    read_info->highest_cpu = cpu_to_be16(max_cpus - 1);
>  
>      read_info->ibc_val = cpu_to_be32(s390_get_ibc_val());
>  

Thanks, applied.