From patchwork Sat Jul 26 08:04:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 34339 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f197.google.com (mail-pd0-f197.google.com [209.85.192.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CD31F213FD for ; Sat, 26 Jul 2014 08:05:31 +0000 (UTC) Received: by mail-pd0-f197.google.com with SMTP id y10sf33741111pdj.0 for ; Sat, 26 Jul 2014 01:05:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id :mime-version:cc:subject:precedence:list-id:list-unsubscribe :list-post:list-help:list-subscribe:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list :list-archive:content-type:content-transfer-encoding; bh=ARE/9kGnN3hhjj6Dq7VsaC16JrU+EQfunS3glwAWI2w=; b=YThWzd2fi221fbWE9mQVHjObhTRHg9b6aA7S3VDHlukkxIcQZ9PWoPBeL3QWX7qIR1 G+1QdJFr/l+HrG26mvTGm61wGfUscxigO578uJMP4R2RVDUH7oV+0ZaDOYxzwsz+WR0Y mrMVmkPs+/23429ORgHFi7VrJzC5u0DumojKYa5p+nLZ2EZA+OwAHlzKZNV0no/LgiF2 uXlEARo9+YczuAYl1g5ISj/FylgGPG4XNJrWhq97MrWxl5598XIa4dxZiLEEXyvk247E XljyKlW/iwPsOdQPDvGqlou/qTmDa95qMINNRFtDnO4x8jXvoRJrkWx5zVrZ/IoGetZy CWHA== X-Gm-Message-State: ALoCoQkJoyA1/DhC9Q8dY+fLjLWzipTqpq6HeidplmCIi0Ku+NJ/uMfF0AqfI4I0Q2pvyjE9ziiH X-Received: by 10.66.145.33 with SMTP id sr1mr10157783pab.18.1406361931041; Sat, 26 Jul 2014 01:05:31 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.84.35 with SMTP id k32ls1422414qgd.73.gmail; Sat, 26 Jul 2014 01:05:30 -0700 (PDT) X-Received: by 10.224.172.74 with SMTP id k10mr35456870qaz.43.1406361930868; Sat, 26 Jul 2014 01:05:30 -0700 (PDT) Received: from mail-qa0-f44.google.com (mail-qa0-f44.google.com [209.85.216.44]) by mx.google.com with ESMTPS id h6si20195147qan.116.2014.07.26.01.05.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 26 Jul 2014 01:05:30 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.216.44 as permitted sender) client-ip=209.85.216.44; Received: by mail-qa0-f44.google.com with SMTP id f12so5676454qad.31 for ; Sat, 26 Jul 2014 01:05:30 -0700 (PDT) X-Received: by 10.140.89.197 with SMTP id v63mr34223547qgd.71.1406361930736; Sat, 26 Jul 2014 01:05:30 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.96.16.166 with SMTP id h6csp83495qdd; Sat, 26 Jul 2014 01:05:30 -0700 (PDT) X-Received: by 10.42.166.2 with SMTP id m2mr27509839icy.21.1406361930201; Sat, 26 Jul 2014 01:05:30 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id e5si1989148igy.19.2014.07.26.01.05.29 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 26 Jul 2014 01:05:30 -0700 (PDT) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XAwxy-0001s4-GV; Sat, 26 Jul 2014 08:04:30 +0000 Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XAwxw-0001rz-Q0 for xen-devel@lists.xen.org; Sat, 26 Jul 2014 08:04:28 +0000 Received: from [85.158.143.35:56011] by server-1.bemta-4.messagelabs.com id C6/9A-05872-C0163D35; Sat, 26 Jul 2014 08:04:28 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-2.tower-21.messagelabs.com!1406361865!12268639!1 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n X-StarScan-Received: X-StarScan-Version: 6.11.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 7487 invoked from network); 26 Jul 2014 08:04:27 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-2.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 26 Jul 2014 08:04:27 -0000 X-IronPort-AV: E=Sophos;i="5.01,735,1400025600"; d="scan'208";a="155915844" Received: from accessns.citrite.net (HELO FTLPEX01CL01.citrite.net) ([10.9.154.239]) by FTLPIPO01.CITRIX.COM with ESMTP; 26 Jul 2014 08:04:26 +0000 Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.78) with Microsoft SMTP Server id 14.3.181.6; Sat, 26 Jul 2014 04:04:24 -0400 Received: from drall.uk.xensource.com ([10.80.16.71]) by ukmail1.uk.xensource.com with smtp (Exim 4.69) (envelope-from ) id 1XAwxr-0003It-He; Sat, 26 Jul 2014 09:04:24 +0100 Received: by drall.uk.xensource.com (sSMTP sendmail emulation); Sat, 26 Jul 2014 09:04:23 +0100 From: Ian Campbell To: Date: Sat, 26 Jul 2014 09:04:23 +0100 Message-ID: X-Mailer: git-send-email 1.7.10.4 MIME-Version: 1.0 X-DLP: MIA1 Cc: julien.grall@linaro.org, tim@xen.org, Ian Campbell , stefano.stabellini@eu.citrix.com Subject: [Xen-devel] [PATCH] xen: arm: Select ramdisk bootmodule early enough when building dom0 X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ian.campbell@citrix.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.216.44 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: I thought in 0040b649d6df "xen: arm: Only lookup kernel/initrd bootmodule once while building dom0" that I had identified place_modules as being soon enough, but I was wrong, since write_properties wants to use it sooner. Select the initrd boot module in kernel_probe at the same time we select the kernel to avoid all this. Signed-off-by: Ian Campbell Acked-by: Julien Grall --- xen/arch/arm/kernel.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/xen/arch/arm/kernel.c b/xen/arch/arm/kernel.c index 6912abd..31a9a85 100644 --- a/xen/arch/arm/kernel.c +++ b/xen/arch/arm/kernel.c @@ -68,7 +68,7 @@ static void place_modules(struct kernel_info *info, paddr_t kernbase, paddr_t kernend) { /* Align DTB and initrd size to 2Mb. Linux only requires 4 byte alignment */ - const struct bootmodule *mod = boot_module_find_by_kind(BOOTMOD_RAMDISK); + const struct bootmodule *mod = info->initrd_bootmodule; const paddr_t initrd_len = ROUNDUP(mod ? mod->size : 0, MB(2)); const paddr_t dtb_len = ROUNDUP(fdt_totalsize(info->fdt), MB(2)); const paddr_t modsize = initrd_len + dtb_len; @@ -116,7 +116,6 @@ static void place_modules(struct kernel_info *info, info->dtb_paddr = modbase; info->initrd_paddr = info->dtb_paddr + dtb_len; - info->initrd_bootmodule = mod; } static paddr_t kernel_zimage_place(struct kernel_info *info) @@ -390,6 +389,11 @@ int kernel_probe(struct kernel_info *info) printk("Loading kernel from boot module @ %"PRIpaddr"\n", start); + info->initrd_bootmodule = boot_module_find_by_kind(BOOTMOD_RAMDISK); + if ( info->initrd_bootmodule ) + printk("Loading ramdisk from boot module @ %"PRIpaddr"\n", + info->initrd_bootmodule->start); + #ifdef CONFIG_ARM_64 rc = kernel_image64_probe(info, start, size); if (rc < 0)