[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[qemu-s390x] [PULL SUBSYSTEM s390-ccw-bios 03/17] s390-bios: decouple co
From: |
Thomas Huth |
Subject: |
[qemu-s390x] [PULL SUBSYSTEM s390-ccw-bios 03/17] s390-bios: decouple common boot logic from virtio |
Date: |
Fri, 12 Apr 2019 14:25:09 +0200 |
From: "Jason J. Herne" <address@hidden>
Create a boot_setup function to handle getting boot information from
the machine/hypervisor. This decouples common boot logic from the
virtio code path and allows us to make use of it for the real dasd boot
scenario.
Signed-off-by: Jason J. Herne <address@hidden>
Acked-by: Halil Pasic <address@hidden>
Reviewed-by: Collin Walling <address@hidden
Reviewed-by: Thomas Huth <address@hidden>
Reviewed-by: Farhan Ali <address@hidden>
Reviewed-by: Cornelia Huck <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Thomas Huth <address@hidden>
---
pc-bios/s390-ccw/main.c | 28 ++++++++++++++++++++--------
1 file changed, 20 insertions(+), 8 deletions(-)
diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c
index e82fe2ce23..67df42191b 100644
--- a/pc-bios/s390-ccw/main.c
+++ b/pc-bios/s390-ccw/main.c
@@ -14,16 +14,17 @@
char stack[PAGE_SIZE * 8] __attribute__((__aligned__(PAGE_SIZE)));
static SubChannelId blk_schid = { .one = 1 };
-IplParameterBlock iplb __attribute__((__aligned__(PAGE_SIZE)));
static char loadparm_str[LOADPARM_LEN + 1] = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
QemuIplParameters qipl;
+IplParameterBlock iplb __attribute__((__aligned__(PAGE_SIZE)));
+static bool have_iplb;
#define LOADPARM_PROMPT "PROMPT "
#define LOADPARM_EMPTY " "
#define BOOT_MENU_FLAG_MASK (QIPL_FLAG_BM_OPTS_CMD | QIPL_FLAG_BM_OPTS_ZIPL)
/*
- * Priniciples of Operations (SA22-7832-09) chapter 17 requires that
+ * Principles of Operations (SA22-7832-09) chapter 17 requires that
* a subsystem-identification is at 184-187 and bytes 188-191 are zero
* after list-directed-IPL and ccw-IPL.
*/
@@ -111,23 +112,33 @@ static void css_setup(void)
enable_mss_facility();
}
+/*
+ * Collect various pieces of information from the hypervisor/hardware that
+ * we'll use to determine exactly how we'll boot.
+ */
+static void boot_setup(void)
+{
+ char lpmsg[] = "LOADPARM=[________]\n";
+
+ sclp_get_loadparm_ascii(loadparm_str);
+ memcpy(lpmsg + 10, loadparm_str, 8);
+ sclp_print(lpmsg);
+
+ have_iplb = store_iplb(&iplb);
+}
+
static void virtio_setup(void)
{
Schib schib;
int ssid;
bool found = false;
uint16_t dev_no;
- char ldp[] = "LOADPARM=[________]\n";
VDev *vdev = virtio_get_device();
QemuIplParameters *early_qipl = (QemuIplParameters *)QIPL_ADDRESS;
- sclp_get_loadparm_ascii(loadparm_str);
- memcpy(ldp + 10, loadparm_str, LOADPARM_LEN);
- sclp_print(ldp);
-
memcpy(&qipl, early_qipl, sizeof(QemuIplParameters));
- if (store_iplb(&iplb)) {
+ if (have_iplb) {
switch (iplb.pbt) {
case S390_IPL_TYPE_CCW:
dev_no = iplb.ccw.devno;
@@ -174,6 +185,7 @@ int main(void)
{
sclp_setup();
css_setup();
+ boot_setup();
virtio_setup();
zipl_load(); /* no return */
--
2.21.0
- [qemu-s390x] [PULL SUBSYSTEM s390-ccw-bios 00/17] vfio-ccw dasd ipl support, Thomas Huth, 2019/04/12
- [qemu-s390x] [PULL SUBSYSTEM s390-ccw-bios 02/17] s390-bios: decouple cio setup from virtio, Thomas Huth, 2019/04/12
- [qemu-s390x] [PULL SUBSYSTEM s390-ccw-bios 03/17] s390-bios: decouple common boot logic from virtio,
Thomas Huth <=
- [qemu-s390x] [PULL SUBSYSTEM s390-ccw-bios 01/17] s390 vfio-ccw: Add bootindex property and IPLB data, Thomas Huth, 2019/04/12
- [qemu-s390x] [PULL SUBSYSTEM s390-ccw-bios 04/17] s390-bios: Clean up cio.h, Thomas Huth, 2019/04/12
- [qemu-s390x] [PULL SUBSYSTEM s390-ccw-bios 05/17] s390-bios: Decouple channel i/o logic from virtio, Thomas Huth, 2019/04/12
- [qemu-s390x] [PULL SUBSYSTEM s390-ccw-bios 06/17] s390-bios: Map low core memory, Thomas Huth, 2019/04/12
- [qemu-s390x] [PULL SUBSYSTEM s390-ccw-bios 07/17] s390-bios: ptr2u32 and u32toptr, Thomas Huth, 2019/04/12
- [qemu-s390x] [PULL SUBSYSTEM s390-ccw-bios 10/17] s390-bios: Extend find_dev() for non-virtio devices, Thomas Huth, 2019/04/12
- [qemu-s390x] [PULL SUBSYSTEM s390-ccw-bios 08/17] s390-bios: Support for running format-0/1 channel programs, Thomas Huth, 2019/04/12
- [qemu-s390x] [PULL SUBSYSTEM s390-ccw-bios 09/17] s390-bios: cio error handling, Thomas Huth, 2019/04/12
- [qemu-s390x] [PULL SUBSYSTEM s390-ccw-bios 11/17] s390-bios: Factor finding boot device out of virtio code path, Thomas Huth, 2019/04/12
- [qemu-s390x] [PULL SUBSYSTEM s390-ccw-bios 12/17] s390-bios: Refactor virtio to run channel programs via cio, Thomas Huth, 2019/04/12