From patchwork Mon Jul 21 12:09:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 33951 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 40D2320492 for ; Mon, 21 Jul 2014 12:11:37 +0000 (UTC) Received: by mail-lb0-f200.google.com with SMTP id v6sf4724176lbi.7 for ; Mon, 21 Jul 2014 05:11:34 -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=GPC1sDCoaCgr91oFL79AP1XGPy4Nxz7FxkdLwDXvT6c=; b=P4UF0h5YstBrfXOyA2awylVvNZtnYsNiOyDj4D7KVmsbAYwnzrSh7DslF9DQFbuOGr il35LN2bDys+oo0b64Xb+LMpjM9Kq/y1pCcccjX2YqOxr1tK+i6rGvVLO3ApdNdgJWnU 6rqgwbVLGu/+5HwXU3wWnKtHLJ6b35rMaj6T8XiGVEjBZ5+aZ29lo96/HoeiT2Y9QpJn uDFMDv4ScN+VToxmYP53a24FCuhlLCX2xDjUjYNcJhngBsYM8fmG7KzhO08cyqhittX6 NkGtIPre2M+YluvKc3DA1MalqXMm2rpP64uXq7noefCBPqTyMMb6VFr8ErFCclXlB89d l74g== X-Gm-Message-State: ALoCoQmFTPWlTg1IStjKTT0om5ygq0RlvPRQeKOE9RuekQduwJNCpwXSv0OLeS9A3MLDBPdgHrBK X-Received: by 10.112.199.137 with SMTP id jk9mr1920331lbc.7.1405944694360; Mon, 21 Jul 2014 05:11:34 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.98.11 with SMTP id n11ls1880577qge.11.gmail; Mon, 21 Jul 2014 05:11:34 -0700 (PDT) X-Received: by 10.220.160.67 with SMTP id m3mr9150623vcx.56.1405944694143; Mon, 21 Jul 2014 05:11:34 -0700 (PDT) Received: from mail-vc0-f180.google.com (mail-vc0-f180.google.com [209.85.220.180]) by mx.google.com with ESMTPS id v10si11156458vdo.17.2014.07.21.05.11.34 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 21 Jul 2014 05:11:34 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.180 as permitted sender) client-ip=209.85.220.180; Received: by mail-vc0-f180.google.com with SMTP id ij19so11961674vcb.39 for ; Mon, 21 Jul 2014 05:11:34 -0700 (PDT) X-Received: by 10.220.15.8 with SMTP id i8mr16384291vca.45.1405944694042; Mon, 21 Jul 2014 05:11:34 -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.221.37.5 with SMTP id tc5csp106723vcb; Mon, 21 Jul 2014 05:11:33 -0700 (PDT) X-Received: by 10.51.17.66 with SMTP id gc2mr4603409igd.12.1405944693534; Mon, 21 Jul 2014 05:11:33 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id hw7si13173770igb.9.2014.07.21.05.11.32 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 21 Jul 2014 05:11:33 -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 1X9CPD-0006Do-1l; Mon, 21 Jul 2014 12:09:23 +0000 Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1X9CPB-0006Dc-Mw for xen-devel@lists.xen.org; Mon, 21 Jul 2014 12:09:21 +0000 Received: from [85.158.143.35:64136] by server-2.bemta-4.messagelabs.com id F5/5F-26128-1F20DC35; Mon, 21 Jul 2014 12:09:21 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-13.tower-21.messagelabs.com!1405944559!11723363!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 11918 invoked from network); 21 Jul 2014 12:09:20 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-13.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 21 Jul 2014 12:09:20 -0000 X-IronPort-AV: E=Sophos;i="5.01,700,1400025600"; d="scan'208";a="154182849" Received: from accessns.citrite.net (HELO FTLPEX01CL03.citrite.net) ([10.9.154.239]) by FTLPIPO01.CITRIX.COM with ESMTP; 21 Jul 2014 12:09:18 +0000 Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.80) with Microsoft SMTP Server id 14.3.181.6; Mon, 21 Jul 2014 08:09:18 -0400 Received: from marilith-n13-p0.uk.xensource.com ([10.80.229.115] helo=localhost.localdomain) by ukmail1.uk.xensource.com with smtp (Exim 4.69) (envelope-from ) id 1X9CP6-0003Rt-Nf; Mon, 21 Jul 2014 13:09:18 +0100 Received: by localhost.localdomain (sSMTP sendmail emulation); Mon, 21 Jul 2014 13:09:16 +0100 From: Ian Campbell To: Date: Mon, 21 Jul 2014 13:09:16 +0100 Message-ID: <1405944556-8372-1-git-send-email-ian.campbell@citrix.com> 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 v4] xen: arm: Only lookup kernel/initrd bootmodule once while 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.220.180 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: Signed-off-by: Ian Campbell Acked-by: Julien Grall --- v4: Call the new field kernel_bootmodule for clarity Use the new field throughout kernel.c as well as in domain_build.c Add and use initrd_bootmodule too. Const up the uses v3: New patch --- xen/arch/arm/domain_build.c | 6 +++--- xen/arch/arm/kernel.c | 2 ++ xen/arch/arm/kernel.h | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index 154367e..23261e4 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -405,7 +405,7 @@ static int write_properties(struct domain *d, struct kernel_info *kinfo, int res = 0; int had_dom0_bootargs = 0; - struct bootmodule *mod = boot_module_find_by_kind(BOOTMOD_KERNEL); + const struct bootmodule *mod = kinfo->kernel_bootmodule; if ( mod && mod->cmdline[0] ) bootargs = &mod->cmdline[0]; @@ -455,7 +455,7 @@ static int write_properties(struct domain *d, struct kernel_info *kinfo, if ( dt_node_path_is_equal(node, "/chosen") ) { - struct bootmodule *mod = boot_module_find_by_kind(BOOTMOD_RAMDISK); + const struct bootmodule *mod = kinfo->initrd_bootmodule; if ( bootargs ) { @@ -1224,7 +1224,7 @@ static void dtb_load(struct kernel_info *kinfo) static void initrd_load(struct kernel_info *kinfo) { - struct bootmodule *mod = boot_module_find_by_kind(BOOTMOD_RAMDISK); + const struct bootmodule *mod = kinfo->initrd_bootmodule; paddr_t load_addr = kinfo->initrd_paddr; paddr_t paddr, len; unsigned long offs; diff --git a/xen/arch/arm/kernel.c b/xen/arch/arm/kernel.c index 230ff8f..eaeadb5 100644 --- a/xen/arch/arm/kernel.c +++ b/xen/arch/arm/kernel.c @@ -116,6 +116,7 @@ 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) @@ -383,6 +384,7 @@ int kernel_probe(struct kernel_info *info) return -ENOENT; } + info->kernel_bootmodule = mod; start = mod->start; size = mod->size; diff --git a/xen/arch/arm/kernel.h b/xen/arch/arm/kernel.h index 7c7f624..0050dfb 100644 --- a/xen/arch/arm/kernel.h +++ b/xen/arch/arm/kernel.h @@ -23,6 +23,7 @@ struct kernel_info { paddr_t entry; /* boot blob load addresses */ + const struct bootmodule *kernel_bootmodule, *initrd_bootmodule; paddr_t dtb_paddr; paddr_t initrd_paddr;