aboutsummaryrefslogtreecommitdiff
path: root/pc-bios/s390-ccw
diff options
context:
space:
mode:
authorJanosch Frank <frankja@linux.ibm.com>2020-10-06 05:42:46 -0400
committerThomas Huth <thuth@redhat.com>2020-10-06 19:57:35 +0200
commit4906a4e41c29b65ad350736e0a989e5cf3387baf (patch)
tree48d833e7e03d51757afb8002ba15dede53339a38 /pc-bios/s390-ccw
parent468184ec9024f4f7b55247f70ec57554e8a500d7 (diff)
pc-bios: s390x: Fix bootmap.c zipl component entry data handling
The two main types of zipl component entries are execute and load/data. The last member of the component entry struct therefore denotes either a PSW or an address. Let's make this a bit more clear by introducing a union and cleaning up the code that uses that struct member. The execute type component entries written by zipl contain short PSWs, not addresses. Let's mask them and only pass the address part to jump_to_IPL_code(uint64_t address) because it expects an address as visible by the name of the argument. Signed-off-by: Janosch Frank <frankja@linux.ibm.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20201006094249.50640-2-frankja@linux.ibm.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'pc-bios/s390-ccw')
-rw-r--r--pc-bios/s390-ccw/bootmap.c5
-rw-r--r--pc-bios/s390-ccw/bootmap.h7
2 files changed, 9 insertions, 3 deletions
diff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c
index 942fba3fa7..73471801de 100644
--- a/pc-bios/s390-ccw/bootmap.c
+++ b/pc-bios/s390-ccw/bootmap.c
@@ -10,6 +10,7 @@
#include "libc.h"
#include "s390-ccw.h"
+#include "s390-arch.h"
#include "bootmap.h"
#include "virtio.h"
#include "bswap.h"
@@ -448,7 +449,7 @@ static void zipl_load_segment(ComponentEntry *entry)
char *blk_no = &err_msg[30]; /* where to print blockno in (those ZZs) */
blockno = entry->data.blockno;
- address = entry->load_address;
+ address = entry->compdat.load_addr;
debug_print_int("loading segment at block", blockno);
debug_print_int("addr", address);
@@ -526,7 +527,7 @@ static void zipl_run(ScsiBlockPtr *pte)
IPL_assert(entry->component_type == ZIPL_COMP_ENTRY_EXEC, "No EXEC entry");
/* should not return */
- jump_to_IPL_code(entry->load_address);
+ jump_to_IPL_code(entry->compdat.load_psw & PSW_MASK_SHORT_ADDR);
}
static void ipl_scsi(void)
diff --git a/pc-bios/s390-ccw/bootmap.h b/pc-bios/s390-ccw/bootmap.h
index 12a0166aae..3946aa3f8d 100644
--- a/pc-bios/s390-ccw/bootmap.h
+++ b/pc-bios/s390-ccw/bootmap.h
@@ -64,11 +64,16 @@ typedef struct BootMapTable {
BootMapPointer entry[];
} __attribute__ ((packed)) BootMapTable;
+typedef union ComponentEntryData {
+ uint64_t load_psw;
+ uint64_t load_addr;
+} ComponentEntryData;
+
typedef struct ComponentEntry {
ScsiBlockPtr data;
uint8_t pad[7];
uint8_t component_type;
- uint64_t load_address;
+ ComponentEntryData compdat;
} __attribute((packed)) ComponentEntry;
typedef struct ComponentHeader {