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: 8696241 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B78C29F44D for ; Wed, 30 Mar 2016 13:21:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CCD3020374 for ; Wed, 30 Mar 2016 13:21:20 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 030DE20379 for ; Wed, 30 Mar 2016 13:21:20 +0000 (UTC) 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-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+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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();