From patchwork Mon Jul 2 16:19:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 140829 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp139955ljj; Mon, 2 Jul 2018 09:21:37 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe4FA4uLDm0Ji8XmjN9YtZNdNjSlcZJAAMs4JS2GxUXTUBa9Ph6/dLGgYV104QE0PCWvIqa X-Received: by 2002:a24:154c:: with SMTP id 73-v6mr10913349itq.51.1530548497677; Mon, 02 Jul 2018 09:21:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530548497; cv=none; d=google.com; s=arc-20160816; b=W88rVGdvCNkgeeISYvLHIopAtZEktxk39fR8Rry8XXawHcYH2TJYcpccehcDSgFgx7 +bL7OjYqCiNgsTpG23gAmk4CxmY/lYFEiVRtxItkNgoTW34ScxczcoBW3GsMAKh/4Io0 DDbmbt44O8i/0X/v3wfacgJwxzCLWHufnABq2jlN0PAY5FSGiz3SFMm/ID4puBVIJKyj fsahXDGg7W3kqdw1A2nac6jpipideaO08jrUHZQDUStiJMPfuAX7lIlS/ykvEvfNWF1R cz4P5/S1sdODnhgdggqEU/ubE0SuloqnuxLT46Png7mMVnlc9JabVfhqCs+PYiCoBFFf KrwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:references:in-reply-to:message-id:date:to:from :arc-authentication-results; bh=BGJlYyorXJL6sCtrIJxAL9EDVQAN/ad5OD2cWZg/n+s=; b=YZpkCXDvJpDAkANLgoont1S9nmnKepSKfxI7KS32bj+O4+lIO+jUfi53Vp+cTF8qbX eQHgI2JXcYbfKG5hY5ajrmmCpGBQxHj8GhrAa95FER8oC5eUjadFjVvAEzNJnm/iANYn LlZmmKIauGZff1JRTRhC2AsPAzHunUshAMS/OKsuaALL1Z4U9v0cKK67huc51/rueZYU 9humbsxAZQdsl2zdKJ4hJlBMxdz4eu9fO0mDlAcUmoA+arf54e361+gLWScJewwu5hME WMOnuac/0jCV50U6SQ5AFUBvOITQcMwwiZGcgUCqUtr4boWZv4Ttks5rR6MWj1UdS1+J EIWw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id l16-v6si5123412ita.108.2018.07.02.09.21.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 02 Jul 2018 09:21:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1fa1Xu-0006o3-5x; Mon, 02 Jul 2018 16:19:22 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1fa1Xs-0006nT-S4 for xen-devel@lists.xen.org; Mon, 02 Jul 2018 16:19:20 +0000 X-Inumbo-ID: a85e9c68-7e13-11e8-8089-bc764e045a96 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTP id a85e9c68-7e13-11e8-8089-bc764e045a96; Mon, 02 Jul 2018 18:19:13 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 978E41529; Mon, 2 Jul 2018 09:19:19 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.206.53]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D0DA53F5BA; Mon, 2 Jul 2018 09:19:18 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Mon, 2 Jul 2018 17:19:04 +0100 Message-Id: <20180702161910.2013-2-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180702161910.2013-1-julien.grall@arm.com> References: <20180702161910.2013-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH v2 1/7] xen/arm: Remove the variable dom0_11_mapping and open-code the value X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Julien Grall , Stefano Stabellini MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Dom0 (aka hardware domain on Arm) is always direct mapped. Rather than using a global variable to store a const, directly open-code it or replace the use with is_domain_direct_mapped(...) macros. This will also help a follow-up patch to move all domain_build.c in init. Signed-off-by: Julien Grall Reviewed-by: Stefano Stabellini --- Changes in v2: - Add Stefano's reviewed-by --- xen/arch/arm/domain_build.c | 4 +--- xen/include/asm-arm/domain.h | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index 11cdf05091..3c414c7f73 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -28,8 +28,6 @@ static unsigned int __initdata opt_dom0_max_vcpus; integer_param("dom0_max_vcpus", opt_dom0_max_vcpus); -int dom0_11_mapping = 1; - static u64 __initdata dom0_mem; static int __init parse_dom0_mem(const char *s) @@ -261,7 +259,7 @@ static void allocate_memory(struct domain *d, struct kernel_info *kinfo) * TODO: Implement memory bank allocation when DOM0 is not direct * mapped */ - BUG_ON(!dom0_11_mapping); + BUG_ON(!is_domain_direct_mapped(d)); printk("Allocating 1:1 mappings totalling %ldMB for dom0:\n", /* Don't want format this as PRIpaddr (16 digit hex) */ diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h index 7ba6528a74..280c3951fd 100644 --- a/xen/include/asm-arm/domain.h +++ b/xen/include/asm-arm/domain.h @@ -31,8 +31,8 @@ enum domain_type { #define is_64bit_domain(d) (0) #endif -extern int dom0_11_mapping; -#define is_domain_direct_mapped(d) ((d) == hardware_domain && dom0_11_mapping) +/* The hardware domain has always its memory direct mapped. */ +#define is_domain_direct_mapped(d) ((d) == hardware_domain) struct vtimer { struct vcpu *v; From patchwork Mon Jul 2 16:19:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 140833 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp140036ljj; Mon, 2 Jul 2018 09:21:42 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdnxpRtmFUMKsGRQ0XExUDqFnuFs61EV2zGq740378M0HWFH9ffdFK1/mHYm1Y1MR7a4M3W X-Received: by 2002:a6b:e814:: with SMTP id f20-v6mr5369686ioh.269.1530548502653; Mon, 02 Jul 2018 09:21:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530548502; cv=none; d=google.com; s=arc-20160816; b=n8GxR+TGRa/AXsIdqmb/RaeCdV977DJ4qfcP34SQue4Jo2AdqL2vOvz5FSuQTLqDvN 41IpY8n6zTWp+4fcRxwhjVEeTWCbw/vFTx0K0YfVM8H1gpiykoJYPEa7GNg61v/yFBC6 8J7IvOKmp0LyggOh2HOaO8+rXwkgWlR1AIFJx6qLTnXRiifdQIPKne9nFBJfIupapuTT 14yG0/CkXG1hzP3BAWEnd4/ZzdE6wOIhjq2XZm9rHdQdeUVJEN5fsUkVEIXmJeJuNrog MXHBcB1NKlWmiYkpAd1xbv3IcVD5fhdACBluua0Qkk6ZY1FfNLuogaLveoj0KnAHmAKs /MjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:references:in-reply-to:message-id:date:to:from :arc-authentication-results; bh=RrJ/ksv6FpH37b6EPua4ip9gaBM6eKaeh58FXQvp4fM=; b=hzZE2cSMUm7rartLckQy2+fIw9ZIYCW4AWfNsNc9C/PMtPFqORinItcsg5lOgDQkOC 7TKGvsnlS52JATZEGt6ihXH2lBWyBiL0rr8f6jTbt02HKqArg67S8G94R+ly83rNy0Cj ZB0mFvyyALP5TrAYcjn176jvHQURWK79Qd9pFYGffMcTUzgVmvWVMTG0uk6dMj/YfMsu kgyooj2gjWWNBz/V1tfeVW0vyM53Y/1cb8tWm/RiJ1gNkafcXxssy0jHO4OICrv8mSxf 2y6Jr37u2lhSC8xJ8B3XMc5c9DLFyTxBitTTmu2hgc1CeuwvCnWzpfzClbnokhScxiYt 9pvA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id n11-v6si977129ioj.55.2018.07.02.09.21.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 02 Jul 2018 09:21:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1fa1Xu-0006oO-Ge; Mon, 02 Jul 2018 16:19:22 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1fa1Xt-0006nd-Pu for xen-devel@lists.xen.org; Mon, 02 Jul 2018 16:19:21 +0000 X-Inumbo-ID: a911c0e8-7e13-11e8-8089-bc764e045a96 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTP id a911c0e8-7e13-11e8-8089-bc764e045a96; Mon, 02 Jul 2018 18:19:14 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C032815AD; Mon, 2 Jul 2018 09:19:20 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.206.53]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D607E3F5BA; Mon, 2 Jul 2018 09:19:19 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Mon, 2 Jul 2018 17:19:05 +0100 Message-Id: <20180702161910.2013-3-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180702161910.2013-1-julien.grall@arm.com> References: <20180702161910.2013-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH v2 2/7] xen/arm: domain_build: Move in init all code/data of domain_build.c X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Julien Grall , Stefano Stabellini MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" The file domain_build.c only contains code/data used during the initialization. So move everything to init and mark the file as such. Signed-off-by: Julien Grall Reviewed-by: Stefano Stabellini --- Changes in v2: - Add Stefano's reviewed-by --- xen/arch/arm/Makefile | 2 +- xen/arch/arm/domain_build.c | 133 +++++++++++++++++++++++--------------------- 2 files changed, 70 insertions(+), 65 deletions(-) diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile index a9533b107e..6c4afe27cc 100644 --- a/xen/arch/arm/Makefile +++ b/xen/arch/arm/Makefile @@ -12,7 +12,7 @@ obj-y += cpufeature.o obj-y += decode.o obj-y += device.o obj-y += domain.o -obj-y += domain_build.o +obj-y += domain_build.init.o obj-y += domctl.o obj-$(EARLY_PRINTK) += early_printk.o obj-y += gic.o diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index 3c414c7f73..1351572da1 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -77,7 +77,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 @@ -95,10 +95,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 insert_11_bank(struct domain *d, - struct kernel_info *kinfo, - struct page_info *pg, - unsigned int order) +static bool __init insert_11_bank(struct domain *d, + struct kernel_info *kinfo, + struct page_info *pg, + unsigned int order) { int res, i; mfn_t smfn; @@ -243,7 +243,7 @@ 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(struct domain *d, struct kernel_info *kinfo) +static void __init allocate_memory(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))); @@ -367,8 +367,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, *status = NULL; @@ -494,8 +494,10 @@ 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; @@ -514,8 +516,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; @@ -529,10 +531,10 @@ 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_child_n_addr_cells(parent) + dt_child_n_size_cells(parent); @@ -575,9 +577,9 @@ static int make_memory_node(const struct domain *d, static void evtchn_allocate(struct domain *d); -static int make_hypervisor_node(struct domain *d, - const struct kernel_info *kinfo, - const struct dt_device_node *parent) +static int __init make_hypervisor_node(struct domain *d, + const struct kernel_info *kinfo, + const struct dt_device_node *parent) { const char compat[] = "xen,xen-"__stringify(XEN_VERSION)"."__stringify(XEN_SUBVERSION)"\0" @@ -641,7 +643,8 @@ 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[] = @@ -677,8 +680,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"); @@ -791,8 +794,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; @@ -860,8 +863,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 = { @@ -935,9 +938,8 @@ static int make_timer_node(const struct domain *d, void *fdt, return res; } -static int map_irq_to_domain(struct domain *d, unsigned int irq, - bool need_mapping, const char *devname) - +static int __init map_irq_to_domain(struct domain *d, unsigned int irq, + bool need_mapping, const char *devname) { int res; @@ -971,9 +973,9 @@ static int map_irq_to_domain(struct domain *d, unsigned int irq, return 0; } -static int map_dt_irq_to_domain(const struct dt_device_node *dev, - const struct dt_irq *dt_irq, - void *data) +static int __init map_dt_irq_to_domain(const struct dt_device_node *dev, + const struct dt_irq *dt_irq, + void *data) { struct domain *d = data; unsigned int irq = dt_irq->irq; @@ -1002,9 +1004,9 @@ static int map_dt_irq_to_domain(const struct dt_device_node *dev, return 0; } -static int map_range_to_domain(const struct dt_device_node *dev, - u64 addr, u64 len, - void *data) +static int __init map_range_to_domain(const struct dt_device_node *dev, + u64 addr, u64 len, + void *data) { struct map_range_data *mr_data = data; struct domain *d = mr_data->d; @@ -1051,9 +1053,9 @@ static int map_range_to_domain(const struct dt_device_node *dev, * then we may need to perform additional mappings in order to make * the child resources available to domain 0. */ -static int map_device_children(struct domain *d, - const struct dt_device_node *dev, - p2m_type_t p2mt) +static int __init map_device_children(struct domain *d, + const struct dt_device_node *dev, + p2m_type_t p2mt) { struct map_range_data mr_data = { .d = d, .p2mt = p2mt }; int ret; @@ -1083,8 +1085,8 @@ static int map_device_children(struct domain *d, * - Assign the device to the guest if it's protected by an IOMMU * - Map the IRQs and iomem regions to DOM0 */ -static int handle_device(struct domain *d, struct dt_device_node *dev, - p2m_type_t p2mt) +static int __init handle_device(struct domain *d, struct dt_device_node *dev, + p2m_type_t p2mt) { unsigned int nirq; unsigned int naddr; @@ -1171,9 +1173,9 @@ static int handle_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, - p2m_type_t p2mt) +static int __init handle_node(struct domain *d, struct kernel_info *kinfo, + struct dt_device_node *node, + p2m_type_t p2mt) { static const struct dt_device_match skip_matches[] __initconst = { @@ -1317,7 +1319,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 p2m_type_t default_p2mt = p2m_mmio_direct_c; const void *fdt; @@ -1358,7 +1360,7 @@ static int prepare_dtb(struct domain *d, struct kernel_info *kinfo) #ifdef CONFIG_ACPI #define ACPI_DOM0_FDT_MIN_SIZE 4096 -static int acpi_iomem_deny_access(struct domain *d) +static int __init acpi_iomem_deny_access(struct domain *d) { acpi_status status; struct acpi_table_spcr *spcr = NULL; @@ -1390,7 +1392,7 @@ static int acpi_iomem_deny_access(struct domain *d) return gic_iomem_deny_access(d); } -static int acpi_route_spis(struct domain *d) +static int __init acpi_route_spis(struct domain *d) { int i, res; struct irq_desc *desc; @@ -1418,7 +1420,7 @@ static int acpi_route_spis(struct domain *d) return 0; } -static int acpi_make_chosen_node(const struct kernel_info *kinfo) +static int __init acpi_make_chosen_node(const struct kernel_info *kinfo) { int res; const char *bootargs = NULL; @@ -1459,8 +1461,8 @@ static int acpi_make_chosen_node(const struct kernel_info *kinfo) return res; } -static int acpi_make_hypervisor_node(const struct kernel_info *kinfo, - struct membank tbl_add[]) +static int __init acpi_make_hypervisor_node(const struct kernel_info *kinfo, + struct membank tbl_add[]) { const char compat[] = "xen,xen-"__stringify(XEN_VERSION)"."__stringify(XEN_SUBVERSION)"\0" @@ -1494,7 +1496,8 @@ static int acpi_make_hypervisor_node(const struct kernel_info *kinfo, * Prepare a minimal DTB for Dom0 which contains bootargs, initrd, memory * information, EFI table. */ -static int create_acpi_dtb(struct kernel_info *kinfo, struct membank tbl_add[]) +static int __init create_acpi_dtb(struct kernel_info *kinfo, + struct membank tbl_add[]) { int new_size; int ret; @@ -1554,7 +1557,7 @@ static int create_acpi_dtb(struct kernel_info *kinfo, struct membank tbl_add[]) return -EINVAL; } -static void acpi_map_other_tables(struct domain *d) +static void __init acpi_map_other_tables(struct domain *d) { int i; unsigned long res; @@ -1579,7 +1582,7 @@ static void acpi_map_other_tables(struct domain *d) } } -static int acpi_create_rsdp(struct domain *d, struct membank tbl_add[]) +static int __init acpi_create_rsdp(struct domain *d, struct membank tbl_add[]) { struct acpi_table_rsdp *rsdp = NULL; @@ -1613,8 +1616,9 @@ static int acpi_create_rsdp(struct domain *d, struct membank tbl_add[]) return 0; } -static void acpi_xsdt_modify_entry(u64 entry[], unsigned long entry_count, - char *signature, u64 addr) +static void __init acpi_xsdt_modify_entry(u64 entry[], + unsigned long entry_count, + char *signature, u64 addr) { int i; struct acpi_table_header *table; @@ -1633,7 +1637,7 @@ static void acpi_xsdt_modify_entry(u64 entry[], unsigned long entry_count, } } -static int acpi_create_xsdt(struct domain *d, struct membank tbl_add[]) +static int __init acpi_create_xsdt(struct domain *d, struct membank tbl_add[]) { struct acpi_table_header *table = NULL; struct acpi_table_rsdp *rsdp_tbl; @@ -1681,7 +1685,7 @@ static int acpi_create_xsdt(struct domain *d, struct membank tbl_add[]) return 0; } -static int acpi_create_stao(struct domain *d, struct membank tbl_add[]) +static int __init acpi_create_stao(struct domain *d, struct membank tbl_add[]) { struct acpi_table_header *table = NULL; struct acpi_table_stao *stao = NULL; @@ -1718,7 +1722,7 @@ static int acpi_create_stao(struct domain *d, struct membank tbl_add[]) return 0; } -static int acpi_create_madt(struct domain *d, struct membank tbl_add[]) +static int __init acpi_create_madt(struct domain *d, struct membank tbl_add[]) { struct acpi_table_header *table = NULL; struct acpi_table_madt *madt = NULL; @@ -1775,7 +1779,7 @@ static int acpi_create_madt(struct domain *d, struct membank tbl_add[]) return 0; } -static int acpi_create_fadt(struct domain *d, struct membank tbl_add[]) +static int __init acpi_create_fadt(struct domain *d, struct membank tbl_add[]) { struct acpi_table_header *table = NULL; struct acpi_table_fadt *fadt = NULL; @@ -1812,7 +1816,8 @@ static int acpi_create_fadt(struct domain *d, struct membank tbl_add[]) return 0; } -static int estimate_acpi_efi_size(struct domain *d, struct kernel_info *kinfo) +static int __init estimate_acpi_efi_size(struct domain *d, + struct kernel_info *kinfo) { size_t efi_size, acpi_size, madt_size; u64 addr; @@ -1861,7 +1866,7 @@ static int estimate_acpi_efi_size(struct domain *d, struct kernel_info *kinfo) return 0; } -static int prepare_acpi(struct domain *d, struct kernel_info *kinfo) +static int __init prepare_acpi(struct domain *d, struct kernel_info *kinfo) { int rc = 0; int order; @@ -1960,14 +1965,14 @@ static int prepare_acpi(struct domain *d, struct kernel_info *kinfo) return 0; } #else -static int prepare_acpi(struct domain *d, struct kernel_info *kinfo) +static int __init prepare_acpi(struct domain *d, struct kernel_info *kinfo) { /* Only booting with ACPI will hit here */ BUG(); return -EINVAL; } #endif -static void dtb_load(struct kernel_info *kinfo) +static void __init dtb_load(struct kernel_info *kinfo) { unsigned long left; @@ -1983,7 +1988,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; @@ -2039,7 +2044,7 @@ static void initrd_load(struct kernel_info *kinfo) * Note that this should only be called once all PPIs used by the * hardware domain have been registered. */ -static void evtchn_allocate(struct domain *d) +static void __init evtchn_allocate(struct domain *d) { int res; u64 val; From patchwork Mon Jul 2 16:19:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 140831 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp139981ljj; Mon, 2 Jul 2018 09:21:38 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdYVtdkZruM+rPo56qFqb31bdiuJ3hL6+avY1Gteqz75K8eEjpTaJgdX1yMj2vhBcczd2m/ X-Received: by 2002:a6b:c501:: with SMTP id v1-v6mr20782983iof.172.1530548498768; Mon, 02 Jul 2018 09:21:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530548498; cv=none; d=google.com; s=arc-20160816; b=OU809c/WhW00Yl2dus1s00zwaqp5jyQQcRUTYX6elugbv/NliOs/dA8oQnah9o977a dE39cN/9sYj+ClOEO91PANocXhGrrLzoHq9CK174knoLeJMt5KZ5WGsjSVHROK4P3zAf l4hxEf9aeQ7zaCnF9T/QI3dnV92HlhBI3oepDYRUEWh5KDQKSjIbYVtoHOyW7Hob/UP6 v+JwH+EslSP4ZmhuPZiiF5syDkMRJaIttWLDKceakcLe4h0aJd+qORO0Cifm3tsLoFjw 9OhyirjC27ii4ijEdYshNkU9KcDOxrz5HroECaAPV/S9mFhbRxT/AuZZPferly5copQ/ QN1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:references:in-reply-to:message-id:date:to:from :arc-authentication-results; bh=9qlEBqoyq3ifn9vXcCjUo41U02s72Igiji6HByoOAdw=; b=l59VtUf4VJCRdxf7Un1rcqjyOuY5PJE3oSSHUBj35BHfDMDIVk0ZVt4r7aTSyT8F4/ sUgxjW6zsNzuSBC5L0r9ui1zBBo6559bZwKL900wAB2i1NJlfQp2hWXMK158fUhq0u0V qwJ9FbKpP0gIQF8g8dJMfDIJ/L46z1DCJ4vKfqddOa1hsLCGaCtdwyr6Fug0ERjxZjAA cnWErQh6+wIerBlX7uOBNSEX9s0oJUpWhfCcg3KTxayHAVqVjXETiISP2dxPDbzQlAPS iCemEEjI3q3ue6gxQZ5o/7jya5ikJqK1BIC/O6TGBhURaF2imQBmGD0bVV+tSKynBo40 gzFA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id e39-v6si6310139ioi.41.2018.07.02.09.21.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 02 Jul 2018 09:21:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1fa1Xw-0006pi-R1; Mon, 02 Jul 2018 16:19:24 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1fa1Xv-0006ot-Bn for xen-devel@lists.xen.org; Mon, 02 Jul 2018 16:19:23 +0000 X-Inumbo-ID: af6cf4d7-7e13-11e8-ba45-cfc176a5991c Received: from foss.arm.com (unknown [217.140.101.70]) by us1-amaz-eas1.inumbo.com (Halon) with ESMTP id af6cf4d7-7e13-11e8-ba45-cfc176a5991c; Mon, 02 Jul 2018 16:19:24 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C53401650; Mon, 2 Jul 2018 09:19:21 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.206.53]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0A5C33F5BA; Mon, 2 Jul 2018 09:19:20 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Mon, 2 Jul 2018 17:19:06 +0100 Message-Id: <20180702161910.2013-4-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180702161910.2013-1-julien.grall@arm.com> References: <20180702161910.2013-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH v2 3/7] xen/arm: kernel: Move in init all the code/data of kernel.c X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Julien Grall , Stefano Stabellini MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" The file kernel.c only contains code/data used during the initialization. So move everything to init and mark the file as such. Signed-off-by: Julien Grall Reviewed-by: Stefano Stabellini --- Changes in v2: - Add Stefano's reviewed-by --- xen/arch/arm/Makefile | 2 +- xen/arch/arm/kernel.c | 32 ++++++++++++++++---------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile index 6c4afe27cc..a5bd44e59d 100644 --- a/xen/arch/arm/Makefile +++ b/xen/arch/arm/Makefile @@ -25,7 +25,7 @@ obj-y += guest_walk.o obj-y += hvm.o obj-y += io.o obj-y += irq.o -obj-y += kernel.o +obj-y += kernel.init.o obj-$(CONFIG_LIVEPATCH) += livepatch.o obj-y += mem_access.o obj-y += mm.o diff --git a/xen/arch/arm/kernel.c b/xen/arch/arm/kernel.c index 8fdfd91543..b29028f7d0 100644 --- a/xen/arch/arm/kernel.c +++ b/xen/arch/arm/kernel.c @@ -46,7 +46,7 @@ struct minimal_dtb_header { * @paddr: source physical address * @len: length to copy */ -void copy_from_paddr(void *dst, paddr_t paddr, unsigned long len) +void __init copy_from_paddr(void *dst, paddr_t paddr, unsigned long len) { void *src = (void *)FIXMAP_ADDR(FIXMAP_MISC); @@ -68,8 +68,8 @@ void copy_from_paddr(void *dst, paddr_t paddr, unsigned long len) clear_fixmap(FIXMAP_MISC); } -static void place_modules(struct kernel_info *info, - paddr_t kernbase, paddr_t kernend) +static void __init 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 = info->initrd_bootmodule; @@ -122,7 +122,7 @@ static void place_modules(struct kernel_info *info, info->initrd_paddr = info->dtb_paddr + dtb_len; } -static paddr_t kernel_zimage_place(struct kernel_info *info) +static paddr_t __init kernel_zimage_place(struct kernel_info *info) { paddr_t load_addr; @@ -154,7 +154,7 @@ static paddr_t kernel_zimage_place(struct kernel_info *info) return load_addr; } -static void kernel_zimage_load(struct kernel_info *info) +static void __init kernel_zimage_load(struct kernel_info *info) { paddr_t load_addr = kernel_zimage_place(info); paddr_t paddr = info->zimage.kernel_addr; @@ -190,8 +190,8 @@ static void kernel_zimage_load(struct kernel_info *info) /* * Check if the image is a uImage and setup kernel_info */ -static int kernel_uimage_probe(struct kernel_info *info, - paddr_t addr, paddr_t size) +static int __init kernel_uimage_probe(struct kernel_info *info, + paddr_t addr, paddr_t size) { struct { __be32 magic; /* Image Header Magic Number */ @@ -318,8 +318,8 @@ static __init int kernel_decompress(struct bootmodule *mod) /* * Check if the image is a 64-bit Image. */ -static int kernel_zimage64_probe(struct kernel_info *info, - paddr_t addr, paddr_t size) +static int __init kernel_zimage64_probe(struct kernel_info *info, + paddr_t addr, paddr_t size) { /* linux/Documentation/arm64/booting.txt */ struct { @@ -372,8 +372,8 @@ static int kernel_zimage64_probe(struct kernel_info *info, /* * Check if the image is a 32-bit zImage and setup kernel_info */ -static int kernel_zimage32_probe(struct kernel_info *info, - paddr_t addr, paddr_t size) +static int __init kernel_zimage32_probe(struct kernel_info *info, + paddr_t addr, paddr_t size) { uint32_t zimage[ZIMAGE32_HEADER_LEN/4]; uint32_t start, end; @@ -421,7 +421,7 @@ static int kernel_zimage32_probe(struct kernel_info *info, return 0; } -static void kernel_elf_load(struct kernel_info *info) +static void __init kernel_elf_load(struct kernel_info *info) { /* * TODO: can the ELF header be used to find the physical address @@ -444,8 +444,8 @@ static void kernel_elf_load(struct kernel_info *info) free_xenheap_pages(info->elf.kernel_img, info->elf.kernel_order); } -static int kernel_elf_probe(struct kernel_info *info, - paddr_t addr, paddr_t size) +static int __init kernel_elf_probe(struct kernel_info *info, + paddr_t addr, paddr_t size) { int rc; @@ -496,7 +496,7 @@ err: return rc; } -int kernel_probe(struct kernel_info *info) +int __init kernel_probe(struct kernel_info *info) { struct bootmodule *mod = boot_module_find_by_kind(BOOTMOD_KERNEL); int rc; @@ -534,7 +534,7 @@ int kernel_probe(struct kernel_info *info) return rc; } -void kernel_load(struct kernel_info *info) +void __init kernel_load(struct kernel_info *info) { info->load(info); } From patchwork Mon Jul 2 16:19:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 140827 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp139939ljj; Mon, 2 Jul 2018 09:21:37 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf/x5miXT5JleFFXgPvxlWZwRNcU2oIlsx+HecKXyxuuQSsZtDlI64PPS3z7dMS2VVKc8vU X-Received: by 2002:a24:6ed0:: with SMTP id w199-v6mr6630238itc.65.1530548497027; Mon, 02 Jul 2018 09:21:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530548497; cv=none; d=google.com; s=arc-20160816; b=kpaoL+FL9vvtSY77QDlmjwq/VaTFAvhdCKCK5QSInmHwBl5vZ6Nwrgf5bhLH7vPTnF Dl+bsdf0BtQ8O2VUiujX3x4LS+Jd6QygrQBTBTlPFWQWrf698E4mZ84DhMyygToxK0Xz b7uOkPpvkbwA36jzIWFp7Z1Ob055A1ZqeVfl9v73xQ7cS12LT9jmRgQsYvEXBVusLqMU cM8DCOyWoSWwQz88PgQAMIgnezuWOa5ANxUS200QYvijvU+99DQ121gR0rzO/G57KW+7 frGCIuy4y/uGZp09uY6vQOfHZz5SKWAw0xSBYr00rnXReCASfLnkoJpBbgipT7i875NV IlmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:references:in-reply-to:message-id:date:to:from :arc-authentication-results; bh=yrzlOED1hRj9I4IOh9+k3EUQr+j+I2RQNE5/iEXiB5k=; b=lswfgaO0Ape/cmxLEGh03+UMzVj0MY3h+YklPwPXv4hD3kSXjUKRetDvPm9mcdhImx 1UoR7raE9gJhyQOdlfSXyt7qEYeMRUMTuTr4Zjw12D6m2mSinHclFmlhqKDKK3wN6q82 7dFfoRlNFh2sQh4lB1z/tTLDE5hBvNUHxEChu81bucE/jut9MeZBreV2BXgLy8DJ3Yow jStzg2PiuutoswCbR/ARjNh3sWBgq7Z1Gs+lwLjNXEvkuyKV5mz0FgmA16r0J7lrBeaU AVSKl4Lfvg4cjoKsF+sphU5jf4qFgmBoL0ElEF0bgbZPVEdN4C4Xuk9WAEP95ufpG/UW nhwg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id q80-v6si8328202ioe.237.2018.07.02.09.21.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 02 Jul 2018 09:21:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1fa1Xx-0006q1-4L; Mon, 02 Jul 2018 16:19:25 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1fa1Xv-0006p0-Gs for xen-devel@lists.xen.org; Mon, 02 Jul 2018 16:19:23 +0000 X-Inumbo-ID: b0089c6f-7e13-11e8-ba45-cfc176a5991c Received: from foss.arm.com (unknown [217.140.101.70]) by us1-amaz-eas1.inumbo.com (Halon) with ESMTP id b0089c6f-7e13-11e8-ba45-cfc176a5991c; Mon, 02 Jul 2018 16:19:25 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id CA2341529; Mon, 2 Jul 2018 09:19:22 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.206.53]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0F87B3F5BA; Mon, 2 Jul 2018 09:19:21 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Mon, 2 Jul 2018 17:19:07 +0100 Message-Id: <20180702161910.2013-5-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180702161910.2013-1-julien.grall@arm.com> References: <20180702161910.2013-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH v2 4/7] xen/arm: Drop support for loading ELF Dom0 kernel X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Julien Grall , Stefano Stabellini MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" The code has been around since the beginning of Xen Arm. However, I am not aware of any user and the code is pretty bogus: 1) It is assuming virtual address == physical address. 2) The cache is not cleaned after the Image is loaded but the Image is started with Cache disabled. 3) There are not clear ABI with the guest. Xen is currently supporting 3 other formats (zImage, Image, U-boot Image) as well as gzip compressed version of each formats. All of them are well documented and widely use. Signed-off-by: Julien Grall Reviewed-by: Stefano Stabellini --- Given the state, I doubt anyone is using the ELF format with Xen on Arm. By dropping this code, it also allows us to remove the built-in libelf (~1.2K lines) from Xen. Changes in v2: - Add Stefano's reviewed-by --- xen/arch/arm/kernel.c | 77 --------------------------------------------------- xen/arch/arm/kernel.h | 10 +------ 2 files changed, 1 insertion(+), 86 deletions(-) diff --git a/xen/arch/arm/kernel.c b/xen/arch/arm/kernel.c index b29028f7d0..000d9397e1 100644 --- a/xen/arch/arm/kernel.c +++ b/xen/arch/arm/kernel.c @@ -421,81 +421,6 @@ static int __init kernel_zimage32_probe(struct kernel_info *info, return 0; } -static void __init kernel_elf_load(struct kernel_info *info) -{ - /* - * TODO: can the ELF header be used to find the physical address - * to load the image to? Instead of assuming virt == phys. - */ - info->entry = info->elf.parms.virt_entry; - - place_modules(info, - info->elf.parms.virt_kstart, - info->elf.parms.virt_kend); - - printk("Loading ELF image into guest memory\n"); - info->elf.elf.dest_base = (void*)(unsigned long)info->elf.parms.virt_kstart; - info->elf.elf.dest_size = - info->elf.parms.virt_kend - info->elf.parms.virt_kstart; - - elf_load_binary(&info->elf.elf); - - printk("Free temporary kernel buffer\n"); - free_xenheap_pages(info->elf.kernel_img, info->elf.kernel_order); -} - -static int __init kernel_elf_probe(struct kernel_info *info, - paddr_t addr, paddr_t size) -{ - int rc; - - memset(&info->elf.elf, 0, sizeof(info->elf.elf)); - - info->elf.kernel_order = get_order_from_bytes(size); - info->elf.kernel_img = alloc_xenheap_pages(info->elf.kernel_order, 0); - if ( info->elf.kernel_img == NULL ) - panic("Cannot allocate temporary buffer for kernel"); - - copy_from_paddr(info->elf.kernel_img, addr, size); - - if ( (rc = elf_init(&info->elf.elf, info->elf.kernel_img, size )) != 0 ) - goto err; -#ifdef CONFIG_VERBOSE_DEBUG - elf_set_verbose(&info->elf.elf); -#endif - elf_parse_binary(&info->elf.elf); - if ( (rc = elf_xen_parse(&info->elf.elf, &info->elf.parms)) != 0 ) - goto err; - -#ifdef CONFIG_ARM_64 - if ( elf_32bit(&info->elf.elf) ) - info->type = DOMAIN_32BIT; - else if ( elf_64bit(&info->elf.elf) ) - info->type = DOMAIN_64BIT; - else - { - printk("Unknown ELF class\n"); - rc = -EINVAL; - goto err; - } -#endif - - info->load = kernel_elf_load; - - if ( elf_check_broken(&info->elf.elf) ) - printk("Xen: warning: ELF kernel broken: %s\n", - elf_check_broken(&info->elf.elf)); - - return 0; -err: - if ( elf_check_broken(&info->elf.elf) ) - printk("Xen: ELF kernel broken: %s\n", - elf_check_broken(&info->elf.elf)); - - free_xenheap_pages(info->elf.kernel_img, info->elf.kernel_order); - return rc; -} - int __init kernel_probe(struct kernel_info *info) { struct bootmodule *mod = boot_module_find_by_kind(BOOTMOD_KERNEL); @@ -528,8 +453,6 @@ int __init kernel_probe(struct kernel_info *info) rc = kernel_uimage_probe(info, mod->start, mod->size); if (rc < 0) rc = kernel_zimage32_probe(info, mod->start, mod->size); - if (rc < 0) - rc = kernel_elf_probe(info, mod->start, mod->size); return rc; } diff --git a/xen/arch/arm/kernel.h b/xen/arch/arm/kernel.h index 6d695097b5..47eacb5ba9 100644 --- a/xen/arch/arm/kernel.h +++ b/xen/arch/arm/kernel.h @@ -6,7 +6,6 @@ #ifndef __ARCH_ARM_KERNEL_H__ #define __ARCH_ARM_KERNEL_H__ -#include #include #include @@ -45,13 +44,6 @@ struct kernel_info { #endif paddr_t start; /* 32-bit zImage only */ } zimage; - - struct { - struct elf_binary elf; - struct elf_dom_parms parms; - unsigned kernel_order; - void *kernel_img; - } elf; }; }; @@ -60,7 +52,7 @@ struct kernel_info { * * Sets in info: * ->type - * ->load hook, and sets loader specific variables ->{zimage,elf} + * ->load hook, and sets loader specific variables ->zimage */ int kernel_probe(struct kernel_info *info); From patchwork Mon Jul 2 16:19:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 140826 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp139815ljj; Mon, 2 Jul 2018 09:21:30 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf4KZcydlFcB9MtPeCIzxHUf6O11lfMd/p+SY//ybBD+VmBND9ORXIaAV3bueHNDHOA58C9 X-Received: by 2002:a02:9c33:: with SMTP id q48-v6mr19610035jak.103.1530548490152; Mon, 02 Jul 2018 09:21:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530548490; cv=none; d=google.com; s=arc-20160816; b=QkNq0evOCjt2oCY+mhRi+eQXGxjgGQOLJwxuVH2S+RBLgYp5i5z4At4LNc/P9svqt8 41r0JiCEuS21nhRQ09OPkzc6982Y2jx3GD8DsmbdzKHOImBNDeP0IlZxcsL4gWC5/Cy+ QKU85qZgoMfkLaNO2gQkTI768khfTFO6P2XjjLEBZ+LwzcQq8kbqwrYYch9vC9ob1pQx Ruk4uF6wFrv/EnALVDVOccbgUcJsihPNU19mYDvDIFrgZaEHfV6JgtNM0Id9RPGattUr YKVbFjHiA4AZoX8FoZ4+gtgktDPUap12W11UoA+dOySjfr7zFRzYTe6EaUqCEPfD2ZjT NHEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:references:in-reply-to:message-id:date:to:from :arc-authentication-results; bh=upsAuc29RYiNgUrMwEGdPgoXfi/+JJvTTRwziSaX6gk=; b=ErEHlkD2dabojyhK09XTv/ryOwLXspgXhvLFefuJvECBrhVgkWIdQ+kpE+stxDdp5/ s34i3o2iz12L66hizDyCzAT/XhmVgDApboNc9PtQNEzwVvlNPdQ4blkQ2RgeMFvWC2CH un7G1wmuU3ZP1elAq4SKY6H5JvuGPrtkvkdqqPS6c/S0uQeqzy9Z3d2By0oQnQFUjeSf RnPIeaKhQ27EfbWkZ/j1XrZGMhDB/VsEmCmf3ExhRI9uT4z6J6qKosSDnnFXvguQcqOC PLo3KawP5EOVaSCyujgLOH9NHRFvgcM9sBoWDr+wkv2KoTMtt2DBC/P3vBpJ/rt+ZqUl Rm9w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id r8-v6si3304853jad.22.2018.07.02.09.21.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 02 Jul 2018 09:21:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1fa1Xy-0006rG-M1; Mon, 02 Jul 2018 16:19:26 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1fa1Xx-0006qK-KA for xen-devel@lists.xen.org; Mon, 02 Jul 2018 16:19:25 +0000 X-Inumbo-ID: ab80b0eb-7e13-11e8-8089-bc764e045a96 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTP id ab80b0eb-7e13-11e8-8089-bc764e045a96; Mon, 02 Jul 2018 18:19:18 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D3B881650; Mon, 2 Jul 2018 09:19:24 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.206.53]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 15E7F3F5BA; Mon, 2 Jul 2018 09:19:22 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Mon, 2 Jul 2018 17:19:08 +0100 Message-Id: <20180702161910.2013-6-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180702161910.2013-1-julien.grall@arm.com> References: <20180702161910.2013-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH v2 5/7] xen: Don't build libelf for Arm X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Wei Liu , George Dunlap , Andrew Cooper , Ian Jackson , Tim Deegan , Julien Grall , Jan Beulich MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Now that ELF support has been dropped to boot Dom0, no-one is using libelf within the hypervisor. Introduce a config option to select libelf on x86 and keep unselected for Arm. Signed-off-by: Julien Grall Acked-by: Jan Beulich Reviewed-by: Stefano Stabellini --- Changes in v2: - Rename HAS_ELF to NEEDS_LIBELF --- xen/arch/x86/Kconfig | 1 + xen/common/Kconfig | 3 +++ xen/common/Makefile | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig index f64fc56739..c75f0526d8 100644 --- a/xen/arch/x86/Kconfig +++ b/xen/arch/x86/Kconfig @@ -24,6 +24,7 @@ config X86 select HAS_PDX select HAS_UBSAN select HAS_VPCI if !PV_SHIM_EXCLUSIVE + select NEEDS_LIBELF select NUMA config ARCH_DEFCONFIG diff --git a/xen/common/Kconfig b/xen/common/Kconfig index 9043dce937..d4c0951a24 100644 --- a/xen/common/Kconfig +++ b/xen/common/Kconfig @@ -44,6 +44,9 @@ config HAS_GDBSX config HAS_IOPORTS bool +config NEEDS_LIBELF + bool + config NEEDS_LIST_SORT bool diff --git a/xen/common/Makefile b/xen/common/Makefile index 24d4752ccc..b3e0b0ebf4 100644 --- a/xen/common/Makefile +++ b/xen/common/Makefile @@ -78,5 +78,5 @@ obj-$(CONFIG_TMEM) += $(tmem-y) subdir-$(CONFIG_COVERAGE) += coverage subdir-$(CONFIG_UBSAN) += ubsan -subdir-y += libelf +subdir-$(CONFIG_NEEDS_LIBELF) += libelf subdir-$(CONFIG_HAS_DEVICE_TREE) += libfdt From patchwork Mon Jul 2 16:19:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 140830 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp139971ljj; Mon, 2 Jul 2018 09:21:38 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdXnfzzt1mGYaNU3WGo0gPAgU15VkKYSPxLL2RtLSPKY3OuffWEWfxsa+LD/TkBWG7XdwIo X-Received: by 2002:a6b:3e46:: with SMTP id l67-v6mr10344818ioa.294.1530548498323; Mon, 02 Jul 2018 09:21:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530548498; cv=none; d=google.com; s=arc-20160816; b=P+0qZa+8PxbSWVDidt/y6GVuZ/jKaSrn2nUP6oSEESA6424rH4mRx+3CXtF4c+PHs+ RP4l66DzY+r3/ZADaKoj2DFbS68RIg30wA1ZGqKleBt3xYys/CWuqfYt/zXc6JYA9Agz Ahk22CWKrzulA/WwqbK1/pOaCRx/dymWzejYIuWeISP+igRzGan667RTEWluHIXY8pKY o7Ub7gMZsKKb9u+Iho7mRfhFfZOvd8e5ZcHhWWJz8XigL9+ncaBKVwJ6+Qier68fanBG YwFPXnzeYgMj+R2hHE+vT34XwmB1KB/N15dWfReNaFgS2xa9aEMI0OqulOZ7Ji+2TIXZ v9Vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:references:in-reply-to:message-id:date:to:from :arc-authentication-results; bh=SpJ7mF1kpWn85VkkPyF0wK6IwZR9Dsq75QOk8teR4Fs=; b=WA4C0jt9UDFb3bC64Fcdata3Vb5g73+mmb2EV4sgNgb2H2aNk3luM+E46Fkz3xiSKo Lt1OygOm5zTCj57fTGmKPEEfFm8hzOuGeG8hejgW9QvMKTNtnH/N1lOHJs4kGn+qmtfm oCbQvPrPYuuBIMWZwVgxQLZUSo4tlO/+QBlleUPj3sXUKcOlChHRLp2zLQT/IqDlP5+Z euN6SK9yiWhtF09y+7Y8kTUdDLuS+WtP1f7Kn+Nf5XXH1xLbSB8FYY6hA0Fana6OnQAT /AJ5Onk5OhRAck7JMzlpVQgU6KJqlDeW4tsXXGJzwMINC/mJKuIExdCtpltZ7gfcdLlu 5TQw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id v185-v6si5696767itd.96.2018.07.02.09.21.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 02 Jul 2018 09:21:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1fa1Y0-0006s4-0s; Mon, 02 Jul 2018 16:19:28 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1fa1Xz-0006rX-1c for xen-devel@lists.xen.org; Mon, 02 Jul 2018 16:19:27 +0000 X-Inumbo-ID: b1dba576-7e13-11e8-ba45-cfc176a5991c Received: from foss.arm.com (unknown [217.140.101.70]) by us1-amaz-eas1.inumbo.com (Halon) with ESMTP id b1dba576-7e13-11e8-ba45-cfc176a5991c; Mon, 02 Jul 2018 16:19:28 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D8D241529; Mon, 2 Jul 2018 09:19:25 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.206.53]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1DFEF3F5BA; Mon, 2 Jul 2018 09:19:24 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Mon, 2 Jul 2018 17:19:09 +0100 Message-Id: <20180702161910.2013-7-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180702161910.2013-1-julien.grall@arm.com> References: <20180702161910.2013-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH v2 6/7] xen/libfdt: Put all libfdt in init X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Julien Grall , Stefano Stabellini MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Libfdt is used for: - Unflatten the Flatten Device-Tree (FDT) blob - Create Device-Tree for the Hardware-Domain Both use are done during the initialization of Xen. So move all the libfdt to init. Note that the runes was borrowed from libelf Makefile. Signed-off-by: Julien Grall Reviewed-by: Stefano Stabellini --- Changes in v2: - Add Stefano's reviewed-by --- xen/common/libfdt/Makefile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/xen/common/libfdt/Makefile b/xen/common/libfdt/Makefile index 7578fe9c50..d81f54b6b8 100644 --- a/xen/common/libfdt/Makefile +++ b/xen/common/libfdt/Makefile @@ -1,5 +1,13 @@ include Makefile.libfdt -obj-y += $(LIBFDT_OBJS) +SECTIONS := text data $(SPECIAL_DATA_SECTIONS) + +obj-y += libfdt.o CFLAGS += -I$(BASEDIR)/include/xen/libfdt/ + +libfdt.o: libfdt-temp.o Makefile + $(OBJCOPY) $(foreach s,$(SECTIONS),--rename-section .$(s)=.init.$(s)) $< $@ + +libfdt-temp.o: $(LIBFDT_OBJS) + $(LD) $(LDFLAGS) -r -o $@ $^ From patchwork Mon Jul 2 16:19:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 140832 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp139993ljj; Mon, 2 Jul 2018 09:21:39 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeC43njt+gR3HAFUu/rVHAGcbRvRlkgaWlqKTFp52vdaZuB4Tsu9jSyRN6egGMAU2s3tEH1 X-Received: by 2002:a24:1848:: with SMTP id 69-v6mr6149698itr.57.1530548499549; Mon, 02 Jul 2018 09:21:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530548499; cv=none; d=google.com; s=arc-20160816; b=RPL8uy4rTb5yqvrEo8UetpMe34Ul96Wqqy7QH+D23QaWmTh2en29TF1SrMRuHRkQ2v PT4E78HhDIiMOz7+6GKm+snMkw7T9uYHxpD3HpfChjsIa9MeT6fiew9AURRlBHUI0z6d 6cps2WhwzzcyFSnBGXRInCo8OhDUEtixAWSRyud9u95AcbMgnewEU7hnZKnD5o0e8vqB dwmWgasJmV3VjhAGN68AfBbFnPCS58P6vbTgceOpUenrzNB+5V5qOaxM0VlYvV0opq7x DY5CT1I5JJ0w4uVhECFJF3bVAdfANb0gnexakNVBbOuf1v1oddO10tZ1n01qPvHrVZSz x2ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:references:in-reply-to:message-id:date:to:from :arc-authentication-results; bh=/QNKfLx2q50CW5CK0wDNw/vyZL/BMrqjIDK/VpMQRPU=; b=l1izIRZ2T5ptA2R3nawbji/ZmjnQ+FqLoUnuqEJTEzg6BX94VlkVb+82Mk/Diovguz mrDztuiwpEeX20msbrJ9HdLz8gb/54R0N4JoytvAwbhvRrRnnULeStpB7fvDqo3NPH2a ZON5f3/JcbfVUnpSkEvOKMYwI6sUDrNzyjwjPOhW2ghm00GEb99lTEjsHjY7IUU4wZWi mhmAlroVxff7BVt0ljwafN8BTdQAgi0cW+sMiL48KpH9pHftVTWsHyTcPyCHebnc29Kq qzfTB8kFhkahpE056AO4Y7Xg9D3AidhhqQzMJnj/NJ87Guc+I5/LPzpLz+JOocf2I5we qSTg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id c203-v6si11808320ioc.170.2018.07.02.09.21.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 02 Jul 2018 09:21:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1fa1Y2-0006tt-DJ; Mon, 02 Jul 2018 16:19:30 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1fa1Y0-0006sO-89 for xen-devel@lists.xen.org; Mon, 02 Jul 2018 16:19:28 +0000 X-Inumbo-ID: b2774e13-7e13-11e8-ba45-cfc176a5991c Received: from foss.arm.com (unknown [217.140.101.70]) by us1-amaz-eas1.inumbo.com (Halon) with ESMTP id b2774e13-7e13-11e8-ba45-cfc176a5991c; Mon, 02 Jul 2018 16:19:29 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DDE361682; Mon, 2 Jul 2018 09:19:26 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.206.53]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 231DC3F5BA; Mon, 2 Jul 2018 09:19:25 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Mon, 2 Jul 2018 17:19:10 +0100 Message-Id: <20180702161910.2013-8-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180702161910.2013-1-julien.grall@arm.com> References: <20180702161910.2013-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH v2 7/7] xen/arm: setup: Move in init code only used at boot in setup.c X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Julien Grall , Stefano Stabellini MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Some of the functions implemented in setup.c are only used at boot but not yet marked as such. Signed-off-by: Julien Grall Reviewed-by: Stefano Stabellini --- Changes in v2: - Add Stefano's reviewed-by --- xen/arch/arm/setup.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c index 1d6f6bf37e..fe7384fd30 100644 --- a/xen/arch/arm/setup.c +++ b/xen/arch/arm/setup.c @@ -175,7 +175,7 @@ static void __init processor_id(void) check_local_cpu_errata(); } -void dt_unreserved_regions(paddr_t s, paddr_t e, +void __init dt_unreserved_regions(paddr_t s, paddr_t e, void (*cb)(paddr_t, paddr_t), int first) { int i, nr = fdt_num_mem_rsv(device_tree_flattened); @@ -201,9 +201,9 @@ void dt_unreserved_regions(paddr_t s, paddr_t e, cb(s, e); } -struct bootmodule *add_boot_module(bootmodule_kind kind, - paddr_t start, paddr_t size, - const char *cmdline) +struct bootmodule __init *add_boot_module(bootmodule_kind kind, + paddr_t start, paddr_t size, + const char *cmdline) { struct bootmodules *mods = &bootinfo.modules; struct bootmodule *mod; @@ -434,7 +434,7 @@ static paddr_t __init get_xen_paddr(void) return paddr; } -static void init_pdx(void) +static void __init init_pdx(void) { paddr_t bank_start, bank_size, bank_end;