From patchwork Fri Mar 18 09:13:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baptiste Reynal X-Patchwork-Id: 8617491 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B76C5C0553 for ; Fri, 18 Mar 2016 09:22:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 13F0920166 for ; Fri, 18 Mar 2016 09:22:39 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 61F2720122 for ; Fri, 18 Mar 2016 09:22:38 +0000 (UTC) Received: from localhost ([::1]:42444 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agqc9-0000Sf-P8 for patchwork-qemu-devel@patchwork.kernel.org; Fri, 18 Mar 2016 05:22:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42441) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agqUI-0004Dz-PM for qemu-devel@nongnu.org; Fri, 18 Mar 2016 05:14:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1agqUF-00041J-98 for qemu-devel@nongnu.org; Fri, 18 Mar 2016 05:14:30 -0400 Received: from mail-wm0-x231.google.com ([2a00:1450:400c:c09::231]:33638) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agqUF-00041C-2R for qemu-devel@nongnu.org; Fri, 18 Mar 2016 05:14:27 -0400 Received: by mail-wm0-x231.google.com with SMTP id l68so59425868wml.0 for ; Fri, 18 Mar 2016 02:14:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtualopensystems-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=oAYD4QNNynM+2CmxhbJsppQK7dkYI9Y+1DtHq49h2wQ=; b=1LjatKp5vk8PQXw149Tmq/lUgRN9wi+qJaiCbD61Ls9fw/QiysArRqdICJ1p78pdFg EhETLn/08NBNoWPCxcORuziYTU+ugNpWzm3SskEy8yMQaSkYGEU5OI67pQ0rhKm5MRWF vUCMj5Gyx5G3EhYiFx1HNqvAYTOXwu/hQ4Czh0zvzJFA9itaGhkV+RoTjvCU1kdEJrBN /78zlJFiZs5uMuw4U0fBvj/Syim5TYBvuacCDJVXgJbE3lP7dQD9xDFZVl2hl/5REmqR d9v0EvsVMt65PysG2ntwU3psUzhbm0Iw+1D0nLHTvjKJTsZ3lFXkzNvclLaHCx9JF2JL jJBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=oAYD4QNNynM+2CmxhbJsppQK7dkYI9Y+1DtHq49h2wQ=; b=J2WkbEBP9M/PFGhDkRrDWdpDv2gjhgxZFElDS8uz6UnB1OJyk7FxThmxXBokWK5gjO i9yZon25DUMraTIlL/e0JFQ4lQ2Vc+aUhHar8JjuQSQlkIEuNxnzP2GUJvlRAIH6gc6/ f2FfIlMa6EFwiBsIMZwBGyYjNqystGxjD5j7KeeIP/NwAqW9UNJkZgiisg+SILCNNW3M lIUbHkpQ38V+kRddJXnNQaaf8sSeAGZiJ6yjkC4fyVI1H9fI0MWqcSwiQvBZOJUFvBAM Z7l0LsHo2EyYaFkT/Ku9ewkZnhKn5fEpujVrxYHJh5SDPsObcd6nPyLrukc9qEPR1GXh eGxA== X-Gm-Message-State: AD7BkJJUMcuWckaNaA8yGFjFrKtpqamFFP+5QoEBLtvaGpvCR0jJ0sg6v7KaLvTKduDApw== X-Received: by 10.28.183.84 with SMTP id h81mr42481012wmf.100.1458292466468; Fri, 18 Mar 2016 02:14:26 -0700 (PDT) Received: from localhost (LMontsouris-657-1-4-224.w90-63.abo.wanadoo.fr. [90.63.239.224]) by smtp.gmail.com with ESMTPSA id v2sm11805412wmd.24.2016.03.18.02.14.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Mar 2016 02:14:25 -0700 (PDT) From: Baptiste Reynal To: qemu-devel@nongnu.org Date: Fri, 18 Mar 2016 10:13:57 +0100 Message-Id: <1458292438-13909-6-git-send-email-b.reynal@virtualopensystems.com> X-Mailer: git-send-email 2.7.3 In-Reply-To: <1458292438-13909-1-git-send-email-b.reynal@virtualopensystems.com> References: <1458292438-13909-1-git-send-email-b.reynal@virtualopensystems.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::231 Cc: b.reynal@virtualopensystems.com, Jani.Kokkonen@huawei.com, tech@virtualopensystems.com, Claudio.Fontana@huawei.com, Christian Pinto Subject: [Qemu-devel] [RFC v2 5/6] hw/arm: boot 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Christian Pinto This patch modifies the boot process of an ARM machine in otrder to check whether if it is a slave, by checking the slave machine flag. When the slave flag is on, no kernel, dtb or initrd are loaded into memory. The boot address of each core is set to the start address of the RAM, that depends on the machine model executed. Signed-off-by: Christian Pinto --- hw/arm/boot.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/hw/arm/boot.c b/hw/arm/boot.c index bef451b..ee0c4a1 100644 --- a/hw/arm/boot.c +++ b/hw/arm/boot.c @@ -590,6 +590,19 @@ static void arm_load_kernel_notify(Notifier *notifier, void *data) /* Load the kernel. */ if (!info->kernel_filename || info->firmware_loaded) { + if (!info->kernel_filename && machine_slave(current_machine)) { + /* If a machine is booted as a slave instance there is no need to + * provide the DTB blob or kernel image, that will instead + * be copied into memory later by a master instance. + * The boot address is set to be at the beginning of the RAM. + */ + info->entry = info->loader_start; + CPU_FOREACH(cs) { + ARM_CPU(cs)->env.boot_info = info; + } + return; + } + if (have_dtb(info)) { /* If we have a device tree blob, but no kernel to supply it to (or * the kernel is supposed to be loaded by the bootloader), copy the