[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[qemu-s390x] [PULL 13/19] s390-bios: Use control unit type to determine
From: |
Cornelia Huck |
Subject: |
[qemu-s390x] [PULL 13/19] s390-bios: Use control unit type to determine boot method |
Date: |
Thu, 25 Apr 2019 15:21:28 +0200 |
From: "Jason J. Herne" <address@hidden>
The boot method is different depending on which device type we are
booting from. Let's examine the control unit type to determine if we're
a virtio device. We'll eventually add a case to check for a real dasd device
here as well.
Since we have to call enable_subchannel() in main now, might as well
remove that call from virtio.c : run_ccw(). This requires adding some
additional enable_subchannel calls to not break calls to
virtio_is_supported().
Signed-off-by: Jason J. Herne <address@hidden>
Reviewed-by: Cornelia Huck <address@hidden>
Reviewed-by: Thomas Huth <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Thomas Huth <address@hidden>
---
pc-bios/s390-ccw/main.c | 16 ++++++++++++++--
pc-bios/s390-ccw/netmain.c | 1 +
pc-bios/s390-ccw/virtio.c | 1 -
3 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c
index d3a161c68546..57a10138c65d 100644
--- a/pc-bios/s390-ccw/main.c
+++ b/pc-bios/s390-ccw/main.c
@@ -76,6 +76,7 @@ static bool find_subch(int dev_no)
/* Skip net devices since no IPLB is created and therefore no
* network bootloader has been loaded
*/
+ enable_subchannel(blk_schid);
if (virtio_is_supported(blk_schid) &&
virtio_get_device_type() == VIRTIO_ID_NET && dev_no < 0) {
continue;
@@ -198,13 +199,24 @@ static void virtio_setup(void)
int main(void)
{
+ uint16_t cutype;
+
sclp_setup();
css_setup();
boot_setup();
find_boot_device();
+ enable_subchannel(blk_schid);
- virtio_setup();
- zipl_load(); /* no return */
+ cutype = cu_type(blk_schid);
+ switch (cutype) {
+ case CU_TYPE_VIRTIO:
+ virtio_setup();
+ zipl_load(); /* no return */
+ break;
+ default:
+ print_int("Attempting to boot from unexpected device type", cutype);
+ panic("");
+ }
panic("Failed to load OS from hard disk\n");
return 0; /* make compiler happy */
diff --git a/pc-bios/s390-ccw/netmain.c b/pc-bios/s390-ccw/netmain.c
index 5189c0fc39e5..f3542cb2cf11 100644
--- a/pc-bios/s390-ccw/netmain.c
+++ b/pc-bios/s390-ccw/netmain.c
@@ -476,6 +476,7 @@ static bool find_net_dev(Schib *schib, int dev_no)
if (!schib->pmcw.dnv) {
continue;
}
+ enable_subchannel(net_schid);
if (!virtio_is_supported(net_schid)) {
continue;
}
diff --git a/pc-bios/s390-ccw/virtio.c b/pc-bios/s390-ccw/virtio.c
index 35278eaee13d..fb40ca982853 100644
--- a/pc-bios/s390-ccw/virtio.c
+++ b/pc-bios/s390-ccw/virtio.c
@@ -102,7 +102,6 @@ static int run_ccw(VDev *vdev, int cmd, void *ptr, int len,
bool sli)
ccw.flags |= CCW_FLAG_SLI;
}
- enable_subchannel(vdev->schid);
return do_cio(vdev->schid, vdev->senseid.cu_type, ptr2u32(&ccw), CCW_FMT1);
}
--
2.17.2
- [qemu-s390x] [PULL 03/19] s390-bios: decouple common boot logic from virtio, (continued)
- [qemu-s390x] [PULL 03/19] s390-bios: decouple common boot logic from virtio, Cornelia Huck, 2019/04/25
- [qemu-s390x] [PULL 04/19] s390-bios: Clean up cio.h, Cornelia Huck, 2019/04/25
- [qemu-s390x] [PULL 05/19] s390-bios: Decouple channel i/o logic from virtio, Cornelia Huck, 2019/04/25
- [qemu-s390x] [PULL 06/19] s390-bios: Map low core memory, Cornelia Huck, 2019/04/25
- [qemu-s390x] [PULL 07/19] s390-bios: ptr2u32 and u32toptr, Cornelia Huck, 2019/04/25
- [qemu-s390x] [PULL 08/19] s390-bios: Support for running format-0/1 channel programs, Cornelia Huck, 2019/04/25
- [qemu-s390x] [PULL 10/19] s390-bios: Extend find_dev() for non-virtio devices, Cornelia Huck, 2019/04/25
- [qemu-s390x] [PULL 09/19] s390-bios: cio error handling, Cornelia Huck, 2019/04/25
- [qemu-s390x] [PULL 12/19] s390-bios: Refactor virtio to run channel programs via cio, Cornelia Huck, 2019/04/25
- [qemu-s390x] [PULL 11/19] s390-bios: Factor finding boot device out of virtio code path, Cornelia Huck, 2019/04/25
- [qemu-s390x] [PULL 13/19] s390-bios: Use control unit type to determine boot method,
Cornelia Huck <=
- [qemu-s390x] [PULL 14/19] s390-bios: Add channel command codes/structs needed for dasd-ipl, Cornelia Huck, 2019/04/25
- [qemu-s390x] [PULL 15/19] s390-bios: Support booting from real dasd device, Cornelia Huck, 2019/04/25
- [qemu-s390x] [PULL 16/19] s390-bios: Use control unit type to find bootable devices, Cornelia Huck, 2019/04/25
- [qemu-s390x] [PULL 19/19] exec: Introduce qemu_maxrampagesize() and rename qemu_getrampagesize(), Cornelia Huck, 2019/04/25
- [qemu-s390x] [PULL 18/19] s390x/kvm: Configure page size after memory has actually been initialized, Cornelia Huck, 2019/04/25
- [qemu-s390x] [PULL 17/19] pc-bios/s390: Update firmware images, Cornelia Huck, 2019/04/25
- Re: [qemu-s390x] [PULL 00/19] first batch of s390x patches for 4.1, Peter Maydell, 2019/04/26