From: jrossi@linux.ibm.com
To: qemu-devel@nongnu.org, qemu-s390x@nongnu.org, thuth@redhat.com
Cc: frankja@linux.ibm.com, nsg@linux.ibm.com, jrossi@linux.ibm.com
Subject: [PATCH 5/5] s390x: Enable and document boot device fallback on panic
Date: Wed, 29 May 2024 11:43:11 -0400 [thread overview]
Message-ID: <20240529154311.734548-6-jrossi@linux.ibm.com> (raw)
In-Reply-To: <20240529154311.734548-1-jrossi@linux.ibm.com>
From: Jared Rossi <jrossi@linux.ibm.com>
On a panic during IPL (i.e. a device failed to boot) check for another device
to boot from, as indicated by the presence of an unused IPLB.
If an IPLB is successfully loaded, then jump to the start of BIOS, restarting
IPL using the updated IPLB. Otherwise enter disabled wait.
Signed-off-by: Jared Rossi <jrossi@linux.ibm.com>
---
docs/system/bootindex.rst | 7 ++++---
docs/system/s390x/bootdevices.rst | 9 ++++++---
pc-bios/s390-ccw/s390-ccw.h | 6 ++++++
3 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/docs/system/bootindex.rst b/docs/system/bootindex.rst
index 8b057f812f..de597561bd 100644
--- a/docs/system/bootindex.rst
+++ b/docs/system/bootindex.rst
@@ -50,9 +50,10 @@ Limitations
Some firmware has limitations on which devices can be considered for
booting. For instance, the PC BIOS boot specification allows only one
-disk to be bootable. If boot from disk fails for some reason, the BIOS
-won't retry booting from other disk. It can still try to boot from
-floppy or net, though.
+disk to be bootable, except for on s390x machines. If boot from disk fails for
+some reason, the BIOS won't retry booting from other disk. It can still try to
+boot from floppy or net, though. In the case of s390x, the BIOS will try up to
+8 total devices, any number of which may be disks.
Sometimes, firmware cannot map the device path QEMU wants firmware to
boot from to a boot method. It doesn't happen for devices the firmware
diff --git a/docs/system/s390x/bootdevices.rst b/docs/system/s390x/bootdevices.rst
index 1a7a18b43b..f096e1cc06 100644
--- a/docs/system/s390x/bootdevices.rst
+++ b/docs/system/s390x/bootdevices.rst
@@ -6,9 +6,7 @@ Booting with bootindex parameter
For classical mainframe guests (i.e. LPAR or z/VM installations), you always
have to explicitly specify the disk where you want to boot from (or "IPL" from,
-in s390x-speak -- IPL means "Initial Program Load"). In particular, there can
-also be only one boot device according to the architecture specification, thus
-specifying multiple boot devices is not possible (yet).
+in s390x-speak -- IPL means "Initial Program Load").
So for booting an s390x guest in QEMU, you should always mark the
device where you want to boot from with the ``bootindex`` property, for
@@ -17,6 +15,11 @@ example::
qemu-system-s390x -drive if=none,id=dr1,file=guest.qcow2 \
-device virtio-blk,drive=dr1,bootindex=1
+Multiple devices may have a bootindex. The lowest bootindex is assigned to the
+device to IPL first. If the IPL fails for the first, the device with the second
+lowest bootindex will be tried and so on until IPL is successful or there are no
+remaining boot devices to try.
+
For booting from a CD-ROM ISO image (which needs to include El-Torito boot
information in order to be bootable), it is recommended to specify a ``scsi-cd``
device, for example like this::
diff --git a/pc-bios/s390-ccw/s390-ccw.h b/pc-bios/s390-ccw/s390-ccw.h
index c977a52b50..de3d1f0d5a 100644
--- a/pc-bios/s390-ccw/s390-ccw.h
+++ b/pc-bios/s390-ccw/s390-ccw.h
@@ -43,6 +43,7 @@ typedef unsigned long long u64;
#include "iplb.h"
/* start.s */
+extern char _start[];
void disabled_wait(void) __attribute__ ((__noreturn__));
void consume_sclp_int(void);
void consume_io_int(void);
@@ -88,6 +89,11 @@ __attribute__ ((__noreturn__))
static inline void panic(const char *string)
{
sclp_print(string);
+ if (load_next_iplb()) {
+ sclp_print("\nTrying next boot device...");
+ jump_to_IPL_code((long)_start);
+ }
+
disabled_wait();
}
--
2.45.1
next prev parent reply other threads:[~2024-05-29 15:45 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
2024-05-29 15:43 ` jrossi [this message]
2024-06-05 13:37 ` [PATCH 5/5] s390x: Enable and document boot device fallback on panic 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=20240529154311.734548-6-jrossi@linux.ibm.com \
--to=jrossi@linux.ibm.com \
--cc=frankja@linux.ibm.com \
--cc=nsg@linux.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=thuth@redhat.com \
/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).