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=-4.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 1E951C433E7 for ; Sun, 11 Oct 2020 16:41:32 +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 B9B7221655 for ; Sun, 11 Oct 2020 16:41:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="zzR8vZ5l"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="mK/uh70j" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B9B7221655 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:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=O8OviHJED6oLfwF9itpr95u4Ob9OTJv2qxOIhaS3SqY=; b=zzR8vZ5lqqNbbXKD5SJ8tdbVT N//ZYlWUe8jf9NPPm+rbea956fH4cJPOb7LDjd8SGkdD9bP9XFVZpO9+6mCWvZyiRCjJZ9fDZ/m4/ 6i2VnfZl3ODZAYZG0TN29ZrlimXNJLQQJtAO4D2yG91kgzrKH544kbicXKEcHaNdlMuwltgJ9hePO RpMLn4IutckPCWQOKu+Sbop9ff8+UP3mm+i7+VsG8Eyc9IAofuuyEUq4g99ag8d921N5iCr4vMDgq DAMaBzDhXFH/sdCIL9dSWSOA1D1YgwA85tXxmPNfkSPSHmFx4+fBC2IyVWXmxpklCOZrAMn6qd7Hq bco2t0VHA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kReNy-0006Kb-6A; Sun, 11 Oct 2020 16:39:50 +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 1kReNw-0006KI-3D for linux-arm-kernel@lists.infradead.org; Sun, 11 Oct 2020 16:39:49 +0000 Received: from mail-oi1-f175.google.com (mail-oi1-f175.google.com [209.85.167.175]) (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 54E5C22246 for ; Sun, 11 Oct 2020 16:39:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602434386; bh=dmZp5NM0w8LyPWqy4U5TQM0+Bhugq8Z2j50rZZaw+uQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=mK/uh70jwI9ySvDtvKIP8/OAVL9iN+/AHT5UZJmmP5XHfgpAQP8h5nHjrrSUidL8M LsuYXBpdz/La3VlHisiVY5liFAfwPuJa+U7D5Q4//HqJDei+mDw6XxyN0TZEPyhoNv XeefZIvz7cNbarlVX1wZXnwYOifQiJdYO/nrNCpY= Received: by mail-oi1-f175.google.com with SMTP id m7so16185815oie.0 for ; Sun, 11 Oct 2020 09:39:46 -0700 (PDT) X-Gm-Message-State: AOAM533SKXIldYcoF78WHapq9ffTRxcVdVEUusNzCUKHxh1xR3H2oRXB BBmz7SO9lrxHaRo7lmzIH0vNSwjty60mp+tTj/A= X-Google-Smtp-Source: ABdhPJw4WLEJCSEFQH5L+xmgILqQnKU4IxB7mfTjCGXHMD2ILvJ8yXXSUzK3RpP8r0W4mX7EaNzkHRfPvBw5a/s+jHA= X-Received: by 2002:aca:d64f:: with SMTP id n76mr8961851oig.174.1602434385664; Sun, 11 Oct 2020 09:39:45 -0700 (PDT) MIME-Version: 1.0 References: <20201007083944.27910-1-ardb@kernel.org> In-Reply-To: <20201007083944.27910-1-ardb@kernel.org> From: Ard Biesheuvel Date: Sun, 11 Oct 2020 18:39:34 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 0/2] ARM: move FDT mapping out of linear region To: Linux ARM X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201011_123948_330830_14822681 X-CRM114-Status: GOOD ( 30.78 ) 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: Linus Walleij , Florian Fainelli , Russell King , Rob Herring , Nicolas Pitre 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 On Wed, 7 Oct 2020 at 10:39, Ard Biesheuvel wrote: > > 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. > > Changes since v1: > - bump the start of the fixmap region by 512 KB so we still have a full > guard region even on LPAE builds, which will use the entire 4 MB window > for the read-only mapping of the DT > - update Documentation/arm/memory.rst accordingly > - add Linus's ack > > 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 > I've dropped these into Russell's patch tracker. Thanks all, > Documentation/arm/memory.rst | 7 ++++++- > arch/arm/include/asm/fixmap.h | 2 +- > 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 ++-- > 12 files changed, 54 insertions(+), 29 deletions(-) > > -- > 2.17.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel