diff options
author | Farhan Ali <alifm@linux.vnet.ibm.com> | 2016-04-18 13:45:31 +0200 |
---|---|---|
committer | Cornelia Huck <cornelia.huck@de.ibm.com> | 2017-05-02 15:08:54 +0200 |
commit | 9dd7823b70ccbc812b4a977345dd0a28be0c4b3e (patch) | |
tree | 8897fd634d2cd61499660208de09868ce5c7e7cc /pc-bios | |
parent | 95fa1af8540e0edad5e86590c67a726e6906b7d8 (diff) |
pc-bios/s390-ccw: provide entry selection on LOADPARM for SCSI disk
Fix SCSI bootmap interpreter to make use of any specified entry of the
Program Table using the leftmost numeric value from the LOADPARM, if specified.
Initial patch from Eugene (jno) Dvurechenski.
Signed-off-by: Eugene (jno) Dvurechenski <jno@linux.vnet.ibm.com>
Signed-off-by: Farhan Ali <alifm@linux.vnet.ibm.com>
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Diffstat (limited to 'pc-bios')
-rw-r--r-- | pc-bios/s390-ccw/bootmap.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c index b21c877b53..e39e67e07b 100644 --- a/pc-bios/s390-ccw/bootmap.c +++ b/pc-bios/s390-ccw/bootmap.c @@ -444,7 +444,8 @@ static void ipl_scsi(void) uint8_t *ns, *ns_end; int program_table_entries = 0; const int pte_len = sizeof(ScsiBlockPtr); - ScsiBlockPtr *prog_table_entry; + ScsiBlockPtr *prog_table_entry = NULL; + unsigned int loadparm = get_loadparm_index(); /* Grab the MBR */ memset(sec, FREE_SPACE_FILLER, sizeof(sec)); @@ -467,6 +468,7 @@ static void ipl_scsi(void) IPL_assert(magic_match(sec, ZIPL_MAGIC), "No zIPL magic in PT"); + debug_print_int("loadparm index", loadparm); ns_end = sec + virtio_get_block_size(); for (ns = (sec + pte_len); (ns + pte_len) < ns_end; ns += pte_len) { prog_table_entry = (ScsiBlockPtr *)ns; @@ -475,16 +477,15 @@ static void ipl_scsi(void) } program_table_entries++; + if (program_table_entries == loadparm + 1) { + break; /* selected entry found */ + } } debug_print_int("program table entries", program_table_entries); IPL_assert(program_table_entries != 0, "Empty Program Table"); - /* Run the default entry */ - - prog_table_entry = (ScsiBlockPtr *)(sec + pte_len); - zipl_run(prog_table_entry); /* no return */ } |