From patchwork Fri Jun 20 12:11:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 362230 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 2776E140084 for ; Fri, 20 Jun 2014 22:21:02 +1000 (EST) Received: from localhost ([::1]:40577 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxxoS-0005fR-8A for incoming@patchwork.ozlabs.org; Fri, 20 Jun 2014 08:21:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40386) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wxxfm-0000Ap-31 for qemu-devel@nongnu.org; Fri, 20 Jun 2014 08:12:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wxxfh-0002Iy-3d for qemu-devel@nongnu.org; Fri, 20 Jun 2014 08:12:02 -0400 Received: from mail-wi0-x230.google.com ([2a00:1450:400c:c05::230]:55539) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wxxfg-0002Ik-Su for qemu-devel@nongnu.org; Fri, 20 Jun 2014 08:11:57 -0400 Received: by mail-wi0-f176.google.com with SMTP id n3so684747wiv.9 for ; Fri, 20 Jun 2014 05:11:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=9h0c42q9VZk/1sPk3GJD2r8AQo6Nhvdb2Mv3aDxOEZE=; b=vvYjb+BEoZx7Clb7YNwi7LiW6LgzLzpvrt0gXTh9FbrSDP3RZs1ySJ6bUXe4jodcCc ib57SSQdFyUHk4i9K0MzzTOS4RHeIU9gBp0mpk+p5YrSLOQ0nhYwDxXQ0Y+jyldbbzX7 nrwcRYEdUT4L2XEjTUzYKLOlIe1JRaJ6Kb29Q4K8eP1uySPiCnJ7PKn/7XC0kXUOBXS2 MUxbkMuKww6ykdfAgYEb5xmqyiPhaLCzmwPX6p8rZbzEpAhrYWLJURr3NjpS1Xpvwven HAZyLhEoLs0w0SzJTF7S2xpWT414J+eyDfa8irBL+yQxJVf6uOp4vRLuU8G5ZLcQBVUP 1QvA== X-Received: by 10.194.222.197 with SMTP id qo5mr4074115wjc.78.1403266316157; Fri, 20 Jun 2014 05:11:56 -0700 (PDT) Received: from playground.station (net-37-117-140-88.cust.vodafonedsl.it. [37.117.140.88]) by mx.google.com with ESMTPSA id dj2sm4222458wib.11.2014.06.20.05.11.54 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Jun 2014 05:11:55 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 20 Jun 2014 14:11:23 +0200 Message-Id: <1403266283-1517-15-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1403266283-1517-1-git-send-email-pbonzini@redhat.com> References: <1403266283-1517-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::230 Cc: James Hogan Subject: [Qemu-devel] [PULL 14/14] hw/mips: malta: Don't boot from flash with KVM T&E 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 From: 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 Signed-off-by: Paolo Bonzini --- hw/mips/mips_malta.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index 8bc5392..91b0ce5 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 specified. " + "Booting from flash is not supported with KVM T&E."); + exit(1); + } /* Load firmware from flash. */ if (!dinfo) { /* Load a BIOS image. */