From patchwork Wed Mar 30 13:18:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 64702 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp2593348lbc; Wed, 30 Mar 2016 06:20:55 -0700 (PDT) X-Received: by 10.66.101.35 with SMTP id fd3mr12986720pab.7.1459344052304; Wed, 30 Mar 2016 06:20:52 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id uk9si6488907pac.166.2016.03.30.06.20.51 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Mar 2016 06:20:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1alG2A-0006gX-Jh; Wed, 30 Mar 2016 13:19:42 +0000 Received: from mail-wm0-x22b.google.com ([2a00:1450:400c:c09::22b]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1alG1l-0006WP-DX for linux-arm-kernel@lists.infradead.org; Wed, 30 Mar 2016 13:19:19 +0000 Received: by mail-wm0-x22b.google.com with SMTP id 191so89472670wmq.0 for ; Wed, 30 Mar 2016 06:18:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ttgSTgocz0Bd2vfaCMnOo0DywbMvX3dZIWZqgXcW9JY=; b=O9Og4TRbwSGYmBE+xhtlNo+3boaYqX8mEBMld/ic0N3kH09TbS+Rs+qaC889nALa/b aEIi9gbvygRf/CddsqWyXffBcK7fTnPuh6BtIoAEtLRWePu82zvJyTK/GS6lQBOqxEXX ZpHPIhTMn9DpuJQbSfLa9+SR//n/N1iVi1ZMU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ttgSTgocz0Bd2vfaCMnOo0DywbMvX3dZIWZqgXcW9JY=; b=JztXj8g0+VuNf7HxsGyvYB3oh4fxuEbrg7YXmIB0SAObjcbDffQcGNTB2Jckpl6wpQ X6UEgxOSkSvcJvasDjxJCYnbHOSmYJx17jZbIHq/haxDdQt0AtxKWU20BHhcRxlTPFnT PcLwDNN4qPQ296X6x5D6drDV71oIdUjSe1TrlQMIim3y2wDhAYtJrPx5p34t6+rjPgay 0Hp9wsUNh9DswSIVK6FdTH33a3zuZhrKmOOT/5nI4pNyboXHE15xA+Gf1Fo740EsAcd4 pHtrJXcTAfJ+XdTb+IA9xxFLhUsckhnzDjb+j2zf4GzLDeSli1tGK/4PxpNRCAYxjT2L n7VQ== X-Gm-Message-State: AD7BkJIeXa9iSSI0NuATR6YabgMM8WUGiLHnrwSD/XKJKBsZYNBqyNYzV3TAcjpx01SNXvup X-Received: by 10.28.141.141 with SMTP id p135mr22646868wmd.8.1459343935762; Wed, 30 Mar 2016 06:18:55 -0700 (PDT) Received: from localhost.localdomain ([195.55.142.58]) by smtp.gmail.com with ESMTPSA id js8sm3913786wjc.37.2016.03.30.06.18.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 30 Mar 2016 06:18:54 -0700 (PDT) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, will.deacon@arm.com, mark.rutland@arm.com Subject: [PATCH 2/2] arm64: remove the now unneeded relocate_initrd() Date: Wed, 30 Mar 2016 15:18:43 +0200 Message-Id: <1459343923-16283-3-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1459343923-16283-1-git-send-email-ard.biesheuvel@linaro.org> References: <1459343923-16283-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160330_061917_782204_FFBC5737 X-CRM114-Status: GOOD ( 14.25 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:400c:c09:0:0:0:22b listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ard Biesheuvel , mlangsdo@redhat.com, jeremy.linton@arm.com, msalter@redhat.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org This removes the relocate_initrd() implementation and invocation, which are no longer needed now that the placement of the initrd is guaranteed to be covered by the linear mapping. Signed-off-by: Ard Biesheuvel --- arch/arm64/kernel/setup.c | 64 -------------------- 1 file changed, 64 deletions(-) -- 2.5.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c index 9dc67769b6a4..7b85b1d6a6fb 100644 --- a/arch/arm64/kernel/setup.c +++ b/arch/arm64/kernel/setup.c @@ -224,69 +224,6 @@ static void __init request_standard_resources(void) } } -#ifdef CONFIG_BLK_DEV_INITRD -/* - * Relocate initrd if it is not completely within the linear mapping. - * This would be the case if mem= cuts out all or part of it. - */ -static void __init relocate_initrd(void) -{ - phys_addr_t orig_start = __virt_to_phys(initrd_start); - phys_addr_t orig_end = __virt_to_phys(initrd_end); - phys_addr_t ram_end = memblock_end_of_DRAM(); - phys_addr_t new_start; - unsigned long size, to_free = 0; - void *dest; - - if (orig_end <= ram_end) - return; - - /* - * Any of the original initrd which overlaps the linear map should - * be freed after relocating. - */ - if (orig_start < ram_end) - to_free = ram_end - orig_start; - - size = orig_end - orig_start; - if (!size) - return; - - /* initrd needs to be relocated completely inside linear mapping */ - new_start = memblock_find_in_range(0, PFN_PHYS(max_pfn), - size, PAGE_SIZE); - if (!new_start) - panic("Cannot relocate initrd of size %ld\n", size); - memblock_reserve(new_start, size); - - initrd_start = __phys_to_virt(new_start); - initrd_end = initrd_start + size; - - pr_info("Moving initrd from [%llx-%llx] to [%llx-%llx]\n", - orig_start, orig_start + size - 1, - new_start, new_start + size - 1); - - dest = (void *)initrd_start; - - if (to_free) { - memcpy(dest, (void *)__phys_to_virt(orig_start), to_free); - dest += to_free; - } - - copy_from_early_mem(dest, orig_start + to_free, size - to_free); - - if (to_free) { - pr_info("Freeing original RAMDISK from [%llx-%llx]\n", - orig_start, orig_start + to_free - 1); - memblock_free(orig_start, to_free); - } -} -#else -static inline void __init relocate_initrd(void) -{ -} -#endif - u64 __cpu_logical_map[NR_CPUS] = { [0 ... NR_CPUS-1] = INVALID_HWID }; void __init setup_arch(char **cmdline_p) @@ -327,7 +264,6 @@ void __init setup_arch(char **cmdline_p) acpi_boot_table_init(); paging_init(); - relocate_initrd(); kasan_init();