From patchwork Fri Jan 16 16:20:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 43253 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 78E51240BA for ; Fri, 16 Jan 2015 16:23:08 +0000 (UTC) Received: by mail-lb0-f199.google.com with SMTP id b6sf5664676lbj.2 for ; Fri, 16 Jan 2015 08:23:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:cc:subject:precedence:list-id:list-unsubscribe:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:list-archive; bh=Vz7KX2g6BTfPYgfpfGCU691q4oSo2IL1TZufNaOlSmY=; b=MGH9XkKRFnKFVwqy5C4po74zTg9wDgEcijU42fuJEuqla/hgOiHc2NL7AxUKBaHQSi mmeFY79XiJ+GlmWWkdphzwrZMWHVUsF5+kul5BwDIwq1SRjtEfEPZr08yHyxn7L03cMP an+m5+PUKdZF0FhSWJCm1KtlPg3up+2Hwit/pPNu0yYztAgUUhkLHUAarKIQtkXGNfh6 SpUFHtDGEQ9Sm6I2I7+WJ0TiIwDcpDm3HVMaEaTsCJOwNsXKL5A3Geg5+/on8NVBSWxl MmtNgPgciU7oiw/n+/u7M/NKIfVrPsT6wZSe08sYx/qgo5fv9ME/HyudkESbGFXuXQO1 gicg== X-Gm-Message-State: ALoCoQktlwNvslrOOtNmTi7/6SKzB+h6lAdYq38X/HO0nw+Qhs/jsK6MLLeLnzpAfUpTJsm9a5P+ X-Received: by 10.112.118.18 with SMTP id ki18mr375488lbb.15.1421425387423; Fri, 16 Jan 2015 08:23:07 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.19.225 with SMTP id i1ls386852lae.19.gmail; Fri, 16 Jan 2015 08:23:07 -0800 (PST) X-Received: by 10.112.222.135 with SMTP id qm7mr16383197lbc.19.1421425387282; Fri, 16 Jan 2015 08:23:07 -0800 (PST) Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com. [209.85.217.175]) by mx.google.com with ESMTPS id ky7si4829491lac.52.2015.01.16.08.23.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 16 Jan 2015 08:23:07 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) client-ip=209.85.217.175; Received: by mail-lb0-f175.google.com with SMTP id z11so19337839lbi.6 for ; Fri, 16 Jan 2015 08:23:07 -0800 (PST) X-Received: by 10.152.87.12 with SMTP id t12mr16579208laz.31.1421425386787; Fri, 16 Jan 2015 08:23:06 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.9.200 with SMTP id c8csp361498lbb; Fri, 16 Jan 2015 08:23:05 -0800 (PST) X-Received: by 10.221.68.135 with SMTP id xy7mr7804989vcb.41.1421425383686; Fri, 16 Jan 2015 08:23:03 -0800 (PST) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id ro4si861740vcb.23.2015.01.16.08.23.02 (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 16 Jan 2015 08:23:03 -0800 (PST) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YC9eJ-00067M-P2; Fri, 16 Jan 2015 16:21:27 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YC9eI-00066E-F8 for xen-devel@lists.xenproject.org; Fri, 16 Jan 2015 16:21:26 +0000 Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id 81/7A-22819-58A39B45; Fri, 16 Jan 2015 16:21:25 +0000 X-Env-Sender: julien.grall@linaro.org X-Msg-Ref: server-10.tower-206.messagelabs.com!1421425283!13209695!1 X-Originating-IP: [74.125.82.48] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 6.12.5; banners=-,-,- X-VirusChecked: Checked Received: (qmail 1468 invoked from network); 16 Jan 2015 16:21:23 -0000 Received: from mail-wg0-f48.google.com (HELO mail-wg0-f48.google.com) (74.125.82.48) by server-10.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 16 Jan 2015 16:21:23 -0000 Received: by mail-wg0-f48.google.com with SMTP id l2so21421092wgh.7 for ; Fri, 16 Jan 2015 08:21:23 -0800 (PST) X-Received: by 10.180.108.232 with SMTP id hn8mr7704450wib.39.1421425282203; Fri, 16 Jan 2015 08:21:22 -0800 (PST) Received: from chilopoda.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id dc1sm3562564wib.18.2015.01.16.08.21.20 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 16 Jan 2015 08:21:21 -0800 (PST) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Fri, 16 Jan 2015 16:20:45 +0000 Message-Id: <1421425248-8727-4-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1421425248-8727-1-git-send-email-julien.grall@linaro.org> References: <1421425248-8727-1-git-send-email-julien.grall@linaro.org> Cc: stefano.stabellini@citrix.com, Julien Grall , tim@xen.org, ian.campbell@citrix.com Subject: [Xen-devel] [PATCH 3/6] xen/arm: kernel: Move kernel loading code in init section X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: The code to load the kernel is only used when Xen builds dom0. It happens during the boot. Signed-off-by: Julien Grall --- xen/arch/arm/kernel.c | 30 +++++++++++++++--------------- xen/arch/arm/kernel.h | 4 ++-- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/xen/arch/arm/kernel.c b/xen/arch/arm/kernel.c index 209c3dd..5b72c77 100644 --- a/xen/arch/arm/kernel.c +++ b/xen/arch/arm/kernel.c @@ -67,8 +67,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; @@ -121,7 +121,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; @@ -153,7 +153,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; @@ -200,8 +200,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 */ @@ -261,8 +261,8 @@ static int kernel_uimage_probe(struct kernel_info *info, /* * 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 { @@ -315,8 +315,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; @@ -364,7 +364,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 @@ -387,8 +387,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; @@ -439,7 +439,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; @@ -476,7 +476,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); } diff --git a/xen/arch/arm/kernel.h b/xen/arch/arm/kernel.h index 0050dfb..512b573 100644 --- a/xen/arch/arm/kernel.h +++ b/xen/arch/arm/kernel.h @@ -56,7 +56,7 @@ struct kernel_info { * ->type * ->load hook, and sets loader specific variables ->{zimage,elf} */ -int kernel_probe(struct kernel_info *info); +int __init kernel_probe(struct kernel_info *info); /* * Loads the kernel into guest RAM. @@ -70,7 +70,7 @@ int kernel_probe(struct kernel_info *info); * ->dtb_paddr * ->initrd_paddr */ -void kernel_load(struct kernel_info *info); +void __init kernel_load(struct kernel_info *info); #endif /* #ifdef __ARCH_ARM_KERNEL_H__ */