riscv: Change the default behavior if no -bios option is specified
Per QEMU deprecated doc, QEMU 4.1 introduced support for the -bios option in QEMU for RISC-V for the virt machine and sifive_u machine. The default behavior has been that QEMU does not automatically load any firmware if no -bios option is included. Now 2 releases passed, it's time to change the default behavior to load the default OpenSBI firmware automatically. The firmware is included with the QEMU release and no user interaction is required. All a user needs to do is specify the kernel they want to boot with the -kernel option. Signed-off-by: Bin Meng <bin.meng@windriver.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Message-id: 1588335545-649-1-git-send-email-bmeng.cn@gmail.com Message-Id: <1588335545-649-1-git-send-email-bmeng.cn@gmail.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
This commit is contained in:
parent
ac5f7246d7
commit
087a424674
|
@ -41,34 +41,11 @@ void riscv_find_and_load_firmware(MachineState *machine,
|
||||||
{
|
{
|
||||||
char *firmware_filename = NULL;
|
char *firmware_filename = NULL;
|
||||||
|
|
||||||
if (!machine->firmware) {
|
if ((!machine->firmware) || (!strcmp(machine->firmware, "default"))) {
|
||||||
/*
|
/*
|
||||||
* The user didn't specify -bios.
|
* The user didn't specify -bios, or has specified "-bios default".
|
||||||
* At the moment we default to loading nothing when this hapens.
|
* That means we are going to load the OpenSBI binary included in
|
||||||
* In the future this defaul will change to loading the prebuilt
|
* the QEMU source.
|
||||||
* OpenSBI firmware. Let's warn the user and then continue.
|
|
||||||
*/
|
|
||||||
if (!qtest_enabled()) {
|
|
||||||
warn_report("No -bios option specified. Not loading a firmware.");
|
|
||||||
warn_report("This default will change in a future QEMU release. " \
|
|
||||||
"Please use the -bios option to avoid breakages when "\
|
|
||||||
"this happens.");
|
|
||||||
warn_report("See QEMU's deprecation documentation for details.");
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!strcmp(machine->firmware, "default")) {
|
|
||||||
/*
|
|
||||||
* The user has specified "-bios default". That means we are going to
|
|
||||||
* load the OpenSBI binary included in the QEMU source.
|
|
||||||
*
|
|
||||||
* We can't load the binary by default as it will break existing users
|
|
||||||
* as users are already loading their own firmware.
|
|
||||||
*
|
|
||||||
* Let's try to get everyone to specify the -bios option at all times,
|
|
||||||
* so then in the future we can make "-bios default" the default option
|
|
||||||
* if no -bios option is set without breaking anything.
|
|
||||||
*/
|
*/
|
||||||
firmware_filename = riscv_find_firmware(default_machine_firmware);
|
firmware_filename = riscv_find_firmware(default_machine_firmware);
|
||||||
} else if (strcmp(machine->firmware, "none")) {
|
} else if (strcmp(machine->firmware, "none")) {
|
||||||
|
|
Loading…
Reference in a new issue