Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp118545iob; Tue, 17 May 2022 20:50:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx4PEpzldAZ7nRR2PTnTYybLg1RJ9q+S+FLOcczfiH1brNjltnSyFbRO7mKMmv8lruj+DY8 X-Received: by 2002:a63:4e25:0:b0:3f6:8:8c04 with SMTP id c37-20020a634e25000000b003f600088c04mr1254034pgb.458.1652845840340; Tue, 17 May 2022 20:50:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652845840; cv=none; d=google.com; s=arc-20160816; b=aw742jXeeHaa1/TY8ivDttoOfgwSi5rY25FdV9ip1Rp/T3cZ9RjWuMltIT06BThgZW nrT+krnmGD9kfLiFpjV/v2oB5c4HpCMe4qmGFnHnrbA24iUGUSYbcnkn/QEdsYuhzTBr /iOmHOTMBAS1cAydt9FTe/fw249KoA1xTgNfOtjm31YelDVT90niUv8m8tC8ga657J6Z PxuVuRpMDn3Pdvc4aqa0RRZ54l2YGLXXvyNSFZB2Hk6vDmJE1CX/7Zg9KNZAmBPxQ9Q9 WJLEY+8uyrkkQFyFChdWm06AuIs6w/5JMTsBUFBOdMHTAIOjMABleEtj3mSJGiW7qYdl mcAg== 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=2eoz2FUrFUdjGA8OgTVmDbdUGsT/gwE/rSjYW1YpgfY=; b=osHkMEKPXUJsrA4qInAJIm/IdivLRcxY/bT5xM4+2mZEaPngXYxAQPNaM1UZl5VAf1 61BuyUAvU3YhLsoxiIM8eeC9Kp+weV/F+HyYPb6ZYDSLOB+TVgLJHa4nH/zktEQDxVPs sbZp424xfjmDyFtRbB9HFJjVqUMSIuUdlyYjatVDS6U4JjDpdOFqr0i6mC6UWxk6XTzq I2IeiBeFaXe3Yx9P9Y2/KLGJbjU0YLRPfNiwyBZA9MJxOSWtdj93+HxKDtYniCKwJQo3 wVps1TOZUqoue0vJWURp6XbajWOsSQjBA+DP1tx4UsblbeJ8CONB5BywaxYol4xiButa bzTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ihKzkeBc; 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=linaro.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id y23-20020aa78f37000000b004faec001782si1327261pfr.232.2022.05.17.20.50.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 20:50:40 -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=@linaro.org header.s=google header.b=ihKzkeBc; 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=linaro.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B822D8D682; Tue, 17 May 2022 20:33:18 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352657AbiEQTUD (ORCPT + 99 others); Tue, 17 May 2022 15:20:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348534AbiEQTUA (ORCPT ); Tue, 17 May 2022 15:20:00 -0400 Received: from mail-yw1-x112b.google.com (mail-yw1-x112b.google.com [IPv6:2607:f8b0:4864:20::112b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9045427C0 for ; Tue, 17 May 2022 12:19:59 -0700 (PDT) Received: by mail-yw1-x112b.google.com with SMTP id 00721157ae682-2f83983782fso1401987b3.6 for ; Tue, 17 May 2022 12:19:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=2eoz2FUrFUdjGA8OgTVmDbdUGsT/gwE/rSjYW1YpgfY=; b=ihKzkeBc+Xb/IoVLp0fS7Sr0sxJjfhS1Yqo/VO13B+NX8DQrnuSiCBe9gpENlnq01r ebTJJP3C0S0avc8TXWvc01/zvZ+tw/+jgS+5d1VY5zDY06zNOqru2fXQB/ItakDrQ3ow cne2MBsJ8hEm/+vnBcY2LiW+eDmS55w+G7kSUwkDfuOZIpsvJnKs3dgrdsrO1CJhTKdt wER5VlGEGFR3K2VU0nTgQ3rtlR/EcIsNeu2lJeDOKnvMxO3X0Vvc+WZJJyzAOO9lK73f LTyvMHRtNq7EsyvwSLf0yuIiMNguhyDeI+NwpWwKslbnOs4wH+DfNICmm/g3jHORiZCB VaxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2eoz2FUrFUdjGA8OgTVmDbdUGsT/gwE/rSjYW1YpgfY=; b=xcYLgWanMvbYtBx2lHrSVbAnta1QUbd81c28uO+g75COs32yo60uo9/rCXup+Y7tZH Sfx5S4NQFp/OM5bMj9QgtGbN20mSFYvy46iq1cnEt8C2zVk5McKUq3Mru8EEqGIM+0gM NBdBVcC6dtapAH3idvfOsJkuQHURLzAVdkQgl6WD5W4InOs1ym2NJqTjt6haxY2j31AF lh+mvCesnAIm8I6H5XcWao6ewttFilEQoav5rCLxvvZDxN1jO5SDmv/ISE4uB3V+qK2p SiVTCk31IDbDQVySG3wYTK5c+WKjC6RDLrW/UfY1dqzGSP3wuCpUAxn6yaDtDKax7vA9 CIkA== X-Gm-Message-State: AOAM533NJ7NxaWFGhn8VeRRhXdi9jlL5Wt+Fh3piNV6v2fGjdcEWoBsU xZOmmsLF1ulvPcOBW3hiXNyMr6UGiBG+wbKD41l9Ng== X-Received: by 2002:a81:6904:0:b0:2fe:e670:318a with SMTP id e4-20020a816904000000b002fee670318amr14914838ywc.329.1652815198932; Tue, 17 May 2022 12:19:58 -0700 (PDT) MIME-Version: 1.0 References: <20220517101410.3493781-1-andre.przywara@arm.com> <20220517153444.GA1057027-robh@kernel.org> In-Reply-To: From: Peter Maydell Date: Tue, 17 May 2022 20:19:47 +0100 Message-ID: Subject: Re: [PATCH] of/fdt: Ignore disabled memory nodes To: Rob Herring 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.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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, 17 May 2022 at 18:48, Rob Herring wrote: > > 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. 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.) > > 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. This seems kind of odd to me as a design, compared to "have the node have a property that says what it is and let the name of the node just be, well, its name" (especially since 'device_type' and 'compatible' look an awful lot like "this is the property that tells you what this node actually is".) Are we just stuck with what we have for historical reasons ? -- PMM