Commit 3668cb7c authored by Jason J. Herne's avatar Jason J. Herne Committed by Thomas Huth
Browse files

s390-bios: Use control unit type to determine boot method



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: default avatarJason J. Herne <jjherne@linux.ibm.com>
Reviewed-by: default avatarCornelia Huck <cohuck@redhat.com>
Reviewed-by: default avatarThomas Huth <thuth@redhat.com>
Message-Id: <1554388475-18329-14-git-send-email-jjherne@linux.ibm.com>
Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
parent 9de6cbb1
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
@@ -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);

    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 */
+1 −0
Original line number Diff line number Diff line
@@ -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;
        }
+0 −1
Original line number Diff line number Diff line
@@ -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);
}