From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60006) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxyyT-0005FW-Km for qemu-devel@nongnu.org; Fri, 20 Jun 2014 09:35:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WxyyO-0007pA-91 for qemu-devel@nongnu.org; Fri, 20 Jun 2014 09:35:25 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:56657) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxyyO-0007p6-2v for qemu-devel@nongnu.org; Fri, 20 Jun 2014 09:35:20 -0400 Message-ID: <53A43895.2080909@imgtec.com> Date: Fri, 20 Jun 2014 14:35:17 +0100 From: James Hogan MIME-Version: 1.0 References: <1403264879-13247-1-git-send-email-james.hogan@imgtec.com> <53A43476.7060901@suse.de> In-Reply-To: <53A43476.7060901@suse.de> Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] hw/mips: malta: Don't boot from flash with KVM T&E List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?ISO-8859-15?Q?Andreas_F=E4rber?= , qemu-devel@nongnu.org Cc: Paolo Bonzini , Aurelien Jarno On 20/06/14 14:17, Andreas F=E4rber wrote: > Hi, >=20 > Am 20.06.2014 13:47, schrieb James Hogan: >> 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. >> >> Reported-by: Aurelien Jarno >> Signed-off-by: James Hogan >> Cc: Paolo Bonzini >> --- >> hw/mips/mips_malta.c | 6 ++++++ >> 1 file changed, 6 insertions(+) >=20 > Previous commits have used just "mips_malta:", so suggest to do the sam= e > for consistency - or clean hw/mips/ dir up by renaming the file to just > malta.c and use "mips/malta:". >=20 > http://git.qemu-project.org/?p=3Dqemu.git;a=3Dhistory;f=3Dhw/mips/mips_= malta.c;h=3Df4a7d47129526f6762eccc47251c8cf3cd27f928;hb=3DHEAD Noted >=20 > That said, >=20 >> diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c >> index 8bc5392b4223..91b0ce566111 100644 >> --- a/hw/mips/mips_malta.c >> +++ b/hw/mips/mips_malta.c >> @@ -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 spe= cified. " >> + "Booting from flash is not supported with KV= M T&E."); >> + exit(1); >> + } >> /* Load firmware from flash. */ >> if (!dinfo) { >> /* Load a BIOS image. */ >=20 > Reviewed-by: Andreas F=E4rber >=20 > Are users expected to know/understand "KVM T&E"? You don't test for tha= t > 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 > 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. >=20 > Regards, > Andreas >=20