From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0748C4727F for ; Tue, 6 Oct 2020 09:51:02 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3E21120639 for ; Tue, 6 Oct 2020 09:51:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="qurwDYPu"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="k9MiqzZ6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3E21120639 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Owner; bh=lVBpk5u+ZtcipE8JFW7VtS3qnw9+HPH0ezvpUlUbO58=; b=qurwDYPuKbGIG9+wzPKKEPPqMs cPioo1cGy9LnLCiCDwd8gfmU4Hd06dS6wYqm/TBc9H8icv08Uo6tXD+WLZgYtQmXTyaiMiozfWBRX AFwKp+/QEOB+EMBL9n5t0JqZzX1ONEtkV3V0RTjxxv1O6UM2adLkvPtGq8zKcWfwR/jqniuowCtvd kRdmG5hfuIn+UUJfllyQOZmBzBheadhU6sK5P+c/2JpE91uOARDxGxNS7qHSsJyxYLptWus8vLjte ug6yGpnf5qrI+W9U2sSqvmRurOMViB4kFXsrW5xHSXVjfR0Hl+qa1ITGCT7hzlXSnIqcNqLKlPDvy nh/NI28w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kPjb6-0000Rl-Ti; Tue, 06 Oct 2020 09:49:29 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kPjb3-0000R7-IV for linux-arm-kernel@lists.infradead.org; Tue, 06 Oct 2020 09:49:26 +0000 Received: from e123331-lin.nice.arm.com (lfbn-nic-1-188-42.w2-15.abo.wanadoo.fr [2.15.37.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2141120639; Tue, 6 Oct 2020 09:49:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601977764; bh=ehEEMjCELVT2ceF9Jkvk8P/Iyeru942Dra3ZeJfqjJY=; h=From:To:Cc:Subject:Date:From; b=k9MiqzZ6gNBD7r9VwE7Pq6P35/bWlTnJVzToV8dtOBxDTA7ppzxUqPAEgh6yo9sM0 sMJcHfv7ArRMGn0SVCF3vjBohWjZumjkjHuXRGybqdKw8YJlZnSu30B1AxEVD3+BcX xQ73lQGijKeWFYlgaPL2SU1Dm/331tfpXUqfRHTw= From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 0/2] ARM: move FDT mapping out of linear region Date: Tue, 6 Oct 2020 11:49:16 +0200 Message-Id: <20201006094918.9819-1-ardb@kernel.org> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201006_054925_884831_AE34EF06 X-CRM114-Status: GOOD ( 19.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Florian Fainelli , Nicolas Pitre , Linus Walleij , Russell King , Rob Herring , Ard Biesheuvel MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org For the ARM kernel, setting up the kernel's virtual address space at boot is tricky, given the risk of collision between 1:1 mapped regions and virtually remapped regions. There is also a concern regarding the exact mapping attributes that are needed for each region, which differs between ARM architecture revisions, UP vs SMP etc For this reason, the kernel VA space is set up in two stages: at early boot, only the kernel itself and the DT are mapped using section mappings and later on, all existing mappings are torn down except the one covering the first memblock covering the kernel, and remapped again using the full fledged mapping routines that can map at page granularity and use all the right mapping attributes. There are cases where this may result in the DT getting unmapped at this point, and not remapped again. For instance, if the first memblock is not PMD aligned, we will align it up, and mark the memory below it as MEMBLOCK_NOMAP, to avoid having to allocate page tables to create the mapping before we have a mapped memblock to allocate from. If the DT happens to reside in this region, it will not be mapped at all when the permanent kernel VA mappings are in place, resulting in crashes. As we happen to have a 4 MB hole in the kernel VA space (between the end of the VMALLOC space and the start of the FIXMAP region), let's use it to create a permanent, read-only mapping of the DT that is not affected by any such issues. Cc: Linus Walleij Cc: Florian Fainelli Cc: Russell King Cc: Nicolas Pitre Cc: Rob Herring Ard Biesheuvel (2): ARM: centralize phys-to-virt conversion of DT/ATAGS address ARM: move device tree mapping out of linear region arch/arm/include/asm/memory.h | 5 +++++ arch/arm/include/asm/prom.h | 4 ++-- arch/arm/kernel/atags.h | 4 ++-- arch/arm/kernel/atags_parse.c | 6 +++--- arch/arm/kernel/devtree.c | 6 +++--- arch/arm/kernel/head.S | 5 ++--- arch/arm/kernel/setup.c | 19 ++++++++++++++----- arch/arm/mm/init.c | 1 - arch/arm/mm/mmu.c | 20 ++++++++++++++------ arch/arm/mm/pv-fixup-asm.S | 4 ++-- 10 files changed, 47 insertions(+), 27 deletions(-) -- 2.17.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel