Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp239248ybh; Sat, 18 Jul 2020 02:26:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjfxJQkSy1ZNyucMeEuOfw+zfYStyEUMgwprk8NpwtQuMVfcO0pd9ZFfj/D/4kWl/fgjVU X-Received: by 2002:a17:907:4240:: with SMTP id oi24mr12087993ejb.23.1595064362493; Sat, 18 Jul 2020 02:26:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595064362; cv=none; d=google.com; s=arc-20160816; b=qVKI+Sek4LDdN908OG09/uKFD+moDQrd6EDFmcMOY8NqImrIEOW/O+9tz9hIkQCqn4 LpI2UvQJBBxBh/3R7lwMp1CPuD0Rgobwq86nXwAWB15+Q94vurZOebpZbhpvqLLPw2cS YDdEB0rYrJFT7Teg1SJIEpPt2PmUIaft2boOL8LPDUSgSNFhvdkRGic/bcf4mszkaUef kkIZniLq3L+yC9nlaIVWaYl5CYB1FXtOrtV1uh1Jvj2taTWwzPX6HZZlPirxzqM79Emj WBJUcXE0HH5/4ufJK+t2dVaVTyXA+WUyiK64iIcwzRSrnPZl6HaYbCF7UIJ5JbfgAqae Qojw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=teJHUtqWZ4VD6xCiLNiMV7t/BSL1JH2wOVlEb8gP9qQ=; b=zcIirOmM/iGFc0HEabo7q437KDwjFYz8BEK+U3A7dOlzM/apzC2g7JdoTGqXW5iita vHlnCrs55azxcE0yHEyc/gqEWc04Ux4C+plnewth87EtSuTvUzoUGFwZ6lQK1GebqK4d ieMgHsHORNv4Anb68jVTfyNm5xpMMvOGIKLUPNDC6l7ylF00JZ2SwUIqwYPVa8C7jYzA ubfMPQ9EJj7cqJUsfNnr8d/nR6OX+9hW0UX76kOYvMG26zaoLUgs2FemkqSx4t5eyxdY IUixQq6cp0UtO8/stwyZHssZttpMEELN0EPfj7HzP4FNFReC/IppsgzZx2qxr6oPRSM4 LV2Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j9si7426033edn.453.2020.07.18.02.25.40; Sat, 18 Jul 2020 02:26:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726608AbgGRJZA (ORCPT + 99 others); Sat, 18 Jul 2020 05:25:00 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:50981 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726593AbgGRJY6 (ORCPT ); Sat, 18 Jul 2020 05:24:58 -0400 Received: from mail-qv1-f51.google.com ([209.85.219.51]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.145]) with ESMTPSA (Nemesis) id 1M27ep-1jzBvV1Fv7-002XoW; Sat, 18 Jul 2020 11:24:56 +0200 Received: by mail-qv1-f51.google.com with SMTP id u8so5297215qvj.12; Sat, 18 Jul 2020 02:24:56 -0700 (PDT) X-Gm-Message-State: AOAM5338zgOwqjhuChmHv5e8nSndXd38BMteQ6ZKk+ofITwvGGx8xXDu 7gIPzRujBH6UqhMPsYZNWJPXJoR38S6MbZ754zM= X-Received: by 2002:a05:6214:1926:: with SMTP id es6mr12756912qvb.222.1595064295108; Sat, 18 Jul 2020 02:24:55 -0700 (PDT) MIME-Version: 1.0 References: <20200716234104.29049-1-atish.patra@wdc.com> <20200716234104.29049-2-atish.patra@wdc.com> In-Reply-To: From: Arnd Bergmann Date: Sat, 18 Jul 2020 11:24:39 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFT PATCH v3 1/9] RISC-V: Move DT mapping outof fixmap To: Atish Patra Cc: Atish Patra , "linux-kernel@vger.kernel.org" , Anup Patel , Ard Biesheuvel , Greentime Hu , Kees Cook , linux-efi , linux-riscv , Mark Rutland , Masahiro Yamada , Mike Rapoport , Palmer Dabbelt , Paul Walmsley , Will Deacon , Zong Li , Heinrich Schuchardt , Linux ARM Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:KADLZTHQdOktTZ7ae+BKf6faC9Hw0ZpX2Zv7GoiPakobjVhmtsX 3JtolcAGSNKnzcaodszIfBkNX5TE1six4IEDfXIaGP7wpII2ovxejI1g3ZruYyWn/aqoiAk EyrLDBmMds5Q8Xy77wk6zJJOiUigt8hYxOHv8k/l0+qqSbX9hVStLPHtihRyXcpAWthez1p 5nErNmU/9dXE2GDlHJgFg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:+KnC1dKiC7g=:+bz2AX1+KtSlevAQMgK8jU xHI0DyeiZEIxVUev/MX2WEP2dbArtVwjolw+Ob8r0C23fb30XnbDqQRCwGkKF9SG+HGG2/cXM q3F8jKg5BA37j6ePfHrV0/Xd1YWauG4PT8bxBKcQS2mvsChFsSHn/Wem4ABsbSCEFYNqpVb7z yPsghXK6fvlfPj5kzYrmMb7JgIRFL/Ho0WGA8xyeSDPedTUixrq8zLtawL6J3lpBfX/cb0qGe AcVfP0sfsvWoOSJv4EcMd8WRO10zF5clrReWa7rr++VvDl84YG6RNzGK82lUfpr7EggHMN8lg 8jpKT2QiSw0uENfakqE+wJEicaPpDP8cAcPPEss6ka0uSpMEANXa4dr5kvL/jpay/2ul8PMNA 5dW3uUoZEumsMI5Uy06dnEw03o8nmUQMolrv01+yW0+DasqlzXvc3RAWeDtL/j/rGr4bsVVys tDFCJF3+UnA8NeKjR9QNHHACgHwQBlp0UXpQMiCfON1MOtWOf0+NNkR5kBNmHDjO5S5gBQVtI ZmK04Bf14xFQx56NRU4hzA+Vr6c4uri36Hf9P9V9xmrIaqpsM4pWIEP28ooQ426HfT27J9RU9 4Mbr1z2VnLkMO/EEDA6zX/4jKcA0GwwlU19+EuQtxCK3tWr1PiN0oZ9fCsS9qeyejswn/dL62 yjm2ToODkFM9QdSstCWA76rcvXmMI6+DoAxaYelb9QZsvfv8yjkxiPj2Ye78XLxHW0Mh9nfOI lCyvLv3jUBJSDpXb9zNpq1En8BiZ6dEuZb0x1+ZrNWln4SKlARsNQhsxXU8uT8/XigmE8t4VI Jyeoh7dAKpfFXPlFEIwtRCN+9EEQ4/PSxCC3hRr6KoyxwmPSnRfuq5ShAumXuiJFPqIV0QjkS 3/2X5q+8ZWIzMG/IEziFfFrZpY5yw2bJ95+7XgzHo2yENRUZ0LFF96BxCgg/EiYWc75oszov8 R5Fx/0HGvwRaLpW5frhNGfvL6+reapS+KEj0caQREdhlPeoD4eRpg Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jul 18, 2020 at 3:05 AM Atish Patra wrote: > On Thu, Jul 16, 2020 at 11:32 PM Arnd Bergmann wrote: > > On Fri, Jul 17, 2020 at 1:41 AM Atish Patra wrote: > > > +#define DTB_EARLY_SIZE SZ_1M > > > +static char early_dtb[DTB_EARLY_SIZE] __initdata; > > > > Hardcoding the size in .bss seems slightly problematic both for > > small and for big systems. On machines with very little memory, > > this can lead to running out of free pages before .initdata gets freed, > > and it increases the size of the uncompressed vmlinux file by quite > > a bit. > > > > On some systems, the 1MB limit may get too small. While most dtbs > > would fall into the range between 10KB and 100KB, it can also be > > much larger than that, e.g. when there are DT properties that include > > blobs like device firmware that gets loaded into hardware by a kernel > > driver. > > > I was not aware that we can do such things. Is there a current example of that ? I worked on a product in the distant past where the host firmware included the ethernet controller firmware as a DT property[1] to get around restrictions on redistributing the blob in the linux-firmware package. For the .dts files we distribute with the kernel, that would not make sense, and I don't know of any current machines that do this in their system firmware. > > Is there anything stopping you from parsing the FDT in its original > > location without the extra copy before it gets unflattened? > > That's what the original code was doing. A fixmap entry was added to > map the original fdt > location to a virtual so that parse_dtb can be operated on a virtual > address. But we can't map > both FDT & early ioremap within a single PMD region( 2MB ). That's why > we removed the DT > mapping from the fixmap to .bss section. The other alternate option is > to increase the fixmap space to 4MB which seems more fragile. Could the original location just be part of the regular linear mapping of all RAM? I'm not too familiar with the early mapping code myself, so it may not be possible, but that would be the most logical place where I'd put it. Arnd [1] drivers/net/ethernet/toshiba/spider_net.c