Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2842898imm; Fri, 19 Oct 2018 00:10:21 -0700 (PDT) X-Google-Smtp-Source: ACcGV61dROoSHQ9Klzjc+cM72Cms1nMoGxG+l3uVf60jnM4UhmRUqKjL/92rQhC21vBsZY4IeQ4S X-Received: by 2002:a17:902:5981:: with SMTP id p1-v6mr1064922pli.260.1539933021152; Fri, 19 Oct 2018 00:10:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539933021; cv=none; d=google.com; s=arc-20160816; b=1DtYPwmtKfx7xMo9Xf0xsrHuhtHrQpb/v8CTFtgzmZLF58rfPUhGJ2lAlzCRZdACgD 7cXs26G31in1/zpPomh5bqdMIdaB1zjVoHxvF73S+GOaJdyvcmYd92AP1OnoA0vlh5G6 cJb4+qvYd9sHtkHlU6FBR/xb4N9r/22SFM61H4MHv+wi0q0BAQfElKKZy2V4BEjBBacw 5ZbdBlfXS8Wei4DH4ScJZTHLoG9LG98cjhwcEbqgh1hsY5c9VkwQUoaKLbTUBXV5gG8d ydLTbSy0Yax6jbIVhR6jYiHkVyLUyNijBDjdUCYOq1ImIFJyOLrDrXqIaN6+E4RtCHxG lgMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=21XEBPLR+OiiynkG5MS1hPsRggRkJrhWRt151rSUNQs=; b=u5Spif+UfiB9OeQBQs32xsNoP3U2ccGZDWwjDO6d5PidB0HCMXYPrYczEIcom7ham5 z+Fp5gz52xcLsoMeQt40WqwGcLbCjEOSAu1O+aXmUr/lxWYJsn46DXXVwKPuAfRHTysn OlHif8AIuq4t7bwFZLC5iUXO+X2SPSVHivSM6XT8HChjM9jIGLhEEcUxBDgf5H5LoNin HF19+evf8iFCVyxW2MsBWURLgHIJS5inCDxiHTfJPgZc56t8rOQzhfob5Zq6SU/KzRxL OYsfX+74BSbkAArk7NemLJxuSGhn8N5QjV/KY8PyN481ETgJn2ePmcIuLW/mQBRRIm6t 39Mg== ARC-Authentication-Results: i=1; mx.google.com; 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 p5-v6si23891300pgi.411.2018.10.19.00.10.06; Fri, 19 Oct 2018 00:10: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; 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 S1727061AbeJSPNx convert rfc822-to-8bit (ORCPT + 99 others); Fri, 19 Oct 2018 11:13:53 -0400 Received: from mail-ua1-f68.google.com ([209.85.222.68]:34997 "EHLO mail-ua1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726653AbeJSPNx (ORCPT ); Fri, 19 Oct 2018 11:13:53 -0400 Received: by mail-ua1-f68.google.com with SMTP id m18so7099228uaq.2; Fri, 19 Oct 2018 00:09:06 -0700 (PDT) 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:content-transfer-encoding; bh=mi1QA2+ltMlWRYrMcdsWV9jjxac3h71oRUzPwqpqmv8=; b=jhd9aOTJ84sUNcUq+tS8C4GylNiWDc6Oh8XQUTQLW5uSuJbsghhp/AKBi7XzyzQ1H6 I3fNVyEGUyVmwN2MMY6cBlpDDWsnXYrx8MsT+/8PvmIInEn7ZbM4t6MXm9vpG1iU0ymU kH9iBwiaDbcj3/CMgrE+fWwNzZO3tiL+gFh8fIEXeKQzYPMDqbzfS+WuEGqTaokmoD+S MCZdgfgz23HuPmTdBjXm0gpmmgf2cUFGRX9zRX2jN4rhcJYRFtI7kHlxjH+hSsyGvaDI ePNcg/nkUlRevniPnLURwjSLvIbS9Yy6bskJSzrfbra88+8Vbh00iRbXw2o5NStHJFx1 2Tcw== X-Gm-Message-State: ABuFfohf9PupgpjJEVSp2TKwbqFuyQAttwGi4/9niFYjOB+fDUsLhkb0 NKQMcSac7xKW+NUbofgdiRa6i4FOWqzKI0OuCj8= X-Received: by 2002:a9f:308a:: with SMTP id j10mr4378980uab.28.1539932945580; Fri, 19 Oct 2018 00:09:05 -0700 (PDT) MIME-Version: 1.0 References: <1539736466-28638-1-git-send-email-frowand.list@gmail.com> <20181018193216.GA9971@bogus> <2f99d700-6276-cfa4-8878-4eb161126330@gmail.com> In-Reply-To: <2f99d700-6276-cfa4-8878-4eb161126330@gmail.com> From: Geert Uytterhoeven Date: Fri, 19 Oct 2018 09:08:53 +0200 Message-ID: Subject: Re: [PATCH v3] of: overlay: user space synchronization To: Frank Rowand Cc: Rob Herring , Pantelis Antoniou , Pantelis Antoniou , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Linux Kernel Mailing List , Alan Tull Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Frank, On Fri, Oct 19, 2018 at 2:06 AM Frank Rowand wrote: > On 10/18/18 12:32, Rob Herring wrote: > > On Tue, Oct 16, 2018 at 05:34:26PM -0700, frowand.list@gmail.com wrote: > >> Provide a sysfs file, /sys/firmware/devicetree/tree_version, to allow > >> user space to determine if the live devicetree has remained unchanged > >> while a series of one or more accesses of /proc/device-tree/ occur. > >> > >> The use of both (1) dynamic devicetree modifications and (2) overlay > >> apply and removal are not supported during the same boot cycle. Thus > >> non-overlay dynamic modifications are not reflected in the value of > >> tree_version. > > > > I'd prefer to see some sort of information on overlays exported and user > > space can check if that changed. IIRC, Pantelis had a series to do that > > along with a kill switch to prevent further modifications. At least some > > of that series only had minor issues to fix. > > The kill switch addresses a different concern, which was from the security > community. The kill switch is on my todo list. > > I don't remember exactly what info the overlay information export patch > provided. I'll have to go find it and re-read it. I'm still forward porting the overlay configfs interface, cfr. https://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git/log/?h=topic/renesas-overlays E.g. after loading r8a7791-koelsch-exio-b-scifa3.dtbo, it changes like: --- tree /sys/firmware/devicetree old 2018-10-19 08:49:24.073441000 +0200 +++ tree /sys/firmware/devicetree new 2018-10-19 08:49:33.173397000 +0200 @@ -1237,6 +1237,11 @@ │ │ │ │ ├── groups │ │ │ │ ├── name │ │ │ │ └── phandle +│ │ │ ├── scifa3 +│ │ │ │ ├── function +│ │ │ │ ├── groups +│ │ │ │ ├── name +│ │ │ │ └── phandle │ │ │ ├── scif_clk │ │ │ │ ├── function │ │ │ │ ├── groups @@ -1510,6 +1515,8 @@ │ │ │ ├── interrupts │ │ │ ├── name │ │ │ ├── phandle +│ │ │ ├── pinctrl-0 +│ │ │ ├── pinctrl-names │ │ │ ├── power-domains │ │ │ ├── reg │ │ │ ├── resets @@ -2277,6 +2284,7 @@ │ │ ├── scifa1 │ │ ├── scifa2 │ │ ├── scifa3 +│ │ ├── scifa3_pins │ │ ├── scifa4 │ │ ├── scifa5 │ │ ├── scifb0 The above hunks are for /sys/firmware/devicetree/base/. @@ -2778,6 +2786,14 @@ │ │ └── target │ └── __symbols__ │ └── target + ├── 2 + │ ├── can_remove + │ ├── fragment@0 + │ │ └── target + │ ├── fragment@1 + │ │ └── target + │ └── __symbols__ + │ └── target └── enable The above hunk is for /sys/firmware/devicetree/overlays/ # ls -l /sys/firmware/devicetree/overlays/ total 0 drwxr-xr-x 6 root root 0 okt 19 08:49 1 drwxr-xr-x 5 root root 0 okt 19 08:49 2 -rw-r--r-- 1 root root 4096 okt 19 08:49 enable 1 is from the DT unit tests, 2 is from r8a7791-koelsch-exio-b-scifa3.dtbo, enable is the kill switch. Note that after removing overlay 2, and loading a new overlay, the new one is again called number 2. But the subdir date is newer. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds