From patchwork Tue Jul 5 14:42:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 644812 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rkRbF0GV2z9s9Y for ; Wed, 6 Jul 2016 00:48:40 +1000 (AEST) Received: from localhost ([::1]:55548 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKReP-0001ZQ-3H for incoming@patchwork.ozlabs.org; Tue, 05 Jul 2016 10:48:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47530) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKRZ3-0004DO-Uq for qemu-devel@nongnu.org; Tue, 05 Jul 2016 10:43:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bKRZ0-0006xX-On for qemu-devel@nongnu.org; Tue, 05 Jul 2016 10:43:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33527) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKRZ0-0006xR-Iv; Tue, 05 Jul 2016 10:43:02 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 278A972D37; Tue, 5 Jul 2016 14:43:02 +0000 (UTC) Received: from thinkpad.redhat.com (ovpn-112-17.ams2.redhat.com [10.36.112.17]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u65Egwkt005539; Tue, 5 Jul 2016 10:42:59 -0400 From: Laurent Vivier To: David Gibson Date: Tue, 5 Jul 2016 16:42:37 +0200 Message-Id: <1467729757-12441-1-git-send-email-lvivier@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 05 Jul 2016 14:43:02 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH RFC] spapr: by-pass SLOF when -kernel is provided X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Andrew Jones , "Richard W.M. Jones" , Thomas Huth , qemu-devel@nongnu.org, qemu-ppc@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" As device-tree is now fully built by QEMU, we don't need SLOF anymore if the kernel is provided on the command line. In this case, don't load SLOF and boot directly into the kernel. This saves at least 5 seconds on the boot sequence. Signed-off-by: Laurent Vivier --- hw/ppc/spapr.c | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 7f33a1b..bbdb21d 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -1219,8 +1219,11 @@ static void ppc_spapr_reset(void) first_ppc_cpu->env.gpr[3] = spapr->fdt_addr; first_ppc_cpu->env.gpr[5] = 0; first_cpu->halted = 0; - first_ppc_cpu->env.nip = SPAPR_ENTRY_POINT; - + if (machine->kernel_filename) { + first_ppc_cpu->env.nip = KERNEL_LOAD_ADDR; + } else { + first_ppc_cpu->env.nip = SPAPR_ENTRY_POINT; + } } static void spapr_create_nvram(sPAPRMachineState *spapr) @@ -2023,23 +2026,23 @@ static void ppc_spapr_init(MachineState *machine) initrd_base = 0; initrd_size = 0; } + } else { + if (bios_name == NULL) { + bios_name = FW_FILE_NAME; + } + filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); + if (!filename) { + error_report("Could not find LPAR firmware '%s'", bios_name); + exit(1); + } + fw_size = load_image_targphys(filename, 0, FW_MAX_SIZE); + if (fw_size <= 0) { + error_report("Could not load LPAR firmware '%s'", filename); + exit(1); + } + g_free(filename); } - if (bios_name == NULL) { - bios_name = FW_FILE_NAME; - } - filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); - if (!filename) { - error_report("Could not find LPAR firmware '%s'", bios_name); - exit(1); - } - fw_size = load_image_targphys(filename, 0, FW_MAX_SIZE); - if (fw_size <= 0) { - error_report("Could not load LPAR firmware '%s'", filename); - exit(1); - } - g_free(filename); - /* FIXME: Should register things through the MachineState's qdev * interface, this is a legacy from the sPAPREnvironment structure * which predated MachineState but had a similar function */