From patchwork Tue Jun 5 17:12:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 137789 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp1217346lji; Tue, 5 Jun 2018 10:15:41 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKvMafS4HTrl7g0lfiRnk/TWoSbq+Fd0k7R4vX0soWs0sWtZKuoIICVC36NPLfX4CJUMYqZ X-Received: by 2002:a6b:954c:: with SMTP id x73-v6mr25667841iod.225.1528218941830; Tue, 05 Jun 2018 10:15:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528218941; cv=none; d=google.com; s=arc-20160816; b=npvElrYewPhj/opdU5LLlVZRP4b0AvAsxd1XLG0VOmvjpIBC6uz9f+B1Q8qsi/yvBM HKsqKP2CJqwI/uXKk1dP9BsO5iSbCHewU4qm0JEor7w9u+/AHp0e9nxThwZ2g/b9LnlW O8ak+GTUqEgLV+986z7vuSCCl59K/CwIzx6paqSPwMOWzbfSJLQLfKGSoVA1iOxm0qzR 4S77ZEUc7uuyqae5V7a/x6cJNT5jTpFKIwHIy9u7fBt9JM/PT9zTZzL9ZYBLU3EWCtGl jPs3CNdyjwe6pG5N7/psSalQlQ2wBVWGxSDpQQZFYfRiS792lVpNJ9uhyQuJI4UBPdAO gZsw== 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=QQ9GevMmqoZ0LsMuSff5IJ4CFUZma/vjt+DDOx0pmKE=; b=wbxu0uegznuPL4rOHYvos/kDtUtt2icuq6iSXbO17cdpDOps1LcO+MiZqAxjI8gyke 2t3KkE2jkWU1NBlwX+lWJJS1b87QVS0TOmOg0nrR8KYyN9hEZQnpqs92UuR3Z91KFvqg Yq6Yx4Yt96hLHGeDBsqcOw+Z+kOOD5zGXnZxCOnII04GvRJJyZivqRkNa7Qy9c9HFm5x WGM8SD+qwGoHi6YR2/EAoi/pPioW450Zq5Z782KesQmjx409tB7SIQ4SI7dXGOV+Gl4o ny0nH551MtJFlFKAzNgGiMISuLdEJK0JP4oOYiw9JipsBd2d09o/BuJyyoDEivf0vaPu +7Xw== 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 138-v6si1955991itw.101.2018.06.05.10.15.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Jun 2018 10:15:41 -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 1fQFVt-0007vV-P9; Tue, 05 Jun 2018 17:12:53 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1fQFVs-0007v9-Lo for xen-devel@lists.xenproject.org; Tue, 05 Jun 2018 17:12:52 +0000 X-Inumbo-ID: 5d1c4c0f-68e3-11e8-9728-bc764e045a96 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTP id 5d1c4c0f-68e3-11e8-9728-bc764e045a96; Tue, 05 Jun 2018 19:10:36 +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 A1D621529; Tue, 5 Jun 2018 10:12:50 -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 B797B3F25D; Tue, 5 Jun 2018 10:12:49 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org, xen-devel@lists.xen.org Date: Tue, 5 Jun 2018 18:12:31 +0100 Message-Id: <20180605171237.30601-2-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180605171237.30601-1-julien.grall@arm.com> References: <20180605171237.30601-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH 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 --- 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 Tue Jun 5 17:12:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 137782 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp1216871lji; Tue, 5 Jun 2018 10:15:18 -0700 (PDT) X-Google-Smtp-Source: ADUXVKL0xasXhhcQ4IuePii4JIDUasMZ0ioNZnKLyhGRudWLKB9we0FdNJ5VM6HgSYi1Fg03ya+3 X-Received: by 2002:a24:6d5:: with SMTP id 204-v6mr51071itv.47.1528218918701; Tue, 05 Jun 2018 10:15:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528218918; cv=none; d=google.com; s=arc-20160816; b=uIUDMuwyFdBfEzl7AbZsFRnHB9HvK67xRwxuVkeYQSQhv+GGIWvu6722XnGexnlWqg qNMj/fX1D/0KbmlV1K99+mvlQtO3ognxDODSv2D1aEJZbuWhZhcDkx8GV6TcGEWYSPqX L9WTQpgBlOaEf7p8YFm1obeWbgclboZ2ubqK0nb+7+d6HWS1wmRL96lf3Slg1uoDttnr joESF9JdadPCNDW4oqReYeH0SOu6dIOvSHopVNYnXo6lAYQQTINhWmgWlKEEuLDy3mQN BSalB68MO0gWW9y3VeUIJ5V71iPiOEokyBVh7qJOtxyFrzZA+db1h+m2oxykXcnW+G4D X6Ag== 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=F//tkoLnqw0rBmUobVPeFFU9/JfCtlhcvgW7tAH9CDI=; b=aX8k+QiHsEfAl9AitNWAHXRkeENslQ3GzxLrC3LCge+kdJt/D4+eHXSinl2ZC7ff9O TRYDeabhLx2Y3MNJXowSMsMWdv0/crKkkfd3ltI8IW7GmxmLKMsxWKO16o4/kriZ6l/s Cc9PBPEp9i1FGaSV3v4FEdmCUvGbY1LsjBAq5RlfNOUNs+rW0ySWTfV9JaTD2GZN2hY3 lICQwmjSA8+/egCT2ByCTJ6hhd+HkwaamWjte0q2SHxtXvHt7kMq338KD6/+QjpmgLOC x9D19V9DNehn9d54qrks5njjSWdHYMiWsvXZrMNRMZ9eMTCwZUqroAem044joAhhu6ln oYmg== 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 z84-v6si1924963itc.26.2018.06.05.10.15.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Jun 2018 10:15:18 -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 1fQFVv-0007wA-MF; Tue, 05 Jun 2018 17:12:55 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1fQFVu-0007vb-3o for xen-devel@lists.xenproject.org; Tue, 05 Jun 2018 17:12:54 +0000 X-Inumbo-ID: 5dcb46b2-68e3-11e8-9728-bc764e045a96 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTP id 5dcb46b2-68e3-11e8-9728-bc764e045a96; Tue, 05 Jun 2018 19:10:37 +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 EDD221435; Tue, 5 Jun 2018 10:12:51 -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 DFDB63F25D; Tue, 5 Jun 2018 10:12:50 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org, xen-devel@lists.xen.org Date: Tue, 5 Jun 2018 18:12:32 +0100 Message-Id: <20180605171237.30601-3-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180605171237.30601-1-julien.grall@arm.com> References: <20180605171237.30601-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH 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 --- 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 Tue Jun 5 17:12:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 137786 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp1217177lji; Tue, 5 Jun 2018 10:15:34 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ9bVZ1MaJmy7i43mFoJf72MLM9d+3m1/BjewcTXhJkjt6ZdjSgHXy+8Aa5X+WsfMyLkEeQ X-Received: by 2002:a6b:5905:: with SMTP id n5-v6mr18439291iob.0.1528218934379; Tue, 05 Jun 2018 10:15:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528218934; cv=none; d=google.com; s=arc-20160816; b=BcqfhaYgL5n1lE2e/BfsnTgR2krkNfyYdo3lKc4K5RxkIWvwo16amgT5RJzr8T1p6x /yMYUQ8tyXnOLAPbrX51UdzqfHeIGoGxzXsV/hGOqdH5esb8Yf2lHCbKYLYDnUxnwg9E gVOEwjYGO7mp5tzW061uTDaz3rzuCT/svb8nwwEXML/nidi/98JJnxtqgcNK6eIwgbPF EQU3bpKXx93Dy5zz8CiLZcsKddxdjbqdUVs05AbuYAue5pK5DhKnhP9DmcLqHR6L/vZr kbCRMtKzaT3nhXmKVG2MnceC490H1b1/jkWEEhi04+uvJPeCMidmbnC0j6YQYzgMg90R fj2w== 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=miLK7SG70YYIF9gQdJyQ0MA9KNtIB6SzUBDEsL34jxM=; b=ySb4D/srIc4TEPy91QtKA2PldxpXDXJLag1ENCSCuLwSYhPcUVR0vNfpBjconlZope HxtPbhHILR+5yWPz1ud5bOrI+LPUtsxvzZAbrKSaS296pl8Qg+kYl2CY+cshQVc78lGL tWRGcSMf77ZpRaubCb14LZne77jd5/RkDVlwz3UbkN00y8YcD8MFCNOfyGWhlsfxdZs0 YV0r8lqgxSFs3CuN/DcNsxJtM5jhQBecVj32z8E89t48ZgiK1VjWeBXS6DhbumSuCs1n TtEjbNnri9DdIAMrre7X27qUzS/k8suvQpVt3WYvzb6x99UL+WSoxeexJVtdGm7jVWvX Tv+A== 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 o17-v6si3164554ioe.228.2018.06.05.10.15.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Jun 2018 10:15:34 -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 1fQFVv-0007wQ-Vs; Tue, 05 Jun 2018 17:12:55 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1fQFVu-0007vj-AK for xen-devel@lists.xen.org; Tue, 05 Jun 2018 17:12:54 +0000 X-Inumbo-ID: 5e7d27a3-68e3-11e8-9728-bc764e045a96 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTP id 5e7d27a3-68e3-11e8-9728-bc764e045a96; Tue, 05 Jun 2018 19:10:38 +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 21EF11529; Tue, 5 Jun 2018 10:12:53 -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 37A653F25D; Tue, 5 Jun 2018 10:12:52 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org, xen-devel@lists.xen.org Date: Tue, 5 Jun 2018 18:12:33 +0100 Message-Id: <20180605171237.30601-4-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180605171237.30601-1-julien.grall@arm.com> References: <20180605171237.30601-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH 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 --- 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 Tue Jun 5 17:12:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 137787 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp1217199lji; Tue, 5 Jun 2018 10:15:35 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJa/rt/jHEp2ZVmWQIQg7VILBGzQebFEtv6GUqRUgJm6VNMQEUzrlwI9TUJ8nPpsBJkb/H4 X-Received: by 2002:a24:a104:: with SMTP id y4-v6mr92906ite.68.1528218935040; Tue, 05 Jun 2018 10:15:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528218935; cv=none; d=google.com; s=arc-20160816; b=KjKPNKMNHu8YlQNTojW6F/0a7TrcxcyJtHhin6FjA56CuZN9AqRFHgNAEPkrSEhyfe Ay4O35Gz5vRBjb+t8eidrWHGqsw0BU5zI1g6vQT815uNP/BnSlNIfWeJRhQX+86LGnJZ 3kC3ddQlYKT46o17AcIpfEJzEQLDlRyLcxIRM/IEpw9017/RrnEeL+N7UBXbQFJ0RdDv 71QqaV/aIZcwhGUj54+fDZQ12ERnXmBXshfWP5ctG7xlUuvcTUZD4+PvQx8x4DfFerFc sK/nw7WctZXYucY9+mVaTyIviFblXES2XfQlrX0xIQiWcNzmt9aahirlQcOkfjn70m3U pbMA== 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=H1SXsNzlmzfe+9Zwd/pAIgth+GDygNWfwg6EM//fjps=; b=kCAqQFfoxTBiYsIm5N2uTCh4JE7ELszc7HV8as/h1rx4fQ9UYJA1szuq60uzsAuVbo zOAZeGl0OxFTsTpv7RsO6Uhi24VIx+2Xcfc2IaRi8DanygqwVj9GILil9JGruhSzKfT9 7vlPpUbcGoFi/g/ESP0SPBUXQ6WNtemyN4h2PFpF/iGkPybxKfkvc+UvT6UkTjvJVDHZ EPUzUpQ+lv9fcWeIcOIuME+87JBFKsbWBtSc+MIDYpaj4Fb9MuavGyoiRFYgDI9A0jtm 5exS4cnINtQrIohZJTlDNk1zLSLANBg6ZSYumxe3p1yuEN/hWJXavjqqMZNuX6T9b9sU vESQ== 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 h184-v6si1966032itg.119.2018.06.05.10.15.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Jun 2018 10:15:35 -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 1fQFVx-0007xG-Eh; Tue, 05 Jun 2018 17:12:57 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1fQFVv-0007w7-Nw for xen-devel@lists.xen.org; Tue, 05 Jun 2018 17:12:55 +0000 X-Inumbo-ID: 5f17bf87-68e3-11e8-9728-bc764e045a96 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTP id 5f17bf87-68e3-11e8-9728-bc764e045a96; Tue, 05 Jun 2018 19:10:39 +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 4A5771596; Tue, 5 Jun 2018 10:12:54 -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 600F53F25D; Tue, 5 Jun 2018 10:12:53 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org, xen-devel@lists.xen.org Date: Tue, 5 Jun 2018 18:12:34 +0100 Message-Id: <20180605171237.30601-5-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180605171237.30601-1-julien.grall@arm.com> References: <20180605171237.30601-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH 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. --- 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 Tue Jun 5 17:12:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 137788 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp1217232lji; Tue, 5 Jun 2018 10:15:36 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJO7by8y9g4Rv7Fz9UBnqVmhFpjboozMus1KkFqp6nrsSJmWK+wUACoeUgV78nGrj/ae07q X-Received: by 2002:a24:8385:: with SMTP id d127-v6mr91211ite.58.1528218936349; Tue, 05 Jun 2018 10:15:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528218936; cv=none; d=google.com; s=arc-20160816; b=jpraVc9xa5DSXlSdP+Qa5Qqa9jm8hTmxdTfGOG9S5QevU8SyHZzuWbM7YSnsDM4LVH cpyEDrc4Yfh4lHDvRUA15kMQdFvdpVoGyqy9kgqVOcjd65X43wWEfCbFaCdzEpEAKFLU RxtWYyTBLBCk+0NGouNBSLkvnGWHN7KtoFzV++RzEFgG5ZObnIz3dVgbR/W50B/DsR5H 0Zw0pp5vlMgVl7fMxTtg0R8imT9CHRphJNwxTEKS+856G6PM3Gydfgufpe2mKnc76PZu PZrTaZn6/kvVrSNx55IejlMbgNsgfoMNLjg5/0IgsgZ97PtbfCKLAOq+4auBOB7J0qN+ 8taA== 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=DKL2fJgeFHtiIjf4aB+GVMkmtsrSflzMENWwMs8OTvY=; b=gM/NUKcY0wS1wwKyHfhKlsW6I79hwkbYEk5xs2J/CdmWwTean+A99UrL+wtOonNW9M cRBEUZ5OLiIKOUnU4YF8ZEZDQdakiUa+uLmYrF2zcZhFYYYa1wu1DMRDbCucOtXQz5jE piscl5tDGLnsR/8qDGbeTHAOJxnxTiGyfudhYdNeDDehtkOrxSz3XnzfMP3MdEH0Wo2S P8mEuV2LI1kegKBHlWCChUOsHA6YtBtarcexetqGGj1777eS639LEzGtPJVfOOnxTL9o M6NRNQzwNwGeBK7qCn9PNZDWTxiyLhF++vOoIBK8hCVZNYPlSHafdVyO6Ja/CDVO1vtc r3PQ== 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 q130-v6si1781380itb.91.2018.06.05.10.15.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Jun 2018 10:15:36 -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 1fQFW0-0007xx-7v; Tue, 05 Jun 2018 17:13:00 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1fQFVy-0007xW-1b for xen-devel@lists.xenproject.org; Tue, 05 Jun 2018 17:12:58 +0000 X-Inumbo-ID: 609436ea-68e3-11e8-9728-bc764e045a96 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTP id 609436ea-68e3-11e8-9728-bc764e045a96; Tue, 05 Jun 2018 19:10:42 +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 7A0481435; Tue, 5 Jun 2018 10:12:56 -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 8C8D23F25D; Tue, 5 Jun 2018 10:12:54 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org, xen-devel@lists.xen.org Date: Tue, 5 Jun 2018 18:12:35 +0100 Message-Id: <20180605171237.30601-6-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180605171237.30601-1-julien.grall@arm.com> References: <20180605171237.30601-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH 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 Reviewed-by: Stefano Stabellini --- 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..3d388133ef 100644 --- a/xen/arch/x86/Kconfig +++ b/xen/arch/x86/Kconfig @@ -12,6 +12,7 @@ config X86 select HAS_CPUFREQ select HAS_EHCI select HAS_EX_TABLE + select HAS_ELF select HAS_GDBSX select HAS_IOPORTS select HAS_KEXEC diff --git a/xen/common/Kconfig b/xen/common/Kconfig index 9043dce937..3cf551c736 100644 --- a/xen/common/Kconfig +++ b/xen/common/Kconfig @@ -17,6 +17,9 @@ config HAS_ALTERNATIVE config HAS_DEVICE_TREE bool +config HAS_ELF + bool + config HAS_EX_TABLE bool diff --git a/xen/common/Makefile b/xen/common/Makefile index 24d4752ccc..3cc808bd83 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_HAS_ELF) += libelf subdir-$(CONFIG_HAS_DEVICE_TREE) += libfdt From patchwork Tue Jun 5 17:12:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 137783 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp1217127lji; Tue, 5 Jun 2018 10:15:31 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ3BUw1Mb5CBE9rSD6oIQl5GdK2FFxYZDZlWtmrJkeJWz+emc8vj6BTJD9L5kOG4O0LspIw X-Received: by 2002:a24:714:: with SMTP id f20-v6mr83982itf.76.1528218931504; Tue, 05 Jun 2018 10:15:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528218931; cv=none; d=google.com; s=arc-20160816; b=mBFnoVy5x7uoJ5jfi0gdHTS6hB7jCGaZiefDDmy8vZDGnau7edKWtBsVlGxSyRHURB AVk4bNozDog9ubJkDDq9QuIev8RxFuJ//YygBKYw3LHehy7Y2AWgXkMVA1AnNzo0oLZC RFH3d3a1rjPFfwE1t8r1ZcRfw7xsnk7Q7Iv5x5SLBPxcjOS2RzxibwR/ODadsW/A2hHE rjc4X7ZtJZPXKaGJ8dbqWfxj3fA0wtJsQji+paPDEKIKVoRSaiaqcKRGQLzOz2eKu8rm 4fUf1WpLYh3iHZq/anKkWFaX26skzWzffQAyjJtQjMgtOUlNhY3j2MlgR0EmdnsrdDge MaAw== 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=lI3/F/V4MwTeHaqkYV0Fhyepj2Gz5Oq4uoWBRj/fIyg=; b=lsvjbIhZNv7BgUwlKGC8G922/VQtHq54T27eBb6+8fg9qzgpLYGXgR25o6YVscyNkR v7KuE7qxyjS95Y9lSZtA2TNZZAOceAmQDdaonYzITvCG9rcwD5eIgz1livyKdnSCfyLw Ok3LrjudmlYi+ZCikZeartvKTF8U8Dig5n3KVfucU3o66EAS76Eil2qoRnPtPHcnAVL5 tX+5pCudJ+3uMj/vPt+G8mcIGyHFYeZZNccX3MrRUBJwybm4kANTuP6rmd1nzxTkOv6x 4VzBcVHa0QA4+HaNBzbOVCaBOxGbohzyBpNxc55/x7kz7m6l7HAQZhDJimOMmtj7IJd3 rbmA== 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 d130-v6si10059637ioe.248.2018.06.05.10.15.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Jun 2018 10:15:31 -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 1fQFW2-0007ym-Lq; Tue, 05 Jun 2018 17:13:02 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1fQFW0-0007y3-DY for xen-devel@lists.xenproject.org; Tue, 05 Jun 2018 17:13:00 +0000 X-Inumbo-ID: 612f9577-68e3-11e8-9728-bc764e045a96 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTP id 612f9577-68e3-11e8-9728-bc764e045a96; Tue, 05 Jun 2018 19:10:43 +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 A230B1529; Tue, 5 Jun 2018 10:12:57 -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 B7D333F25D; Tue, 5 Jun 2018 10:12:56 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org, xen-devel@lists.xen.org Date: Tue, 5 Jun 2018 18:12:36 +0100 Message-Id: <20180605171237.30601-7-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180605171237.30601-1-julien.grall@arm.com> References: <20180605171237.30601-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH 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 --- 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 Tue Jun 5 17:12:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 137785 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp1217157lji; Tue, 5 Jun 2018 10:15:33 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKD313R2L5H/7zvyOwEm2A9pKcIteXvhNRUnlzcDcF8pnF08qxUnk9XKzUdRnwwO40Wn6UO X-Received: by 2002:a5e:c815:: with SMTP id y21-v6mr20120223iol.263.1528218933147; Tue, 05 Jun 2018 10:15:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528218933; cv=none; d=google.com; s=arc-20160816; b=oQEBqXhitEFJ7vZ2q+9cB71fJgIXJOOY27S8Fn5QSohxwYPamtzFRgygD16rvROp82 OwOsX59hJctx5FotUkAmp3+JhME2f5ou6xmOvJfEWfI+0eALOHSwAwZnJTVjKDyONMPZ nPInqYBlotqxBML8Fw80Rnu26+lW0VzDhsUsI2t/00avCA6NqiK4/FfGu1BZBa6n6xw/ 9JqzFe3YmEeZOTfo3YyzXjBFsGLggRAM6cEwgrBc6oSYO0b4wpJUZWqMAyHtW2IPjK3t WRqPw0ztjDV/AjIK+9uhzANSQTzbeio+cM4bojZ0I3j6jCQ4LF85alUOsm7N7eSPhMcT gbZg== 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=E6LYEVwIkYQlbwQHwgzPNH9qMJY/jU/Xs7w5AQqAY94=; b=dLlrEMvVge974RwR4IvnRJryLjaE//TaJ+RIY0D+lvGaJ0f0LK+ZIr/Ou+PeAa3sU5 lLdAavdrzrNhcdAeCZ3auA7NzaESperH+oE/JVJmykLRAHgcwoEFxqHXowpXXabU8zFK gt+viWDLIMq9Ax+Pe994BsAu2ko0CEzzQRkM0la0g6+03H75aIEGbkvcsa+klnRE2W1z T9H/k3n2WgQH0a0PUWTl4Ra2tXsB9kBSO+DF8iZQilHUzQsh2GB9U5DxtHQ9jQTnpSNI xy+hm4AAUEkVmfWtOr4r1Y17kfRRNOoVPqyyWTGIF96PSz/PeyPR3hp+sAUVwbSit30R 8uyg== 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 s4-v6si1988383ita.127.2018.06.05.10.15.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Jun 2018 10:15:33 -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 1fQFW1-0007yT-Kc; Tue, 05 Jun 2018 17:13:01 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1fQFW0-0007y1-9k for xen-devel@lists.xenproject.org; Tue, 05 Jun 2018 17:13:00 +0000 X-Inumbo-ID: 61f8340f-68e3-11e8-9728-bc764e045a96 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTP id 61f8340f-68e3-11e8-9728-bc764e045a96; Tue, 05 Jun 2018 19:10:44 +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 CA4581596; Tue, 5 Jun 2018 10:12:58 -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 DFE783F25D; Tue, 5 Jun 2018 10:12:57 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org, xen-devel@lists.xen.org Date: Tue, 5 Jun 2018 18:12:37 +0100 Message-Id: <20180605171237.30601-8-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180605171237.30601-1-julien.grall@arm.com> References: <20180605171237.30601-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH 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 --- 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;