From patchwork Mon Dec 10 16:29:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 153293 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp3750898ljp; Mon, 10 Dec 2018 08:30:16 -0800 (PST) X-Google-Smtp-Source: AFSGD/Xi1HIHXwZZRmdLYwFmkarfRJ9mjdQtVAFiOuiT8w/oHZOuX6Da0J0ScTcGbUZtM1Hgkh0H X-Received: by 2002:a17:902:b090:: with SMTP id p16mr12696589plr.190.1544459415907; Mon, 10 Dec 2018 08:30:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544459415; cv=none; d=google.com; s=arc-20160816; b=Yy6heGlopH1Q6BrdPw09YRxyFWd1rU9pc0Rcu0uiIQON2vZl8Vu/phxA7Z4yqFFLjG 4jhJrJXJoJBYqNVUFmuzqD0sCKZKEaIqTSRot3L1fo6CkDF6IlxnOVy6yvLEnLcKIjIR QLAXLbk1kkb31CcbYExarNzTXRMa5A+xjZraqDnD/MqjxNELD3RhFvoiR5oxGuRZTi4+ V2p+HWW+sfecD+zMBBp2odYpW89oicLUrQKnaf4gSLPKX7lDjoXPsREEl2l6j2T6TMac DQtbgOnhni/7tVYvQlAsgt4wBUlsq4VWTlX4lTBOhoKs6Aam/4banFV4eRT4lrzDEiR0 BtQg== 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=X+JtbB5kahpWRryGJEfPt2WL8lWHxPrmd07Wiq4JNWY=; b=LOBcYVsWh3CSUUT58P0xd24qZKxU5hjwx4boi/FSx3FXs7cjYlQk5ZqKa9pHDSiB6c Iv4hR3SMoJyAjCiMKXOuxtB85fVhAbtYSG7tx37RQRYbd7RptQUwiCALQSa7rx/6fIoe UvpbmWGwMANnj3YQOKkqBOuHWzQpxgjl9ij6m+oVe6GcmW+yOEH2pfVMYLQRd74bF6UK yaQx1FgWPzzcmCupdNpSUfk+IznKwB/s8QEc1TDbmz9V5NecoDQB5NeJQm8pBgWPr0a4 xNaAsR6OzCCLlRSzDYvP5UOFOQ/09M+bjU21u4y4N05zN8im3rlNA4gPvNohc8KQ5wih ETDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=S7fxYO4I; 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 b12si10433973pls.32.2018.12.10.08.30.15; Mon, 10 Dec 2018 08:30:15 -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=S7fxYO4I; 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 S1728351AbeLJQaP (ORCPT + 3 others); Mon, 10 Dec 2018 11:30:15 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:33620 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728350AbeLJQaP (ORCPT ); Mon, 10 Dec 2018 11:30:15 -0500 Received: by mail-wm1-f67.google.com with SMTP id r24so7012696wmh.0 for ; Mon, 10 Dec 2018 08:30:14 -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=X+JtbB5kahpWRryGJEfPt2WL8lWHxPrmd07Wiq4JNWY=; b=S7fxYO4I95AqKMJRglYTKwog5gT5deCDNaP3im9wvXzVYzx+jtwBSZ0o6fRxB7Jmc+ eB15AL+QD2DnvrJdsPhDUVsCsnLhI5DE4DzhTDAJYqJjL5gmbo36NvBBsDp2vt8MyP94 9HCPomB4VXkwH2Mey1GG7N+MBms4p+uehZIWY= 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=X+JtbB5kahpWRryGJEfPt2WL8lWHxPrmd07Wiq4JNWY=; b=PDbTKDAcuReitBAIAf0ZJ2iMC4uHylKt1Md2WPxCCj/tcR7siox1BRViy17JpR6QX+ ZcKqIAV+1DKKRB4sSoxYmXhgt/egfQlAlNYDr6QrKPRQQWrmsaRSZpE9z3PIp/BxfWjc MPfFPQmqz5M8T+kExbPdpEuL6HesCQy9Ur+JfmHxpOerZGBcMDq2aafMC3/RnC9GdSgw DfKmWp19ksHA1rx4l45Or1FTLh67l4bx3SysoBUf08dqOiomxGr1rgYpenDrhq4kfycq 8Y2mOufbTlmjB9lt6LE9amQkMa10fEIgSsy+BiN21PJB9ypYqViCBcHvoNQgwCbEZNM3 09Iw== X-Gm-Message-State: AA+aEWbt3bwYZ0YITRhEH8uAVSlt6p3Qiiy36vXhRbpKdXgTfJSzYErw g+uY1aKF4NH2x4QFJ2obdHmoxQ== X-Received: by 2002:a1c:90d5:: with SMTP id s204mr11215222wmd.148.1544459413490; Mon, 10 Dec 2018 08:30:13 -0800 (PST) Received: from localhost.localdomain (astlambert-681-1-52-199.w90-86.abo.wanadoo.fr. [90.86.17.199]) by smtp.gmail.com with ESMTPSA id i186sm3480531wmd.19.2018.12.10.08.30.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Dec 2018 08:30:12 -0800 (PST) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org Cc: linux-efi@vger.kernel.org, Ard Biesheuvel , Russell King , Marc Zyngier Subject: [PATCH 2/4] ARM: mm: permit early_memremap() to be used in paging_init() Date: Mon, 10 Dec 2018 17:29:47 +0100 Message-Id: <20181210162949.8597-3-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181210162949.8597-1-ard.biesheuvel@linaro.org> References: <20181210162949.8597-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.2 diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index 375b13f7e780..7e2a936a5ed0 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c @@ -1124,8 +1124,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();