Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp820568iob; Wed, 18 May 2022 13:50:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRxLy9pep/fILt74VIw7kEkiIYDAxh+musfQVsTEHPWNIb7b+sdSigRGKLkwGGD9cXF4k9 X-Received: by 2002:a17:90a:ead5:b0:1df:8229:87b7 with SMTP id ev21-20020a17090aead500b001df822987b7mr1971303pjb.104.1652907015878; Wed, 18 May 2022 13:50:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652907015; cv=none; d=google.com; s=arc-20160816; b=o1C5XrqV5RIJoKGxR5W0lkf+M8qFMnVYGvoI0kch51+tcbk+wOv/YyyrfdIKs8TjLT hlrq6bQ1DYph4OGglNAQTaxRoK82EtbyIKZJq3eoYkwGmQ9pPZjFPYmuDqC/oln+BbEx BjwgbrQPjyCaRD7JxNljgrv0amAMQQZPSl63z8Mq2tWqiz2eSEXj+LOSayoOx0svOuiI xk+nwJjMbsRaJm1jyD1fD8KbdwdhT40zf63LU1V2olz+S6FNCnHAeuP0L8Sw8XlMM5vH cre3vb6B1+ontAboKhWBusqEqF9h4CEZNHcswSG2jFL0J7aSI12iiID4Y5KkqaMmjWs4 f8mQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=wxBHX72sHl+LEUlCxgMe6qdSdNWO4yWjzaf8BXQa58w=; b=JMSWA3jx7I1wfcvKBC9m+9OIeeKE/zAtzskIb7kXRck8B2FIXau24Pk1T18pdQvgk1 muuB+h3wYebkRg54/ezwkZx0uPeejVzVX+NLH+7dPIUF+Dbx8WsKDpeY1u5Mnc1e14zH heGm/6r8xJPREPn+NbGOooNg2ETCGschnAPfdbDfOOMsaKogdkm2LHI2SoPH1yO5dlqm QWvG/YEDqrqu95i68z1RJ9GIaSRQ+LBbcBH6MAWrvAC1XbrqtCBjfC7Cd1x0v4xdi5aM cXBo8OUF4Iz2y5c+ZmSndAhcCsum6QaqeqIBrpAft9R82nNKM6mpJ0NLQgZMcYarQkmg g/6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SwMVC5PK; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id q12-20020a170902f78c00b0015852f2a130si3832709pln.620.2022.05.18.13.50.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 13:50:15 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SwMVC5PK; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8A3D416D110; Wed, 18 May 2022 13:47:05 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242660AbiERUq6 (ORCPT + 99 others); Wed, 18 May 2022 16:46:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242646AbiERUq5 (ORCPT ); Wed, 18 May 2022 16:46:57 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36B3815AB30; Wed, 18 May 2022 13:46:56 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C902F61A2D; Wed, 18 May 2022 20:46:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 37E23C34115; Wed, 18 May 2022 20:46:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1652906815; bh=wxBHX72sHl+LEUlCxgMe6qdSdNWO4yWjzaf8BXQa58w=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=SwMVC5PK9op5GgVoA7nvGZ9qVDqF+kJPD369O70gwrGGpJZwm6bUZwjt37KfBRfOx v2HNpNI4F7I1EuskoPhlwV0gFBwvAWXIAlWDoVkBqcuQdC4J4iq2CNujo1K4Y7Z3zw 82KntzB9E8o+4P6vLhDkfZdWtfJxLWrLfFc9oVMRdIJPTrspMdmZf0JDEzvUcKQ2ZA +YtWwVXGfG48rIFCuWFI/BvqJDU9rsxXrrOKSgqAFxO8wG6hu02Ou16vvrGtP9hikV s1x+5/4cRA081Ln+Xf3mC36LRIzLUPhzNPgi7BxL7YK4svN52JT/7XOqnCnlbkcXLv JJiSmZn7czQXg== Received: by mail-oa1-f46.google.com with SMTP id 586e51a60fabf-f189b07f57so4314543fac.1; Wed, 18 May 2022 13:46:55 -0700 (PDT) X-Gm-Message-State: AOAM531HupqGY2XpyFku3doqhsptbDjIfFTSzUlpxIaH6n6BLgizG47c 2MWer0C8ln71+PL2WD0RM8Xk9jDHY7t/39FODz4= X-Received: by 2002:a05:6870:eaa5:b0:da:b3f:2b45 with SMTP id s37-20020a056870eaa500b000da0b3f2b45mr1230174oap.228.1652906814349; Wed, 18 May 2022 13:46:54 -0700 (PDT) MIME-Version: 1.0 References: <20220517101410.3493781-1-andre.przywara@arm.com> <20220517153444.GA1057027-robh@kernel.org> <20220518165421.GF3302100-robh@kernel.org> In-Reply-To: From: Ard Biesheuvel Date: Wed, 18 May 2022 22:46:42 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] of/fdt: Ignore disabled memory nodes To: Peter Maydell Cc: Rob Herring , Andre Przywara , Frank Rowand , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , linux-arm-kernel , "linux-kernel@vger.kernel.org" , Ross Burton , Catalin Marinas , Will Deacon , Russell King Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 18 May 2022 at 19:54, Peter Maydell wrote: > > On Wed, 18 May 2022 at 17:54, Rob Herring wrote: > > > > On Tue, May 17, 2022 at 08:19:47PM +0100, Peter Maydell wrote: > > > We generate the DTB with libfdt, so source-only information > > > isn't something we can put in, I think. (The quoted DT fragment > > > in this patch's commit message is the result of decompiling > > > the runtime generated DT binary blob with dtc.) > > > > Given the runtime aspect with overlays, it's conceivable that libfdt > > could support setting labels some day and then dts output maintaining > > them. > > > > We could also consider a standard node name such as 'secure-memory'. > > It's a whole can of worms though on how secure vs. non-secure memory > > (and other things) are represented. > > Mmm. We put in the very basic parts years ago in > Documentation/devicetree/bindings/arm/secure.txt > which is (and has remained) generally sufficient for the QEMU->Trusted > Firmware-> maybe uboot->Linux stack, which is pretty much the only use > case I think. (My intention when we wrote that up was that memory > that's S-only would be indicated the same way as S-only devices, > with the secure-status and status properties.) > > > > Are we just stuck with what we have for historical reasons ? > > > > Yes. If we were designing this, we'd probably have 'compatible = > > "memory"'. We're likely just stuck with things how they are. Mostly node > > names haven't been an ABI and we're just trying to be consistent in > > naming and use of unit-addresses. > > So, do you think it's worthwhile/a good idea for me to rename > the DT node that QEMU is currently calling "secmem" to be > "memory" ? My default is "leave it as it is", for economy of > effort reasons :-) -- but it's an easy enough change to make. > Though EDK2's dtb reading code just looks for the first > "memory" node and assumes it's the big one, so changing the node > name would make us reliant on the order of the two nodes in the > DTB unless we fixed EDK2 (which we should probably do anyway, tbh). > Agreed. The referenced code is only one of two implementations (one for the firmware version that executes in place from NOR flash, and one for the version that executes from DRAM), which don't follow the same strategy (the other one enumerates all device_type="memory" nodes in the tree, and picks the one with the lowest starting address, but also ignores status properties or node names). The PrePi version linked here should simply choose the node that covers its own image in memory. The XIP version uses a stack in DRAM, so it could do something similar.