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