Received: from eggs.gnu.org ([2001:4830:134:3::10]:57797) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W685X-0002DH-5X for qemu-devel@nongnu.org; Wed, 22 Jan 2014 19:24:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W685R-0007yk-5Z for qemu-devel@nongnu.org; Wed, 22 Jan 2014 19:24:07 -0500 Message-ID: <1390436621.24905.535.camel@snotra.buserror.net> From: Scott Wood Date: Wed, 22 Jan 2014 18:23:41 -0600 In-Reply-To: <1390175077-5717-11-git-send-email-agraf@suse.de> References: <1390175077-5717-1-git-send-email-agraf@suse.de> <1390175077-5717-11-git-send-email-agraf@suse.de> Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 10/10] PPC: e500: Move to u-boot as firmware List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org On Mon, 2014-01-20 at 00:44 +0100, Alexander Graf wrote: > Almost all platforms QEMU emulates have some sort of firmware they can load > to expose a guest environment that closely resembles the way it would look > like on real hardware. > > This patch introduces such a firmware on our e500 platforms. U-boot is the > default firmware for most of these systems and as such our preferred choice. > > For now, it is able to expose the same functionality to the user as the direct > -kernel option was, just that it prints some nice messages beforehand. > > However, if you abort the boot (press any key) or boot without -kernel you > are actually able to modify the boot environment, execute a networked boot > through the e1000 emulation and execute u-boot payloads. Have you removed support for loading the kernel directly? I thought you said you were only going to load U-Boot in the absence of -kernel. Given the absence of runtime services, and the presence of a standardized OS entry mechanism (ePAPR), inserting firmware into the process seems like a niche use case rather than something that should be the default, much less mandatory. > + /* Load u-boot (ELF) */ > + if (bios_name == NULL) { > + bios_name = "u-boot.e500"; > + } > + filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); > + > + bios_size = load_elf(filename, NULL, NULL, &bios_entry, &loadaddr, NULL, > + 1, ELF_MACHINE, 0); > + if (bios_size < 0) { > + /* > + * Hrm. No ELF image? Try a uImage, maybe someone is giving us an > + * ePAPR compliant kernel > + */ ePAPR specifies ELF, not uImage (though QEMU does currently support ePAPR-ish loading of uImages, as U-Boot does) -- and you still seem to be trying to load firmware here, not a kernel. -Scott