hw/mips: malta: Don't boot from flash with KVM T&E
PATCH 1/1 hw/mips: malta: Don't boot from flash with KVM T&E
In KVM trap & emulate (T&E) mode the flash reset region at 0xbfc00000 isn't executable, which is why the minimal kernel bootloader is loaded and executed from the last 1MB of DRAM instead.
Therefore if no kernel is provided on the command line and KVM is enabled, exit with an error since booting from flash will fail.
--- hw/mips/mips_malta.c | 6 ++++++ 1 file changed, 6 insertions(+)
hw/mips/mips_malta.c +6 -0
@@ -1052,6 +1052,12 @@ void mips_malta_init(MachineState *machine) bootloader_run_addr, kernel_entry); } }else { +/* The flash region isn't executable from a KVM T&E guest */ +if (kvm_enabled ()) { +error_report ("KVM enabled but no -kernel argument was specified. " +"Booting from flash is not supported with KVM T&E." ); +exit (1 ); + }/* Load firmware from flash. */ if (!dinfo) {/* Load a BIOS image. */
Signature · 1 line
1.9.3
Hi,
Am 20.06.2014 13:47, schrieb James Hogan:
Quoted 7 lines
In KVM trap & emulate (T&E) mode the flash reset region at
0xbfc00000isn't executable, which is why the minimal kernel bootloader is loaded and executed from the last 1MB of DRAM instead.Therefore if no kernel is provided on the command line and KVM is enabled, exit with an error since booting from flash will fail.
Quoted 6 lines
Reported-by Aurelien Jarno <[email protected]>Signed-off-by James Hogan <[email protected]>Cc Paolo Bonzini <[email protected]>--- hw/mips/mips_malta.c | 6 ++++++ 1 file changed, 6 insertions(+)
Previous commits have used just "mips_malta:", so suggest to do the same for consistency - or clean hw/mips/ dir up by renaming the file to just malta.c and use "mips/malta:".
That said,
Quoted 7 lines
hw/mips/mips_malta.c +0
-0@@ -1052,6 +1052,12 @@ void mips_malta_init(MachineState *machine) bootloader_run_addr, kernel_entry); }
hw/mips/mips_malta.c void mips_malta_init(MachineState *machine) · line 1063
Quoted 10 lines
hw/mips/mips_malta.c +6
-0}else { +/* The flash region isn't executable from a KVM T&E guest */ +if (kvm_enabled ()) { +error_report ("KVM enabled but no -kernel argument was specified. " +"Booting from flash is not supported with KVM T&E." ); +exit (1 ); + }/* Load firmware from flash. */ if (!dinfo) {/* Load a BIOS image. */
Are users expected to know/understand "KVM T&E"? You don't test for that T&E mode here, so you could either shorten the message to just "KVM" or replace the check with a more specific one.
Since qtest does not use KVM on MIPS today, exiting without -kernel should be fine, but may need updating if we ever get to that.
Regards,
Andreas
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
Quoted 17 lines · Andreas Färber
Hi,
Am 20.06.2014 13:47, schrieb James Hogan:
Quoted 7 lines
In KVM trap & emulate (T&E) mode the flash reset region at
0xbfc00000isn't executable, which is why the minimal kernel bootloader is loaded and executed from the last 1MB of DRAM instead.Therefore if no kernel is provided on the command line and KVM is enabled, exit with an error since booting from flash will fail.
Quoted 6 lines
Reported-by Aurelien Jarno <[email protected]>Signed-off-by James Hogan <[email protected]>Cc Paolo Bonzini <[email protected]>--- hw/mips/mips_malta.c | 6 ++++++ 1 file changed, 6 insertions(+)
Quoted 5 lines
Previous commits have used just "
mips_malta:", so suggest to do the same for consistency - or clean hw/mips/ dir up by renaming the file to justmalta.cand use "mips/malta:".
Noted
Quoted 23 lines
That said,
Quoted 7 lines
hw/mips/mips_malta.c +0
-0@@ -1052,6 +1052,12 @@ void mips_malta_init(MachineState *machine) bootloader_run_addr, kernel_entry); }hw/mips/mips_malta.c void mips_malta_init(MachineState *machine) · line 1063
Quoted 10 lines
hw/mips/mips_malta.c +6
-0}else { +/* The flash region isn't executable from a KVM T&E guest */ +if (kvm_enabled ()) { +error_report ("KVM enabled but no -kernel argument was specified. " +"Booting from flash is not supported with KVM T&E." ); +exit (1 ); + }/* Load firmware from flash. */ if (!dinfo) {/* Load a BIOS image. */ Reviewed-by Andreas Färber <[email protected]>
Quoted 3 lines
Are users expected to know/understand "KVM T&E"? You don't test for that T&E mode here, so you could either shorten the message to just "KVM" or replace the check with a more specific one.
Yeh, not mentioning T&E at all would be better actually. The limitation is technically a MIPS KVM one rather than being T&E specific.
I'll post a v2.
Thanks for reviewing
James
Quoted 6 lines
Since qtest does not use KVM on MIPS today, exiting without -kernel should be fine, but may need updating if we ever get to that.
Regards,
Andreas