From patchwork Wed Nov 7 14:16:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 150393 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp5221046ljp; Wed, 7 Nov 2018 06:16:29 -0800 (PST) X-Google-Smtp-Source: AJdET5ebb01wYdplvKGr51qqEpD/dQOl0nAiwCRN9QoCwPWgMd8wqz6rWpsx5Ys7VTSnUXOAiDP/ X-Received: by 2002:a63:495b:: with SMTP id y27mr345248pgk.32.1541600189485; Wed, 07 Nov 2018 06:16:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541600189; cv=none; d=google.com; s=arc-20160816; b=spGfMBv+B+Ch5U+/p9/awVVxiFjLtEPMc8H/+JmqAC9dQZ0aBbNpodb8l5Zuuz0nDF mOM+IBox9etsPmskGWV8w3lV8WmBwuCWGzueu7sqhggQJFmPqoJCIQSroNolJZ0luMdX RE25dFF/onYuqXCLCye8mWCKqhHirSrzmc53mzVMFlgcI25Bt1XwW3oi2JYNtcFFlxnv iIZRU81dFz3q7y5A/AM+ZbK3igeK8SLFHW4EvDT5ccwu0pSkabjzJby4Ak7xJc6Er/GG uUJgpRePsWTnUnhIvgFUV3D6JCnRD9yqVAZCkHZr5FwmlaiNC/frspwKtDOGK7wfnrDq DR6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=gqMRihPHK965nddLZ6a9LJLXSPUIfcMqa5LZd74Yi+o=; b=qmtVgviVWyrECQc+mOL/zgflVwhiIi+d5wMm6nKkZ/fccQOsDqFz6qGJ3Wld/mQzzE 5LUbbJbroByVIW6sgiVhKUwzPXZKkOCtXNUFp9tG+x4eJ7WRq4SaKly5VWl9LgMDgohm lGvXS8Xqv47FUgII0FaYGHjadyZDGF/PMIyko3TY+82/q7VTH8bWfIvQ9fv+wO5n+GuJ 4KaWggtVmcTstdDDdEWEn+V2LV1sdsuluTi7mlSpJ7xo70kJi6MEpfnUWPfwKqLTV2wB DDMr1uNZtVPVpERhxQHZcAcBP4aidRAZwOEf9e1qOdoie7VGgDYvjDGKPySlacOyzM2S HpOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=f6mwQuDr; spf=pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-efi-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r3-v6si703022pgn.313.2018.11.07.06.16.28; Wed, 07 Nov 2018 06:16:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=f6mwQuDr; spf=pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-efi-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727613AbeKGXrB (ORCPT + 3 others); Wed, 7 Nov 2018 18:47:01 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:35944 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726825AbeKGXrB (ORCPT ); Wed, 7 Nov 2018 18:47:01 -0500 Received: by mail-wm1-f66.google.com with SMTP id a8-v6so15852355wmf.1 for ; Wed, 07 Nov 2018 06:16:27 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=gqMRihPHK965nddLZ6a9LJLXSPUIfcMqa5LZd74Yi+o=; b=f6mwQuDrhw76aHoxcdRQKpNTPIxa3gMSlsX+Ub+r1utkY3AwJhFbRvwRwIT9d+hl6e DN5OlkzKiXRM2IxKt4AROPuXo+9b84ztcHAUXNA9o9iQ66Qhp4JA8sr1vewGvISJdAmh g0shBJqfZbVafUgiUM4g7PkbvKt3EdxjcTbzU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gqMRihPHK965nddLZ6a9LJLXSPUIfcMqa5LZd74Yi+o=; b=dL7B+mOggBgmjfZTw2wyaQba1gr5gitWNI3o57Jhm3Hoc8ah+pmTsGkQFUAPtKlUuL 87DaKEVymJN9ikPhbBQwhQ+IL9yqt+mj3scslnfygEb9hfnhAiZvbAdPXly7gmpAQTkP nRiws3b1yD3cRGpc8J084pUZPyYGI8B/tiCu1YeHcjdcR7Ff2O3heJea5612LgWhMU+V LBCUsLRl7FetaorQQLUFLF6te7JeiGkkzBO1YG/KXSx4WaxMnNDt9Qt7fW0Xyy/8FLJ4 k4oHg5XPph522vopLtF8vzGyhykpCEE7nO7PzdziOVgNrGajOOiA5mL5oBF0aFO/2Qcp /wRQ== X-Gm-Message-State: AGRZ1gIFS9lkKSfR7WVyOc9phn610GJ3632v4f/j7LR/WeXU5aD0hGwo rNExA9eN31lbUkLM3fQ0n0M+2w== X-Received: by 2002:a1c:9947:: with SMTP id b68-v6mr355156wme.22.1541600186903; Wed, 07 Nov 2018 06:16:26 -0800 (PST) Received: from localhost.localdomain (laubervilliers-657-1-83-120.w92-154.abo.wanadoo.fr. [92.154.90.120]) by smtp.gmail.com with ESMTPSA id q2sm948447wrx.77.2018.11.07.06.16.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Nov 2018 06:16:25 -0800 (PST) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, linux@armlinux.org.uk Cc: marc.zyngier@arm.com, will.deacon@arm.com, bhsharma@redhat.com, linux-efi@vger.kernel.org, Ard Biesheuvel Subject: [PATCH v2 3/6] ARM: mm: permit early_memremap() to be used in paging_init() Date: Wed, 7 Nov 2018 15:16:08 +0100 Message-Id: <20181107141611.12076-4-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181107141611.12076-1-ard.biesheuvel@linaro.org> References: <20181107141611.12076-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Sender: linux-efi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org early_memremap() and early_ioremap() rely on early fixmap support, which shares its virtual address space with kmap(), and so it is taken down in paging_init(). In order to permit the EFI persistent memory reservation code to use early_memremap() when called from paging_init(), move the call to early_ioremap_reset() into paging_init(), right before the call to early_fixmap_shutdown(), creating a window where we can add the call to efi_apply_persistent_mem_reservations() in a subsequent patch. Signed-off-by: Ard Biesheuvel --- arch/arm/kernel/setup.c | 2 -- arch/arm/mm/mmu.c | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) -- 2.19.1 diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index ac7e08886863..2f85cce38333 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c @@ -1114,8 +1114,6 @@ void __init setup_arch(char **cmdline_p) /* Memory may have been removed so recalculate the bounds. */ adjust_lowmem_bounds(); - early_ioremap_reset(); - paging_init(mdesc); request_standard_resources(mdesc); diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index f6bf6686559d..078f82f89fe5 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -1628,6 +1629,7 @@ void __init paging_init(const struct machine_desc *mdesc) memblock_set_current_limit(arm_lowmem_limit); memblock_allow_resize(); dma_contiguous_remap(); + early_ioremap_reset(); early_fixmap_shutdown(); devicemaps_init(mdesc); kmap_init();