From patchwork Mon May 6 15:30:22 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 241753 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 408052C00D0 for ; Tue, 7 May 2013 04:21:16 +1000 (EST) Received: from localhost ([::1]:40269 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZNOa-0007Fb-9A for incoming@patchwork.ozlabs.org; Mon, 06 May 2013 11:32:08 -0400 Received: from eggs.gnu.org ([208.118.235.92]:36107) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZNMz-0006Q0-Qx for qemu-devel@nongnu.org; Mon, 06 May 2013 11:30:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UZNMy-0003Bi-3Q for qemu-devel@nongnu.org; Mon, 06 May 2013 11:30:29 -0400 Received: from cantor2.suse.de ([195.135.220.15]:60840 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZNMx-0003BJ-NC for qemu-devel@nongnu.org; Mon, 06 May 2013 11:30:27 -0400 Received: from relay1.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 209DEA52D9; Mon, 6 May 2013 17:30:27 +0200 (CEST) From: Alexander Graf To: qemu-devel@nongnu.org Date: Mon, 6 May 2013 17:30:22 +0200 Message-Id: <1367854224-2354-5-git-send-email-agraf@suse.de> X-Mailer: git-send-email 1.6.0.2 In-Reply-To: <1367854224-2354-1-git-send-email-agraf@suse.de> References: <1367854224-2354-1-git-send-email-agraf@suse.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-Received-From: 195.135.220.15 Cc: blauwirbel@gmail.com, Dominik Dingel , anthony@codemonkey.ws, aurelien@aurel32.net Subject: [Qemu-devel] [PATCH 4/6] S390: Add virtio-blk boot X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: 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 Signed-off-by: Alexander Graf --- hw/s390x/ipl.c | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c index d14c548..0aeb003 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); }