From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39198) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKgrq-0000ka-I6 for qemu-devel@nongnu.org; Wed, 06 Jul 2016 03:03:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bKgrn-0003Z3-8a for qemu-devel@nongnu.org; Wed, 06 Jul 2016 03:03:30 -0400 Received: from 9.mo4.mail-out.ovh.net ([46.105.40.176]:51276) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKgrm-0003Yq-UQ for qemu-devel@nongnu.org; Wed, 06 Jul 2016 03:03:27 -0400 Received: from player687.ha.ovh.net (b9.ovh.net [213.186.33.59]) by mo4.mail-out.ovh.net (Postfix) with ESMTP id 0CC1E1024DA4 for ; Wed, 6 Jul 2016 09:03:20 +0200 (CEST) Date: Wed, 6 Jul 2016 09:03:12 +0200 From: Greg Kurz Message-ID: <20160706090312.01461ee9@bahia.lan> In-Reply-To: References: <1467729757-12441-1-git-send-email-lvivier@redhat.com> <20160705204426.38e49938@bahia.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH RFC] spapr: by-pass SLOF when -kernel is provided List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laurent Vivier Cc: Thomas Huth , "Richard W.M. Jones" , Andrew Jones , qemu-devel@nongnu.org, qemu-ppc@nongnu.org, David Gibson On Tue, 5 Jul 2016 20:51:41 +0200 Laurent Vivier wrote: > On 05/07/2016 20:44, Greg Kurz wrote: > > On Tue, 5 Jul 2016 16:42:37 +0200 > > Laurent Vivier wrote: > > > >> 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. > >> > > > > The concept looks great so I gave a try with a fedora24 guest. > > I did the same test with a rhel7 vmlinuz adn intramfs and it works fine. > > > > > I copied the kernel and initramfs to the host and passed the kernel arguments > > taken from grub. > > > > The kernel starts but the boot sequence stalls at: > > > > [ OK ] Reached target Basic System. > > [ 126.238400] dracut-initqueue[290]: Warning: dracut-initqueue timeout - starting timeout scripts > > It happens when the initramfs didn't have the disk driver: do you use > the same disk controller with the "-kernel" than the one which was used > when the initramfs has been created? > Yes. The very same QEMU command line (except -kernel/-initrd/-append) works with SLOF and fails without SLOF. > > > > I also noticed this error: > > > > [ 0.127303] WARNING: nvram corruption detected: 0-length partition > > [ 0.127610] nvram: No room to create ibm,rtas-log partition, deleting any obsolete OS partitions... > > [ 0.128011] nvram: Failed to find or create ibm,rtas-log partition, err -28 > > [ 0.128300] nvram: No room to create lnx,oops-log partition, deleting any obsolete OS partitions... > > [ 0.128701] nvram: Failed to find or create lnx,oops-log partition, err -28 > > Linux ppc6400] nvram: Failed to initialize oops partition! > > I've also that: perhaps SLOF is initializing the NVRAM when it is empty, > and qemu doesn't? > > I will check. > > Thanks, > Laurent > > > > > Cc'ing Nikunj who has already worked on booting a guest without SLOF. > > > > > >> 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 */ > > >