Received: from eggs.gnu.org ([208.118.235.92]:60578) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UXEA5-0005pu-5i for qemu-devel@nongnu.org; Tue, 30 Apr 2013 13:16:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UXE9x-0000wv-EB for qemu-devel@nongnu.org; Tue, 30 Apr 2013 13:16:17 -0400 Received: from e06smtp10.uk.ibm.com ([195.75.94.106]:45585) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UXE9w-0000wO-Tp for qemu-devel@nongnu.org; Tue, 30 Apr 2013 13:16:09 -0400 Received: from /spool/local by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 30 Apr 2013 18:14:21 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id BADA21B0805D for ; Tue, 30 Apr 2013 18:16:04 +0100 (BST) Received: from d06av07.portsmouth.uk.ibm.com (d06av07.portsmouth.uk.ibm.com [9.149.37.248]) by b06cxnps4076.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r3UHFsAE42926244 for ; Tue, 30 Apr 2013 17:15:54 GMT Received: from d06av07.portsmouth.uk.ibm.com (d06av07.portsmouth.uk.ibm.com [127.0.0.1]) by d06av07.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r3UFwZfF030303 for ; Tue, 30 Apr 2013 11:58:35 -0400 From: Dominik Dingel Date: Tue, 30 Apr 2013 19:15:57 +0200 Message-Id: <1367342159-21545-3-git-send-email-dingel@linux.vnet.ibm.com> In-Reply-To: <1367342159-21545-1-git-send-email-dingel@linux.vnet.ibm.com> References: <1367342159-21545-1-git-send-email-dingel@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH v3 2/4] S390: Add virtio-blk boot List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Christian Borntraeger , Dominik Dingel If no kernel IPL entry is specified, boot the bios and pass if available device information for the first boot device (as given by the boot index). The provided information will be used in the next commit from the BIOS. Signed-off-by: Dominik Dingel diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c index d14c548..5c26873 100644 --- a/hw/s390x/ipl.c +++ b/hw/s390x/ipl.c @@ -16,6 +16,8 @@ #include "elf.h" #include "hw/loader.h" #include "hw/sysbus.h" +#include "hw/s390x/virtio-ccw.h" +#include "hw/s390x/css.h" #define KERN_IMAGE_START 0x010000UL #define KERN_PARM_AREA 0x010480UL @@ -150,6 +152,22 @@ static void s390_ipl_reset(DeviceState *dev) env->psw.addr = ipl->start_addr; env->psw.mask = IPL_PSW_MASK; + + if (!ipl->kernel) { + /* booting firmware, tell what device to boot from */ + DeviceState *dev_st = get_boot_device(0); + VirtioCcwDevice *ccw_dev = (VirtioCcwDevice *) object_dynamic_cast( + OBJECT(&(dev_st->parent_obj)), "virtio-blk-ccw"); + + if (ccw_dev) { + env->regs[7] = ccw_dev->sch->cssid << 24 | + ccw_dev->sch->ssid << 16 | + ccw_dev->sch->devno; + } else { + env->regs[7] = -1; + } + } + s390_add_running_cpu(cpu); } -- 1.7.1