Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp419698ybh; Mon, 20 Jul 2020 21:21:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJynKbId11Y3zIikc42NYNDCgGi2OxO5Jn04B67VmcvwkHagAsKd1Hxfuj+wbuLPT+t66ti7 X-Received: by 2002:a17:906:b813:: with SMTP id dv19mr22943918ejb.119.1595305287108; Mon, 20 Jul 2020 21:21:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595305287; cv=none; d=google.com; s=arc-20160816; b=x9fbpiRYTEVQC5i4R6UsL+sk5bnKNFYfsq+X0SyPdZsM8zLFZmkYZf7K7Uv2f/cUzq mFv/NeaiHYBR3DlMHbVGMoKsw8StlVvyzq7P9LQrv+G/AM1/P8ElDmLTnqK1RIKtjR7F 8lUr646jGCocMlW9/5g7r2O/Jq3/bC8nWCjEf1RySmvM8Sc0y6pcFHuJ9H/cuEMwhm0U yVB4iRroAYDsOTyN1zTkKA1vRt79aP/9iracEPaloshJlRYEaipVLJIem0VzJkPMKC+s jXEdBfL4IUJCAl/85vofXXJwKmQQStu4CFEdaa9+0V+dohVF0B5k0T5XnBrwsGGs/nNT HHLA== 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:dkim-signature; bh=pvGyIvK+jrRG641iFQvvM5qkEd++webDM8jQoP8KAeg=; b=nrodXBecJl50MC1czQJrZpTchirQPGaC//nOrrEUSsCcdYzS4pkEuGkk3sS9DhU1Zh fJnMgNC1fV0OIssJXlzYJKHH0bS2lwU+KUzb8pl4mn7fU3EM+KzzBm2diymljA+2hLCU aGNiPfQID4c3OwLwt478ntNoSzCaGteqg6zmtgm3hCBIY9aGYjYYZOPGsWe30gmxQIHJ /NAiA1IEwQvYZPULRZMqB79zIG05yYzyqpBvFOsZKalWYlUJopYLdmTv08Ooiel7B978 hXdxM76SVpSxvlnzpzmA78SZf5rCuC6wRRci+6zlpqUZAXSgNdxHJaBqrsVDlYTVISL4 sgYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@atishpatra.org header.s=google header.b=uBaNnnrb; 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 z4si12300552edr.144.2020.07.20.21.21.04; Mon, 20 Jul 2020 21:21:27 -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; dkim=pass header.i=@atishpatra.org header.s=google header.b=uBaNnnrb; 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 S1726828AbgGUESg (ORCPT + 99 others); Tue, 21 Jul 2020 00:18:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725294AbgGUESf (ORCPT ); Tue, 21 Jul 2020 00:18:35 -0400 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1970C061794 for ; Mon, 20 Jul 2020 21:18:34 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id s10so19712028wrw.12 for ; Mon, 20 Jul 2020 21:18:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=atishpatra.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=pvGyIvK+jrRG641iFQvvM5qkEd++webDM8jQoP8KAeg=; b=uBaNnnrbr/RkUKhJ8oRD3GenYZDoDi3q/cqa9bMRN3VnTE7n0oVpoEM5ltsbsNG8Mm YcZInye9jRD0m9OFGBAkKqGWKhFHt8PV0DNN4kVcv9nfxOyCwTQh2MH+0lATLa8FrwiB ZtX2A8eEdOIhIHU8iLdL+xj18YaTplTCST6hY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=pvGyIvK+jrRG641iFQvvM5qkEd++webDM8jQoP8KAeg=; b=iiEVQ96ubnTP+YmFoiLpZL98sZMg64FwmVz/CmxLHEAbtYU2Msqxw+oZf20OqZaaHV 4IRTRfz9een1M60ai8YlyngBd46jVxOAfYPmxlA4AZkOzC7XGUvhpUZi6XKVrrw4chE9 7AVxHSbcO6IuJuGaKU1mbYyxmfYjcx2PKkq+UJCejkOsVHWQcTSIhAy3XbX7PH/jEKVA opzadhL6TcSwhWFkBrecW/ejHgS/L2Mfq6AUIglZZWMOQnL2AmT65hD7FDr3i0HuE9H0 ya38+PCpFxbVMdvZtAhEDfsE8pYBrBwbhrSBWdFVrsffjdD/eAIyy8aDipCbRwCspJSd dzkg== X-Gm-Message-State: AOAM5310vbY4Syr8pYBrvavRxuQ6j4JnmTxghN2TXBUL0s95UYDlhsnv Kz1UDgglPoSeiAsuW8X/eipR1IvVyMTlSjJug4MR X-Received: by 2002:adf:a35e:: with SMTP id d30mr11992031wrb.53.1595305113513; Mon, 20 Jul 2020 21:18:33 -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: Atish Patra Date: Mon, 20 Jul 2020 21:18:21 -0700 Message-ID: Subject: Re: [RFT PATCH v3 1/9] RISC-V: Move DT mapping outof fixmap To: Arnd Bergmann 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" 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 2:24 AM Arnd Bergmann wrote: > > 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? No. Because we don't map the entire RAM until setup_vm_final(). We need to parse DT before setup_vm_final() to get the memblocks and reserved memory regions. 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 -- Regards, Atish