From patchwork Fri Jan 16 16:20:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 43256 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 A4685240BA for ; Fri, 16 Jan 2015 16:23:19 +0000 (UTC) Received: by mail-lb0-f200.google.com with SMTP id u14sf11680452lbd.3 for ; Fri, 16 Jan 2015 08:23:18 -0800 (PST) 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:in-reply-to :references:cc:subject:precedence:list-id:list-unsubscribe:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:list-archive; bh=+nQnKd09yR0Zmf6Upn5EKyy/YRt97ZV2mrHStpKYz1w=; b=QlQpc7kYAWFQm2e+QGBDS2SBxt4FLhMvjPr6xylKlcWBhhFwEq6qwrxt/J5yB3vJce K7X8A4Bpq3EqV1TMdx6HTS3t00vmtnuJEEaMsV4W20RNG/djVW2r+9vMJ/xXg78gRGcy k7oAqoqomALQWL35zt9HPjqPdqijH33O0jBXfNwav2Ln4Fl2C2PBWhD+244kNwIPqFFJ 26OKovveynMn0Fyb+HARrW7epJYH8Tty0T3bhxSm50E+Cm+B5EEDQz2hvk9HLmTaddYn e2j80JEepwbtMiWfW+vdsa8xK2QgOIYQaQXS6qE1Ru0T/T6eW0V1kJTGKhV3JC+Zkn12 lOFA== X-Gm-Message-State: ALoCoQl5SRsFNfnUrPcEiEnZkbY4ZOp/yayJheA3pDv5JFW0QH4TBG6uGDKq29NoQHyFbswObpNE X-Received: by 10.152.3.234 with SMTP id f10mr416321laf.1.1421425398657; Fri, 16 Jan 2015 08:23:18 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.88.70 with SMTP id be6ls382595lab.42.gmail; Fri, 16 Jan 2015 08:23:18 -0800 (PST) X-Received: by 10.152.25.194 with SMTP id e2mr16653733lag.22.1421425398348; Fri, 16 Jan 2015 08:23:18 -0800 (PST) Received: from mail-la0-f51.google.com (mail-la0-f51.google.com. [209.85.215.51]) by mx.google.com with ESMTPS id bf5si4821924lab.62.2015.01.16.08.23.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 16 Jan 2015 08:23:18 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) client-ip=209.85.215.51; Received: by mail-la0-f51.google.com with SMTP id ms9so19764946lab.10 for ; Fri, 16 Jan 2015 08:23:18 -0800 (PST) X-Received: by 10.152.115.146 with SMTP id jo18mr16826582lab.9.1421425398246; Fri, 16 Jan 2015 08:23:18 -0800 (PST) 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.112.9.200 with SMTP id c8csp361549lbb; Fri, 16 Jan 2015 08:23:17 -0800 (PST) X-Received: by 10.224.0.132 with SMTP id 4mr25831811qab.103.1421425390784; Fri, 16 Jan 2015 08:23:10 -0800 (PST) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id w96si4274494qge.112.2015.01.16.08.23.10 (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 16 Jan 2015 08:23:10 -0800 (PST) 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 1YC9eF-00064q-Q4; Fri, 16 Jan 2015 16:21:23 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YC9eE-00063M-Aj for xen-devel@lists.xenproject.org; Fri, 16 Jan 2015 16:21:22 +0000 Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id 90/F2-14727-18A39B45; Fri, 16 Jan 2015 16:21:21 +0000 X-Env-Sender: julien.grall@linaro.org X-Msg-Ref: server-8.tower-206.messagelabs.com!1421425280!14566838!1 X-Originating-IP: [74.125.82.52] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 6.12.5; banners=-,-,- X-VirusChecked: Checked Received: (qmail 12041 invoked from network); 16 Jan 2015 16:21:20 -0000 Received: from mail-wg0-f52.google.com (HELO mail-wg0-f52.google.com) (74.125.82.52) by server-8.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 16 Jan 2015 16:21:20 -0000 Received: by mail-wg0-f52.google.com with SMTP id x12so21338054wgg.11 for ; Fri, 16 Jan 2015 08:21:20 -0800 (PST) X-Received: by 10.180.107.70 with SMTP id ha6mr7602508wib.71.1421425280440; Fri, 16 Jan 2015 08:21:20 -0800 (PST) Received: from chilopoda.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id dc1sm3562564wib.18.2015.01.16.08.21.18 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 16 Jan 2015 08:21:19 -0800 (PST) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Fri, 16 Jan 2015 16:20:44 +0000 Message-Id: <1421425248-8727-3-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1421425248-8727-1-git-send-email-julien.grall@linaro.org> References: <1421425248-8727-1-git-send-email-julien.grall@linaro.org> Cc: stefano.stabellini@citrix.com, Julien Grall , tim@xen.org, ian.campbell@citrix.com Subject: [Xen-devel] [PATCH 2/6] xen/arm: domain_build: Move all DOM0 building code in init section 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: , MIME-Version: 1.0 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: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 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: The code to build DOM0 is only used during Xen boot. Signed-off-by: Julien Grall --- xen/arch/arm/domain_build.c | 66 ++++++++++++++++++++++----------------------- xen/include/asm-arm/setup.h | 2 +- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index c2dcb49..d30df08 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -76,7 +76,7 @@ struct vcpu *__init alloc_dom0_vcpu0(struct domain *dom0) return alloc_vcpu(dom0, 0, 0); } -static unsigned int get_11_allocation_size(paddr_t size) +static unsigned int __init get_11_allocation_size(paddr_t size) { /* * get_order_from_bytes returns the order greater than or equal to @@ -94,10 +94,10 @@ static unsigned int get_11_allocation_size(paddr_t size) * Returns false if the memory would be below bank 0 or we have run * out of banks. In this case it will free the pages. */ -static bool_t insert_11_bank(struct domain *d, - struct kernel_info *kinfo, - struct page_info *pg, - unsigned int order) +static bool_t __init insert_11_bank(struct domain *d, + struct kernel_info *kinfo, + struct page_info *pg, + unsigned int order) { int res, i; paddr_t spfn; @@ -240,7 +240,8 @@ fail: * (as described above) we allow higher allocations and continue until * that runs out (or we have allocated sufficient dom0 memory). */ -static void allocate_memory_11(struct domain *d, struct kernel_info *kinfo) +static void __init allocate_memory_11(struct domain *d, + struct kernel_info *kinfo) { const unsigned int min_low_order = get_order_from_bytes(min_t(paddr_t, dom0_mem, MB(128))); @@ -348,7 +349,7 @@ static void allocate_memory_11(struct domain *d, struct kernel_info *kinfo) } } -static void allocate_memory(struct domain *d, struct kernel_info *kinfo) +static void __init allocate_memory(struct domain *d, struct kernel_info *kinfo) { struct dt_device_node *memory = NULL; @@ -398,8 +399,8 @@ static void allocate_memory(struct domain *d, struct kernel_info *kinfo) } } -static int write_properties(struct domain *d, struct kernel_info *kinfo, - const struct dt_device_node *node) +static int __init write_properties(struct domain *d, struct kernel_info *kinfo, + const struct dt_device_node *node) { const char *bootargs = NULL; const struct dt_property *prop; @@ -504,8 +505,8 @@ static int write_properties(struct domain *d, struct kernel_info *kinfo, typedef __be32 gic_interrupt_t[3]; -static void set_interrupt_ppi(gic_interrupt_t interrupt, unsigned int irq, - unsigned int cpumask, unsigned int level) +static void __init set_interrupt_ppi(gic_interrupt_t interrupt, unsigned int irq, + unsigned int cpumask, unsigned int level) { __be32 *cells = interrupt; @@ -523,8 +524,8 @@ static void set_interrupt_ppi(gic_interrupt_t interrupt, unsigned int irq, * "interrupts": contains the list of interrupts * "interrupt-parent": link to the GIC */ -static int fdt_property_interrupts(void *fdt, gic_interrupt_t *intr, - unsigned num_irq) +static int __init fdt_property_interrupts(void *fdt, gic_interrupt_t *intr, + unsigned num_irq) { int res; @@ -538,10 +539,9 @@ static int fdt_property_interrupts(void *fdt, gic_interrupt_t *intr, return res; } -static int make_memory_node(const struct domain *d, - void *fdt, - const struct dt_device_node *parent, - const struct kernel_info *kinfo) +static int __init make_memory_node(const struct domain *d, void *fdt, + const struct dt_device_node *parent, + const struct kernel_info *kinfo) { int res, i; int reg_size = dt_n_addr_cells(parent) + dt_n_size_cells(parent); @@ -581,8 +581,8 @@ static int make_memory_node(const struct domain *d, return res; } -static int make_hypervisor_node(struct domain *d, - void *fdt, const struct dt_device_node *parent) +static int __init make_hypervisor_node(struct domain *d, void *fdt, + const struct dt_device_node *parent) { const char compat[] = "xen,xen-"__stringify(XEN_VERSION)"."__stringify(XEN_SUBVERSION)"\0" @@ -646,7 +646,7 @@ static int make_hypervisor_node(struct domain *d, return res; } -static int make_psci_node(void *fdt, const struct dt_device_node *parent) +static int __init make_psci_node(void *fdt, const struct dt_device_node *parent) { int res; const char compat[] = @@ -681,8 +681,8 @@ static int make_psci_node(void *fdt, const struct dt_device_node *parent) return res; } -static int make_cpus_node(const struct domain *d, void *fdt, - const struct dt_device_node *parent) +static int __init make_cpus_node(const struct domain *d, void *fdt, + const struct dt_device_node *parent) { int res; const struct dt_device_node *cpus = dt_find_node_by_path("/cpus"); @@ -785,8 +785,8 @@ static int make_cpus_node(const struct domain *d, void *fdt, return res; } -static int make_gic_node(const struct domain *d, void *fdt, - const struct dt_device_node *node) +static int __init make_gic_node(const struct domain *d, void *fdt, + const struct dt_device_node *node) { const struct dt_device_node *gic = dt_interrupt_controller; int res = 0; @@ -834,8 +834,8 @@ static int make_gic_node(const struct domain *d, void *fdt, return res; } -static int make_timer_node(const struct domain *d, void *fdt, - const struct dt_device_node *node) +static int __init make_timer_node(const struct domain *d, void *fdt, + const struct dt_device_node *node) { static const struct dt_device_match timer_ids[] __initconst = { @@ -910,7 +910,7 @@ static int make_timer_node(const struct domain *d, void *fdt, } /* Map the device in the domain */ -static int map_device(struct domain *d, struct dt_device_node *dev) +static int __init map_device(struct domain *d, struct dt_device_node *dev) { unsigned int nirq; unsigned int naddr; @@ -1020,8 +1020,8 @@ static int map_device(struct domain *d, struct dt_device_node *dev) return 0; } -static int handle_node(struct domain *d, struct kernel_info *kinfo, - struct dt_device_node *node) +static int __init handle_node(struct domain *d, struct kernel_info *kinfo, + struct dt_device_node *node) { static const struct dt_device_match skip_matches[] __initconst = { @@ -1155,7 +1155,7 @@ static int handle_node(struct domain *d, struct kernel_info *kinfo, return res; } -static int prepare_dtb(struct domain *d, struct kernel_info *kinfo) +static int __init prepare_dtb(struct domain *d, struct kernel_info *kinfo) { const void *fdt; int new_size; @@ -1192,7 +1192,7 @@ static int prepare_dtb(struct domain *d, struct kernel_info *kinfo) return -EINVAL; } -static void dtb_load(struct kernel_info *kinfo) +static void __init dtb_load(struct kernel_info *kinfo) { void * __user dtb_virt = (void * __user)(register_t)kinfo->dtb_paddr; unsigned long left; @@ -1207,7 +1207,7 @@ static void dtb_load(struct kernel_info *kinfo) xfree(kinfo->fdt); } -static void initrd_load(struct kernel_info *kinfo) +static void __init initrd_load(struct kernel_info *kinfo) { const struct bootmodule *mod = kinfo->initrd_bootmodule; paddr_t load_addr = kinfo->initrd_paddr; @@ -1271,7 +1271,7 @@ static void initrd_load(struct kernel_info *kinfo) } } -int construct_dom0(struct domain *d) +int __init construct_dom0(struct domain *d) { struct kernel_info kinfo = {}; struct vcpu *saved_current; diff --git a/xen/include/asm-arm/setup.h b/xen/include/asm-arm/setup.h index ed2ba16..113655d 100644 --- a/xen/include/asm-arm/setup.h +++ b/xen/include/asm-arm/setup.h @@ -53,7 +53,7 @@ void copy_from_paddr(void *dst, paddr_t paddr, unsigned long len); void arch_get_xen_caps(xen_capabilities_info_t *info); -int construct_dom0(struct domain *d); +int __init construct_dom0(struct domain *d); void discard_initial_modules(void);