From: Thomas Huth <thuth@redhat.com>
To: jrossi@linux.ibm.com, qemu-devel@nongnu.org, qemu-s390x@nongnu.org
Cc: frankja@linux.ibm.com, nsg@linux.ibm.com
Subject: Re: [PATCH 4/5] s390x: Add boot device fallback infrastructure
Date: Wed, 5 Jun 2024 14:13:48 +0200 [thread overview]
Message-ID: <791e54a9-8426-43aa-a1cc-9d711504ebd0@redhat.com> (raw)
In-Reply-To: <86ad1f68-a67e-4c30-9e65-cad8c607352d@redhat.com>
On 05/06/2024 10.20, Thomas Huth wrote:
> On 29/05/2024 17.43, jrossi@linux.ibm.com wrote:
>> From: Jared Rossi <jrossi@linux.ibm.com>
>>
>> Add a routine for loading the next IPLB if a device fails to boot.
>>
>> This includes some minor changes to the List-Directed IPL routine so that the
>> failing device may be retried using the legacy boot pointers before moving
>> on to
>> the next device.
>>
>> Signed-off-by: Jared Rossi <jrossi@linux.ibm.com>
>> ---
> ...
>> diff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c
>> index a2137449dc..69391557fa 100644
>> --- a/pc-bios/s390-ccw/bootmap.c
>> +++ b/pc-bios/s390-ccw/bootmap.c
>> @@ -144,7 +144,10 @@ static block_number_t
>> load_eckd_segments(block_number_t blk, bool ldipl,
>> bool more_data;
>> memset(_bprs, FREE_SPACE_FILLER, sizeof(_bprs));
>> - read_block(blk, bprs, "BPRS read failed");
>> + if (!read_block_nonfatal(blk, bprs)) {
>> + IPL_assert(ldipl, "BPRS read failed");
>> + return -1;
>> + }
>> do {
>> more_data = false;
>> @@ -188,7 +191,10 @@ static block_number_t
>> load_eckd_segments(block_number_t blk, bool ldipl,
>> * I.e. the next ptr must point to the unused memory area
>> */
>> memset(_bprs, FREE_SPACE_FILLER, sizeof(_bprs));
>> - read_block(block_nr, bprs, "BPRS continuation read failed");
>> + if (!read_block_nonfatal(block_nr, bprs)) {
>> + IPL_assert(ldipl, "BPRS continuation read failed");
>> + break;
>> + }
>> more_data = true;
>> break;
>> }
>> @@ -197,7 +203,10 @@ static block_number_t
>> load_eckd_segments(block_number_t blk, bool ldipl,
>> * to memory (address).
>> */
>> rc = virtio_read_many(block_nr, (void *)(*address), count + 1);
>> - IPL_assert(rc == 0, "code chunk read failed");
>> + if (rc != 0) {
>> + IPL_assert(ldipl, "code chunk read failed");
>> + break;
>> + }
>> *address += (count + 1) * virtio_get_block_size();
>> }
>> @@ -295,13 +304,22 @@ static void run_eckd_boot_script(block_number_t
>> bmt_block_nr,
>> " maximum number of boot entries allowed");
>> memset(sec, FREE_SPACE_FILLER, sizeof(sec));
>> - read_block(bmt_block_nr, sec, "Cannot read Boot Map Table");
>> + if (!read_block_nonfatal(bmt_block_nr, sec)) {
>> + IPL_assert(ldipl, "Cannot read Boot Map Table");
>> + return;
>> + }
>> block_nr = gen_eckd_block_num(&bmt->entry[loadparm].xeckd, ldipl);
>> - IPL_assert(block_nr != -1, "Cannot find Boot Map Table Entry");
>> + if (block_nr == -1) {
>> + IPL_assert(ldipl, "Cannot find Boot Map Table Entry");
>> + return;
>> + }
>> memset(sec, FREE_SPACE_FILLER, sizeof(sec));
>> - read_block(block_nr, sec, "Cannot read Boot Map Script");
>> + if (!read_block_nonfatal(block_nr, sec)) {
>> + IPL_assert(ldipl, "Cannot read Boot Map Script");
>> + return;
>> + }
>> for (i = 0; bms->entry[i].type == BOOT_SCRIPT_LOAD ||
>> bms->entry[i].type == BOOT_SCRIPT_SIGNATURE; i++) {
>> @@ -319,13 +337,10 @@ static void run_eckd_boot_script(block_number_t
>> bmt_block_nr,
>> } while (block_nr != -1);
>> }
>> - if (ldipl && bms->entry[i].type != BOOT_SCRIPT_EXEC) {
>> - /* Abort LD-IPL and retry as CCW-IPL */
>> + if (bms->entry[i].type != BOOT_SCRIPT_EXEC) {
>> + IPL_assert(ldipl, "Unknown script entry type");
>> return;
>> }
>> -
>> - IPL_assert(bms->entry[i].type == BOOT_SCRIPT_EXEC,
>> - "Unknown script entry type");
>> write_reset_psw(bms->entry[i].address.load_address); /* no return */
>> jump_to_IPL_code(0); /* no return */
>> }
>> @@ -492,7 +507,7 @@ static void ipl_eckd(void)
>> /* LD-IPL does not use the S1B bock, just make it NULL */
>> run_eckd_boot_script(ldipl_bmt, NULL_BLOCK_NR);
>> /* Only return in error, retry as CCW-IPL */
>> - sclp_print("Retrying IPL ");
>> + sclp_print("LD-IPL failed, retrying device\n");
>> print_eckd_msg();
>> }
>> memset(sec, FREE_SPACE_FILLER, sizeof(sec));
>> @@ -944,5 +959,5 @@ void zipl_load(void)
>> panic("\n! Unknown IPL device type !\n");
>> }
>> - sclp_print("zIPL load failed.\n");
>> + panic("zIPL load failed.\n");
>
> Why replacing the sclp_print() here? Wouldn't it be nicer to continue
> panicking on the calling site instead?
Ok, after looking at the 5th patch, I think I understand it now: panic() is
not fatal anymore and might restart with the next boot device... not sure
whether I like that, but let's discuss that on patch 5 instead...
Thomas
next prev parent reply other threads:[~2024-06-05 12:14 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-29 15:43 [PATCH 0/5] s390x: Add Full Boot Order Support jrossi
2024-05-29 15:43 ` [PATCH 1/5] s390x: Create include files for s390x IPL definitions jrossi
2024-06-03 18:51 ` Thomas Huth
2024-05-29 15:43 ` [PATCH 2/5] s390x: Add loadparm to CcwDevice jrossi
2024-06-04 14:27 ` Thomas Huth
2024-06-04 16:27 ` Jared Rossi
2024-06-04 16:59 ` Thomas Huth
2024-06-05 7:49 ` Thomas Huth
2024-05-29 15:43 ` [PATCH 3/5] s390x: Build IPLB chain for multiple boot devices jrossi
2024-06-03 19:03 ` Thomas Huth
2024-06-04 18:26 ` Thomas Huth
2024-06-05 20:01 ` Jared Rossi
2024-06-07 6:11 ` Thomas Huth
2024-05-29 15:43 ` [PATCH 4/5] s390x: Add boot device fallback infrastructure jrossi
2024-06-05 8:20 ` Thomas Huth
2024-06-05 12:13 ` Thomas Huth [this message]
2024-05-29 15:43 ` [PATCH 5/5] s390x: Enable and document boot device fallback on panic jrossi
2024-06-05 13:37 ` Thomas Huth
2024-06-05 14:48 ` Jared Rossi
2024-06-07 5:57 ` Thomas Huth
2024-06-16 23:44 ` Jared Rossi
2024-06-20 8:10 ` Thomas Huth
2024-06-17 14:49 ` Christian Borntraeger
2024-06-20 8:14 ` Thomas Huth
2024-06-04 18:35 ` [PATCH 0/5] s390x: Add Full Boot Order Support Thomas Huth
2024-06-05 8:02 ` Thomas Huth
2024-06-06 19:22 ` Jared Rossi
2024-06-07 6:19 ` Thomas Huth
2024-06-10 3:58 ` Jared Rossi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=791e54a9-8426-43aa-a1cc-9d711504ebd0@redhat.com \
--to=thuth@redhat.com \
--cc=frankja@linux.ibm.com \
--cc=jrossi@linux.ibm.com \
--cc=nsg@linux.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).