[Qemu-devel] [PATCH] hw/s390x/ipl: Fix endianness problem with netboot_start_addr

Thomas Huth posted 1 patch 6 years, 9 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/1499268345-12552-1-git-send-email-thuth@redhat.com
Test FreeBSD passed
Test checkpatch passed
Test docker passed
Test s390x passed
hw/s390x/ipl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[Qemu-devel] [PATCH] hw/s390x/ipl: Fix endianness problem with netboot_start_addr
Posted by Thomas Huth 6 years, 9 months ago
The start address has to be stored in big endian byte order
in the iplb.ccw block for the guest.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 hw/s390x/ipl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
index 4e6469d..cc36003 100644
--- a/hw/s390x/ipl.c
+++ b/hw/s390x/ipl.c
@@ -418,7 +418,7 @@ void s390_ipl_prepare_cpu(S390CPU *cpu)
             error_report_err(err);
             vm_stop(RUN_STATE_INTERNAL_ERROR);
         }
-        ipl->iplb.ccw.netboot_start_addr = ipl->start_addr;
+        ipl->iplb.ccw.netboot_start_addr = cpu_to_be64(ipl->start_addr);
     }
 }
 
-- 
1.8.3.1


Re: [Qemu-devel] [PATCH] hw/s390x/ipl: Fix endianness problem with netboot_start_addr
Posted by Cornelia Huck 6 years, 9 months ago
On Wed,  5 Jul 2017 17:25:45 +0200
Thomas Huth <thuth@redhat.com> wrote:

> The start address has to be stored in big endian byte order
> in the iplb.ccw block for the guest.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  hw/s390x/ipl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
> index 4e6469d..cc36003 100644
> --- a/hw/s390x/ipl.c
> +++ b/hw/s390x/ipl.c
> @@ -418,7 +418,7 @@ void s390_ipl_prepare_cpu(S390CPU *cpu)
>              error_report_err(err);
>              vm_stop(RUN_STATE_INTERNAL_ERROR);
>          }
> -        ipl->iplb.ccw.netboot_start_addr = ipl->start_addr;
> +        ipl->iplb.ccw.netboot_start_addr = cpu_to_be64(ipl->start_addr);
>      }
>  }
>  

This seems to be the only iplb field to miss endianness handling.

Reviewed-by: Cornelia Huck <cohuck@redhat.com>


Re: [Qemu-devel] [PATCH] hw/s390x/ipl: Fix endianness problem with netboot_start_addr
Posted by Christian Borntraeger 6 years, 9 months ago
On 07/05/2017 05:25 PM, Thomas Huth wrote:
> The start address has to be stored in big endian byte order
> in the iplb.ccw block for the guest.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  hw/s390x/ipl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
> index 4e6469d..cc36003 100644
> --- a/hw/s390x/ipl.c
> +++ b/hw/s390x/ipl.c
> @@ -418,7 +418,7 @@ void s390_ipl_prepare_cpu(S390CPU *cpu)
>              error_report_err(err);
>              vm_stop(RUN_STATE_INTERNAL_ERROR);
>          }
> -        ipl->iplb.ccw.netboot_start_addr = ipl->start_addr;
> +        ipl->iplb.ccw.netboot_start_addr = cpu_to_be64(ipl->start_addr);
>      }
>  }
> 

Thanks also applied to s390-next.