Received: by 10.223.164.221 with SMTP id h29csp3749492wrb; Thu, 19 Oct 2017 03:08:22 -0700 (PDT) X-Received: by 10.159.198.11 with SMTP id f11mr1122496plo.290.1508407702041; Thu, 19 Oct 2017 03:08:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508407701; cv=none; d=google.com; s=arc-20160816; b=ulF8uISj6LZTjFFmQ5ffrCoEYGM7xOyMvelQ0O2ERRBd20X0c06Xxp+0NEENElTS5k f7o041tSqQw4biB3brcmGTpOKDWD70yhIJC0GtDy4qiJS7sfoVkzg/fVFuCrUyz0kW3g 07kjybzoAnwj/RTHsRKuy3ZXYJ6kJhsCAXFQdcHkLDildQyfsrAEu7YsNANtV1TWkBM1 kHl5XWTS4BzFuv/9qtRr6/D/SVUIiWwPN6vosjaNBYWgiFHbjsALsbTayfpjVfHBcSzW 6uikw13IgEmJANYSkMMlb3RpBUp7yja1bMcyLQ/LLU3LjFBGi0ar8aGCt0K56UMCh8N9 R+VQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature:arc-authentication-results; bh=aEddVRlTQ8GiIY9Xb3HeyQ7a4uJxoUultY8te6fHJh4=; b=Bi3nYoBLSQcjM13mqllXCaXUazQ9cClRiYzg6Eidln6uc7K1ctH71mNJ4TMUKTj9DI 7j+wLAMOpzeCti5776+yMHr7c8P2v0HO1MoiLN3rPrSAVE8vwEhjUgsinol2CI8VfDeR 65tsXllHLZYGDMls0iKqSHRxcVeU6xDRCNnxqBrKLkkcu1C9p489eCKVXT64L0ikOsg+ Zt4ny9TugEdAAp0Ma63nMQRgN3ed572ktkqiu/GUI59sgw7PZ//ROsrMPE0Srl8LsuLh b3pq49YjAK+xL6L52IPFe1DHv1Mx/wufhlCip9oW204Vx8rD3z5SBuOcUAG8i35P+HBz CjOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@konsulko.com header.s=google header.b=OJTqggPs; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w127si8947757pfd.532.2017.10.19.03.08.05; Thu, 19 Oct 2017 03:08:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@konsulko.com header.s=google header.b=OJTqggPs; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752138AbdJSIlY (ORCPT + 99 others); Thu, 19 Oct 2017 04:41:24 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:47352 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751860AbdJSIlU (ORCPT ); Thu, 19 Oct 2017 04:41:20 -0400 Received: by mail-wr0-f194.google.com with SMTP id y39so7463063wrd.4 for ; Thu, 19 Oct 2017 01:41:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=aEddVRlTQ8GiIY9Xb3HeyQ7a4uJxoUultY8te6fHJh4=; b=OJTqggPsWlxcW5f2Y45emBW0zy8O9BD3tZ7es946Rlmb6oqPocL6uBvvrfke3vYP9a hOzwSa8AHHbRComPexBAZVsAATB3OH9bb4vb/P0U3FlewXL3SRKvlKzQ+R3/y2s+IJOa 1twXF1q/h6TEjELi7bFNiD8arOATR9ySm2dVg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=aEddVRlTQ8GiIY9Xb3HeyQ7a4uJxoUultY8te6fHJh4=; b=b+6eHXvTPvt4ePnsK82BcZctcsOgcyzDiT1ziNAfyzE6d+yBiqetTR+DgtucA6AnRV 5hDN3J6YTNLgkIO+CASU0TxXeRyiG6BrB+vNyF0XKqe7ArwuZNK8nB4zqCCufu1AfD2y gKjQD42EOdnkfHNfFtSSzYKilED7E1pl9XpHhep9a8t/3K9Adn7YXPffGF+zkUYtqZo/ 30pd2i3xi+vbzX5uwrULN6IWofNwzc920w9KOI0zGneXPRr+v/kHdKjBTS9nzPv4A08A ni1oqN+bw3rEAanhrYU2MbF50iLi3Hx02LXpSHqdg2DJ6eBDX3pCZy+voPSxMzKydiJj WO4A== X-Gm-Message-State: AMCzsaXKziKNhN4BwYDGTYtctOuJ2IDwXzPgiTCyAPQXpfK1z5AtKiEO /F9bgiYP83rHmmFVxDMV76LUbg== X-Google-Smtp-Source: ABhQp+RIvBNA7CPztwa1UjlMf8XeWZvHCQ4PlsbG6JfrTb05NkC/PvE50RYvHAwQuKZ7el/3JDe6jQ== X-Received: by 10.223.169.167 with SMTP id b36mr904859wrd.61.1508402479342; Thu, 19 Oct 2017 01:41:19 -0700 (PDT) Received: from [192.168.2.2] ([195.97.110.117]) by smtp.gmail.com with ESMTPSA id n14sm16501986wrg.38.2017.10.19.01.41.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Oct 2017 01:41:18 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: [PATCH v2 5/5] of/fdt: only store the device node basename in full_name From: Pantelis Antoniou In-Reply-To: <59E7CBAF.9080501@gmail.com> Date: Thu, 19 Oct 2017 11:41:16 +0300 Cc: Rob Herring , Alan Tull , "devicetree@vger.kernel.org" , Michael Ellerman , linuxppc-dev , linux-kernel , Benjamin Herrenschmidt , Paul Mackerras , David Laight , linux-fpga@vger.kernel.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <20170821151651.25096-1-robh@kernel.org> <20170821151651.25096-6-robh@kernel.org> <59E69786.2030406@gmail.com> <1508341985.25643.12.camel@hp800z> <59E7CBAF.9080501@gmail.com> To: Frank Rowand X-Mailer: Apple Mail (2.3273) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Frank, > On Oct 19, 2017, at 00:46 , Frank Rowand = wrote: >=20 > On 10/18/17 11:30, Rob Herring wrote: >> On Wed, Oct 18, 2017 at 10:53 AM, Pantelis Antoniou >> wrote: >>> On Wed, 2017-10-18 at 10:44 -0500, Rob Herring wrote: >>>> On Wed, Oct 18, 2017 at 10:12 AM, Alan Tull = wrote: >>>>> On Tue, Oct 17, 2017 at 6:51 PM, Frank Rowand = wrote: >>>>>> On 10/17/17 14:46, Rob Herring wrote: >>>>>>> On Tue, Oct 17, 2017 at 4:32 PM, Alan Tull = wrote: >>>>>>>> On Mon, Aug 21, 2017 at 10:16 AM, Rob Herring = wrote: >>>>>>>>=20 >>>>>>>> Hi Rob, >>>>>>>>=20 >>>>>>>>> With dependencies on a statically allocated full path name = converted to >>>>>>>>> use %pOF format specifier, we can store just the basename of = node, and >>>>>>>>> the unflattening of the FDT can be simplified. >>>>>>>>>=20 >>>>>>>>> This commit will affect the remaining users of full_name. = After >>>>>>>>> analyzing these users, the remaining cases should only change = some print >>>>>>>>> messages. The main users of full_name are providing a name for = struct >>>>>>>>> resource. The resource names shouldn't be important other than = providing >>>>>>>>> /proc/iomem names. >>>>>>>>>=20 >>>>>>>>> We no longer distinguish between pre and post 0x10 dtb formats = as either >>>>>>>>> a full path or basename will work. However, less than 0x10 = formats have >>>>>>>>> been broken since the conversion to use libfdt (and no one has = cared). >>>>>>>>> The conversion of the unflattening code to be non-recursive = also broke >>>>>>>>> pre 0x10 formats as the populate_node function would return 0 = in that >>>>>>>>> case. >>>>>>>>>=20 >>>>>>>>> Signed-off-by: Rob Herring >>>>>>>>> --- >>>>>>>>> v2: >>>>>>>>> - rebase to linux-next >>>>>>>>>=20 >>>>>>>>> drivers/of/fdt.c | 69 = +++++++++----------------------------------------------- >>>>>>>>> 1 file changed, 11 insertions(+), 58 deletions(-) >>>>>>>>=20 >>>>>>>> I've just updated to the latest next branch and am finding = problems >>>>>>>> applying overlays. Reverting this commit alleviates things. = The >>>>>>>> errors I get are: >>>>>>>>=20 >>>>>>>> [ 88.498704] OF: overlay: Failed to apply prop = @/__symbols__/clk_0 >>>>>>>> [ 88.513447] OF: overlay: apply failed '/__symbols__' >>>>>>>> [ 88.518423] create_overlay: Failed to create overlay = (err=3D-12) >>>>>>>=20 >>>>>>> Frank's series with overlay updates should fix this. >>>>>>=20 >>>>>> Yes, it does: >>>>>>=20 >>>>>> [PATCH v3 11/12] of: overlay: remove a dependency on device node = full_name >>>>>=20 >>>>> Thanks for the fast response. I fetched the dt/next branch to = test >>>>> this but there are sufficient changes that Pantelis' "OF: = DT-Overlay >>>>> configfs interface (v7)" is broken now. I've been adding that >>>>> downstream since 4.4. We're using it as an interface for applying >>>>> overlays to program FPGAs. If we fix it again, is there any = chance >>>>> that can go upstream now? >>>>=20 >>>> With a drive-by posting once every few years, no. >>>>=20 >>>=20 >>> I take offense to that. There's nothing changed in the patch for = years. >>> Reposting the same patch without changes would achieve nothing. >>=20 >> Are you still expecting review comments on it or something? >> Furthermore, If something is posted infrequently, then I'm not >> inclined to comment or care if the next posting is going to be after = I >> forget what I previously said (which is not very long). >>=20 >> I'm just saying, don't expect to forward port, post and it will be >> accepted. Below is minimally one of the issues that needs to be >> addressed. >>=20 >=20 >=20 >>>> The issue remains that the kernel is not really setup to deal with = any >>>> random property or node to be changed at any point in run-time. I >>>> think there needs to be some restrictions around what the overlays = can >>>> touch. We can't have it be wide open and then lock things down = later >>>> and break users. >=20 > That paragraph is key to any discussion of accepting code to apply = overlays. > Solving that issue has been stated to be a gating factor for such code = from > the beginning of overlay development. >=20 Overlays are not only used only for cases where you have external = expansion boards, or FPGAs where every change is contained under a few designated nodes, so = that=E2=80=99s why I=E2=80=99m pushing for a in-kernel validator that=E2=80=99s more flexible than a = single whitelist. An eBPF validator would handle a whitelist trivially easy, and would be = flexible enough for any other more complicated use case. >=20 >>>> One example of what you could do is you can only add >>>> sub-trees to whitelisted nodes. That's probably acceptable for your >>>> usecase. >>>>=20 >>>=20 >>> Defining what can and what cannot be changed is not as trivial as a >>> list of white-listed nodes. >>=20 >> No, but we have to start somewhere and we are not starting with any >> change allowed anywhere at anytime. If that is what people want, then >> they are going to get to maintain that out of tree. >>=20 >>> In some cases there is a whole node hierarchy being inserted (like = in >>> a FPGA). >>=20 >> Yes, so you'd have a target fpga region. That sounds fine to me. = Maybe >> its not a static whitelist, but drivers have to register target >> nodes/paths. >>=20 >>> In others, it's merely changing a status property to "okay" and >>> a few device parameters. >>=20 >> That seems fine too. Disabled nodes could be allowed. But what if you >> add/change properties on a node that is not disabled? Once a node is >> enabled, who is responsible for registering the device? >>=20 >> What about changing a node from enabled to disabled? The kernel would >> need to handle that or not allow it. >>=20 >>> The real issue is that the kernel has no way to verify that a given >>> device tree, either at boot time or at overlay application time, is >>> correct. >>>=20 >>> When the tree is wrong at boot-time you'll hang (if you're lucky). >>> If the tree is wrong at run-time you'll get some into some = unidentified >>> funky state. >>=20 >> Or have some security hole or a mechanism for userspace to crash the = system. >>=20 >>> Finally what is, and what is not 'correct' is not for the kernel to >>> decide arbitrarily, it's a matter of policy, different for each >>> use-case. >>=20 >> It is if the kernel will break doing so. >>=20 >> Rob >>=20 >=20 From 1581633480045026093@xxx Wed Oct 18 21:47:07 +0000 2017 X-GM-THRID: 1576354368386704057 X-Gmail-Labels: Inbox,Category Forums