From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51445) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKcSX-0001Ik-FU for qemu-devel@nongnu.org; Tue, 05 Jul 2016 22:21:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bKcSV-0002UK-53 for qemu-devel@nongnu.org; Tue, 05 Jul 2016 22:21:04 -0400 Date: Wed, 6 Jul 2016 11:35:29 +1000 From: David Gibson Message-ID: <20160706013529.GT2251@voom.fritz.box> References: <1467729757-12441-1-git-send-email-lvivier@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="bxF9Dep5HzwGj9mC" Content-Disposition: inline In-Reply-To: <1467729757-12441-1-git-send-email-lvivier@redhat.com> Subject: Re: [Qemu-devel] [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: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, "Richard W.M. Jones" , Thomas Huth , Andrew Jones --bxF9Dep5HzwGj9mC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jul 05, 2016 at 04:42:37PM +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. >=20 > In this case, don't load SLOF and boot directly into the > kernel. >=20 > This saves at least 5 seconds on the boot sequence. >=20 > Signed-off-by: Laurent Vivier I'm not comfortable applying this. We actually used to do this ages ago, but changed to always running through SLOF, and there were reasons for doing so. I don't remember exactly what they were, but I think it boiled down to slight differences in state between booting from SLOF and booting without SLOF leading to confusing errors from the guest kernel. > --- > hw/ppc/spapr.c | 37 ++++++++++++++++++++----------------- > 1 file changed, 20 insertions(+), 17 deletions(-) >=20 > 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] =3D spapr->fdt_addr; > first_ppc_cpu->env.gpr[5] =3D 0; > first_cpu->halted =3D 0; > - first_ppc_cpu->env.nip =3D SPAPR_ENTRY_POINT; > - > + if (machine->kernel_filename) { > + first_ppc_cpu->env.nip =3D KERNEL_LOAD_ADDR; > + } else { > + first_ppc_cpu->env.nip =3D SPAPR_ENTRY_POINT; > + } > } > =20 > static void spapr_create_nvram(sPAPRMachineState *spapr) > @@ -2023,23 +2026,23 @@ static void ppc_spapr_init(MachineState *machine) > initrd_base =3D 0; > initrd_size =3D 0; > } > + } else { > + if (bios_name =3D=3D NULL) { > + bios_name =3D FW_FILE_NAME; > + } > + filename =3D 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 =3D load_image_targphys(filename, 0, FW_MAX_SIZE); > + if (fw_size <=3D 0) { > + error_report("Could not load LPAR firmware '%s'", filename); > + exit(1); > + } > + g_free(filename); > } > =20 > - if (bios_name =3D=3D NULL) { > - bios_name =3D FW_FILE_NAME; > - } > - filename =3D 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 =3D load_image_targphys(filename, 0, FW_MAX_SIZE); > - if (fw_size <=3D 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 */ --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --bxF9Dep5HzwGj9mC Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXfGBhAAoJEGw4ysog2bOSqNkP/2xjYEtsbW455XdeTvZIHhR6 9Tqy8FuVZMjTZ3StxPibplxud2WyKx8x4vG5f6bS7ZM0CV8VQwyilQCkE4QJ/ZAA I7UCcvJCBHIDXBRd8nYCW0cJpugRptZjSJC3R4URz46KtE32FyjrCy1vajHwcak5 faCz8Fq702OVVDUoe/YACmgsqN83JlU4rpJOPE9TupIN3nTPjhTBUrIJ1ZCaRd6u lSexrQ7i0LrRqdCYl9Vg+McpUqWSxD2Ou5twUV/BByt33Cc5Iy+II3aPMakfz/S7 iOaGYLRhRBdre1kY/AOQLeUylKtFj2nSOgiAcnBA3zT95kXDPh3nduxNHkOpKdUa 7nW9SDek93gRHonDHF5+J5RcUMm3sRYrK+O3vDI1cBNyE6rLaxkr6PVIjNtuJS8f x1MzJmPOaH9suoV96F4UgbTMPmNUj2Ff143Wcd4egWbILpSEMMN4LV1WGmlG5x4j dfHxykK/L002rexRbUApVaTaH7uZIqQcrNs48cP9couSsi4Z+H7KURe74lIByBVv UGsBSy69re/AKk8VsSKBpoTKNBnHu02one4S8iXHQQXOyAC4+slouEmQjuB0Zd8H l+gXMJjdkI0+HT3U5M/K2U6ZWrfOJLkvIqWITs9rPA7frr1Tsj1k4zPi385u7ZIq Ke4Qy4uOjD+dKl0Bfbjh =MPcO -----END PGP SIGNATURE----- --bxF9Dep5HzwGj9mC--