From patchwork Fri Jun 20 13:48:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: James Hogan X-Patchwork-Id: 362255 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45ABE140084 for ; Fri, 20 Jun 2014 23:49:23 +1000 (EST) Received: from localhost ([::1]:41052 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxzBx-0007Uk-Iu for incoming@patchwork.ozlabs.org; Fri, 20 Jun 2014 09:49:21 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36025) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxzBZ-0006xM-F3 for qemu-devel@nongnu.org; Fri, 20 Jun 2014 09:49:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WxzBU-0004dt-Gq for qemu-devel@nongnu.org; Fri, 20 Jun 2014 09:48:57 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:47015) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxzBU-0004dM-Be for qemu-devel@nongnu.org; Fri, 20 Jun 2014 09:48:52 -0400 Received: from KLMAIL01.kl.imgtec.org (unknown [192.168.5.35]) by Websense Email Security Gateway with ESMTPS id 7B64EACBE81D6; Fri, 20 Jun 2014 14:48:46 +0100 (IST) Received: from KLMAIL02.kl.imgtec.org (192.168.5.97) by KLMAIL01.kl.imgtec.org (192.168.5.35) with Microsoft SMTP Server (TLS) id 14.3.181.6; Fri, 20 Jun 2014 14:48:48 +0100 Received: from LEMAIL01.le.imgtec.org (192.168.152.62) by klmail02.kl.imgtec.org (192.168.5.97) with Microsoft SMTP Server (TLS) id 14.3.181.6; Fri, 20 Jun 2014 14:48:49 +0100 Received: from jhogan-linux.le.imgtec.org (192.168.154.101) by LEMAIL01.le.imgtec.org (192.168.152.62) with Microsoft SMTP Server (TLS) id 14.3.174.1; Fri, 20 Jun 2014 14:48:48 +0100 From: James Hogan To: Date: Fri, 20 Jun 2014 14:48:35 +0100 Message-ID: <1403272115-10921-1-git-send-email-james.hogan@imgtec.com> X-Mailer: git-send-email 1.9.3 MIME-Version: 1.0 X-Originating-IP: [192.168.154.101] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 195.59.15.196 Cc: Paolo Bonzini , James Hogan , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Aurelien Jarno Subject: [Qemu-devel] [PATCH v2] mips_malta: Don't boot from flash with KVM X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org In KVM 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 Reviewed-by: Andreas Färber Cc: Paolo Bonzini --- Changes in v2: - Remove mention of T&E. There is currently no distinction since VZ isn't supported, and technically the limitation isn't T&E specific. (Andreas Färber) --- hw/mips/mips_malta.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index 8bc5392b4223..a54ed65a6b73 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 guest */ + if (kvm_enabled()) { + error_report("KVM enabled but no -kernel argument was specified. " + "Booting from flash is not supported with KVM."); + exit(1); + } /* Load firmware from flash. */ if (!dinfo) { /* Load a BIOS image. */