From patchwork Fri Apr 26 18:19:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 239904 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 96ADF2C011B for ; Sat, 27 Apr 2013 04:22:20 +1000 (EST) Received: from localhost ([::1]:52921 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVnHm-0002rZ-PR for incoming@patchwork.ozlabs.org; Fri, 26 Apr 2013 14:22:18 -0400 Received: from eggs.gnu.org ([208.118.235.92]:54328) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVnFB-0007n5-1i for qemu-devel@nongnu.org; Fri, 26 Apr 2013 14:19:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UVnF9-0004Ar-40 for qemu-devel@nongnu.org; Fri, 26 Apr 2013 14:19:36 -0400 Received: from cantor2.suse.de ([195.135.220.15]:38694 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVnF8-0004AQ-RC; Fri, 26 Apr 2013 14:19:35 -0400 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 498635E000204; Fri, 26 Apr 2013 20:19:34 +0200 (CEST) From: Alexander Graf To: qemu-ppc@nongnu.org Date: Fri, 26 Apr 2013 20:19:10 +0200 Message-Id: <1367000373-7972-2-git-send-email-agraf@suse.de> X-Mailer: git-send-email 1.6.0.2 In-Reply-To: <1367000373-7972-1-git-send-email-agraf@suse.de> References: <1367000373-7972-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: Blue Swirl , qemu-devel@nongnu.org, Aurelien Jarno Subject: [Qemu-devel] [PATCH 01/24] S390: Make IPL reset address dynamic 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 We can have different load addresses for different blobs we boot with. Make the reset IP dynamic, so that we can handle things more flexibly. Signed-off-by: Alexander Graf --- hw/s390x/ipl.c | 22 +++++++++++----------- 1 files changed, 11 insertions(+), 11 deletions(-) diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c index 206d552..c43dfcd 100644 --- a/hw/s390x/ipl.c +++ b/hw/s390x/ipl.c @@ -48,8 +48,9 @@ typedef struct S390IPLClass { typedef struct S390IPLState { /*< private >*/ SysBusDevice parent_obj; - /*< public >*/ + uint64_t start_addr; + /*< public >*/ char *kernel; char *initrd; char *cmdline; @@ -82,6 +83,7 @@ static int s390_ipl_init(SysBusDevice *dev) bios_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); bios_size = load_image_targphys(bios_filename, ZIPL_IMAGE_START, 4096); + ipl->start_addr = ZIPL_IMAGE_START; g_free(bios_filename); if ((long)bios_size < 0) { @@ -104,6 +106,13 @@ static int s390_ipl_init(SysBusDevice *dev) } /* we have to overwrite values in the kernel image, which are "rom" */ strcpy(rom_ptr(KERN_PARM_AREA), ipl->cmdline); + + /* + * we can not rely on the ELF entry point, since up to 3.2 this + * value was 0x800 (the SALIPL loader) and it wont work. For + * all (Linux) cases 0x10000 (KERN_IMAGE_START) should be fine. + */ + ipl->start_addr = KERN_IMAGE_START; } if (ipl->initrd) { ram_addr_t initrd_offset, initrd_size; @@ -138,16 +147,7 @@ static void s390_ipl_reset(DeviceState *dev) { S390IPLState *ipl = S390_IPL(dev); - if (ipl->kernel) { - /* - * we can not rely on the ELF entry point, since up to 3.2 this - * value was 0x800 (the SALIPL loader) and it wont work. For - * all (Linux) cases 0x10000 (KERN_IMAGE_START) should be fine. - */ - return s390_ipl_cpu(KERN_IMAGE_START); - } else { - return s390_ipl_cpu(ZIPL_IMAGE_START); - } + s390_ipl_cpu(ipl->start_addr); } static void s390_ipl_class_init(ObjectClass *klass, void *data)