Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp106020iob; Tue, 17 May 2022 20:21:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzjAfx8Ylmf2v4hfK7q/4FolcbZCnbuR8XAzFcaB0t/qASCnNsFM02YZ2lJL+LCOwqlflcS X-Received: by 2002:a63:34a:0:b0:3f5:ef54:ec6c with SMTP id 71-20020a63034a000000b003f5ef54ec6cmr2428595pgd.41.1652844116052; Tue, 17 May 2022 20:21:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652844116; cv=none; d=google.com; s=arc-20160816; b=Z6235TSj2Jwc2tKbhYGIC7+gXF1iwmhnyKxYWw6Apda8B8ikNik4RAsstNbee134/i JAUawDD6nL6IuKjWt4PzK10MRRkOeCd5H1XtVssbqVuK92qmbcgz3I8e3s3Lz9pGioGS 2vGTUASkiZsPw9VmnBBfcHvdhEE9QGvRBNQiyUF5pkFHgJoeKXDE7BCalPqQUXPieO2g 5b0VTko9DlE031CRqarNuzDvEbq0ba7xxs/Zwm4usoy0Idhs9IkVCUbtPra7xT4DePBu 7knBud9+ic3mNxv/RwJHo3UrT1Q4HUJIEuniR6v6hA2EW79lDrIZLm5Cm7o97W6CSEZo WHUA== 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=7Qr/Wc9CxRBHczsF1UQJ+EoK2k89BfjvOtG6zBMyUlw=; b=Vmi8yzMO5wOSxuGDy2oBJ4FCuoljw6hhMTRM1OmvP5LTEHTFZXTxqNnS10355B2GhQ +9GNTzqfqt+2xhqtUl6xdStVgGVYeCPEL84VYkNN2i/gI+oe38W/10S5WZxIGhvSbr68 r40SpEObozGoD+R+NgmrlG7M0YJjkd33eUhMzuoucfn5x6hPvge/KI+OZAxJLYajsSuK QXG1Is0hvHSOIV4uAvxXN9fGqGA4/8MlyZf7kLAu4MBSp26zbR01hVyZA0r2WYKfEhiB 9zaiWFxt9NQ7v9YuMKeB05UHLNLttdgoEIcfkALd2IaW+nrevj5mIrFHsI+8pjm5ZdYA Y/qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rwmjG7N6; 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 il9-20020a17090b164900b001cb7565298csi1113772pjb.76.2022.05.17.20.21.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 20:21:56 -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=rwmjG7N6; 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 1B35959085; Tue, 17 May 2022 20:20:43 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351600AbiEQRsr (ORCPT + 99 others); Tue, 17 May 2022 13:48:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234922AbiEQRso (ORCPT ); Tue, 17 May 2022 13:48:44 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E5E250062; Tue, 17 May 2022 10:48:43 -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 ams.source.kernel.org (Postfix) with ESMTPS id 2E704B81B3D; Tue, 17 May 2022 17:48:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D42A8C34118; Tue, 17 May 2022 17:48:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1652809720; bh=mM7kmRtxEsXSLuyxUuHv0ZboSh0tiiMRcwstNFbsFfY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=rwmjG7N6M9pmFM6sv9uM5k60fZXFmKSJEqEAZL2qV27Dke+ZPfNpoRsUgXEpfbBkZ p6nLZvdZt8sN6otbQXIds2h2FSc8F9r5lO/tatI5hryulEoR60yFkZ+xqT9Dc3NkHm +2LGKNa2E/ngwE4Zo4zf6WGGOKjA8g19iP4VE4gS7pBWfaMLDbcS0Eh6WeWi2uKbaK MKJYfm0UHYXo/P6o+ttI0JjAC9jvwcxLnFNeq1YOM57obP8DDmK6wRt68z4x+kkPYe 3W1/yFXucBkXrfe6EjWZAbm7oXLSi0+16shE6pGOqj1stBfErgwbrpd7RXmz3HSh67 txqwuR0q+D9XA== Received: by mail-ej1-f45.google.com with SMTP id f9so947354ejc.0; Tue, 17 May 2022 10:48:40 -0700 (PDT) X-Gm-Message-State: AOAM530tUggls+wu4yGqi5TAR72ZNLv+iKCJEsX6JhDCk9qYwQR1cGE/ ltE1t4cmi4eEbwlFLeqxcXhwFQjBxPEE4/0sWA== X-Received: by 2002:a17:906:a888:b0:6f3:e990:e554 with SMTP id ha8-20020a170906a88800b006f3e990e554mr20800497ejb.19.1652809719089; Tue, 17 May 2022 10:48:39 -0700 (PDT) MIME-Version: 1.0 References: <20220517101410.3493781-1-andre.przywara@arm.com> <20220517153444.GA1057027-robh@kernel.org> In-Reply-To: From: Rob Herring Date: Tue, 17 May 2022 12:47:56 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] of/fdt: Ignore disabled memory nodes To: Peter Maydell Cc: Andre Przywara , Frank Rowand , devicetree@vger.kernel.org, linux-arm-kernel , "linux-kernel@vger.kernel.org" , Ross Burton , Ard Biesheuvel , Catalin Marinas , Will Deacon , Russell King Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.4 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 Tue, May 17, 2022 at 11:54 AM Peter Maydell wrote: > > On Tue, 17 May 2022 at 16:34, Rob Herring wrote: > > > > On Tue, May 17, 2022 at 11:14:10AM +0100, Andre Przywara wrote: > > > When we boot a machine using a devicetree, the generic DT code goes > > > through all nodes with a 'device_type = "memory"' property, and collects > > > all memory banks mentioned there. However it does not check for the > > > status property, so any nodes which are explicitly "disabled" will still > > > be added as a memblock. > > > This ends up badly for QEMU, when booting with secure firmware on > > > arm/arm64 machines, because QEMU adds a node describing secure-only > > > memory: > > > =================== > > > secram@e000000 { > > > > BTW, 'memory' is the correct node name. > > We already have a 'memory' node, which is for the NS > memory. This one's for the secure-only RAM block, > which is why I gave it a name that hopefully helps in > spotting that when a human is reading the DT. You can do: secram: memory@e000000 { Where 'secram' is only a source level label until overlays come into the picture. > I'm not really sure to what extent node names in device trees are > "this is just an identifying textual label" and to what extent > they are "this is really ABI and you need to follow the standard", > though -- nothing in practice seems to care what they are, > suggesting the "textual label" theory, but some bits of tooling > complain if you do things like forget the address value or use the > same address for two different nodes, suggesting the "really ABI" > theory. Node names are supposed to follow the class of device and there's a list of established names in the spec. Sometimes it's ABI and sometimes not. Much of it is just good hygiene. memory nodes are also special because 'device_type' is used to identify them, but device_type is generally deprecated for FDT as its meaning in OpenFirmware doesn't apply (it defines what callable methods exist). We could use the nodename (without unit address) instead, but that would fail in some cases as other names have been used. Rob