Skip to contentSkip to conversation

hw/s390x/ipl: Fix endianness problem with netboot_start_addr

PATCH In review Thomas Huth 3 participants 3 messages Jul 5, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/s390x/ipl: Fix endianness problem with netboot_start_addr

The start address has to be stored in big endian byte order in the iplb.ccw block for the guest.

---
 hw/s390x/ipl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/s390x/ipl.c +1 -1
index 4e6469d..cc36003 100644
@@ -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);
     }
 }
 
Signature · 1 line
1.8.3.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 13 lines · On Wed, 5 Jul 2017 17:25:45 +0200 Thomas Huth <[email protected]> wrote:

The start address has to be stored in big endian byte order in the iplb.ccw block for the guest.

---
 hw/s390x/ipl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/s390x/ipl.c +0 -0
index 4e6469d..cc36003 100644

hw/s390x/ipl.c void s390_ipl_prepare_cpu(S390CPU *cpu) · line 424

Quoted 8 lines
hw/s390x/ipl.c +1 -1
@@ -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.

#2 lore raw
In reply to Thomas Huth
Quoted 13 lines · Thomas Huth

The start address has to be stored in big endian byte order in the iplb.ccw block for the guest.

---
 hw/s390x/ipl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/s390x/ipl.c +0 -0
index 4e6469d..cc36003 100644

hw/s390x/ipl.c void s390_ipl_prepare_cpu(S390CPU *cpu) · line 424

Quoted 8 lines
hw/s390x/ipl.c +1 -1
@@ -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.