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); }