Received: by 10.223.164.202 with SMTP id h10csp608351wrb; Thu, 30 Nov 2017 04:47:16 -0800 (PST) X-Google-Smtp-Source: AGs4zMZoP/BrEJPfVqixWOV3hdYc/i+5tyWdU1dQTtfINDSCkSaFuAirAILYem0PFRFyX1Z7YvnN X-Received: by 10.159.231.24 with SMTP id w24mr2372283plq.272.1512046036076; Thu, 30 Nov 2017 04:47:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512046036; cv=none; d=google.com; s=arc-20160816; b=dZJo9jKS0UyjXNu1bMZtc5HelBPBfzEmb2vfWzvLDPQXZ4LdZU6jekaqnn18efrtLB 7heKQ2h5a5WHODLwB5Vgco5jCc66++hn2lrvwVp44lT4YIcAlCtU2Dc6nBTrBnWrxs2l bd0oLBwLSxGL5yPY0jONTsQXyZYu9CBDljp6usAgfFSpWTVskFMu6J4W2pHVks4+H25K Bv5v2GHYcCVNBIDkNJjqdZbfy+88rLTd+hmIcjlzpWtQwkRLgiI3R0r00I/+ZtWAPf4v dXy4T8YEeDDjHWIhXDohliEkSYiozRIINvTZSAyhC29aBrl8DRHldk6SCg49nbZZfds3 7lqA== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=I3fM8U301FEx4he95SDpVldFsWwulKe5fI2AGItCl0s=; b=wdzZzRuxwbHUnM31WOwTVoAqw/h3g2m3W3OovLndYnMJgyoDk1kr5rVEOBJ94779kf cGCSVUuiu3UMNmY1Xj44q2Irt80Njzd2nbgE+v6/DWzBK7QK247sJYUWbaKuUR9rFuFI okFksDntHaylLFM3ubcc2laib6kU4uz01k5yktrd4NSoSWtHfo6u5YgdwyfBSp/ZowbK CoAUXrJF8HzwY8j0ifj0TIJWN2BKgXkCDUIcKbGROdUiFmjoYD1pvWQP123vlyRBHwe5 dd2ZF5YyZRIGPnpjfRgFtCep5BIvfwEHthZ0UqTIsXxE68jC1efxZkf9GvbL6LwV0yD2 QO4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nWe6vRDq; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u28si3158017pfl.125.2017.11.30.04.47.01; Thu, 30 Nov 2017 04:47:16 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=nWe6vRDq; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752261AbdK3Mqw (ORCPT + 99 others); Thu, 30 Nov 2017 07:46:52 -0500 Received: from mail-pl0-f67.google.com ([209.85.160.67]:33658 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750890AbdK3Mqu (ORCPT ); Thu, 30 Nov 2017 07:46:50 -0500 Received: by mail-pl0-f67.google.com with SMTP id q7so4191302plk.0; Thu, 30 Nov 2017 04:46:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=I3fM8U301FEx4he95SDpVldFsWwulKe5fI2AGItCl0s=; b=nWe6vRDquTI4JDiUhHDt3oTazMp4PM8EMeqLX3a9d6Aw6UrVS1VBwWaMzpxVT2HVY5 /0evtOV6OFz/5mdacTwVdPT2f27V/cGyf8/MY/U+xvC5yP3Jm5Qx9EP3wqZXmUlfjNFA OjfX5OUzB25+5+23c5xuxpilpGmWjUuAerQYO2tEbe4aV6EDfCdyAqXjOXIsOHhE+gao 3nZS7Z+06uyqrHek0cMb7jvlos+4FXWdEVBZ8+67UqpJA5ae+02w8aqeOPisK/D3WLFN ZBzQYfLD05YsxVUjCb5jtKHxwQPaFlGaWu9pCi00Y2gAEFhfszOKMEm7zNY+JgWOJ0wO VC+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=I3fM8U301FEx4he95SDpVldFsWwulKe5fI2AGItCl0s=; b=ISVjTSOLS29A483Z6mlRj8IjFmOyqnWG19WoObezQsBohi7r4MF/kj0WSi/63rNGI6 DyD7S5rFYI+IOA4CAHIiayL5XoshsqUg3ILdk984pla7bkWUuf5kYG0I8OWCnfhmvmhW wCQbFjP/O2zAD2ieMNYtpO+ZPMgzz6P0YDx8wkOv+IO+Ce4KCDPWwtLTSQjAYC8l1Q1t h8DbGIUOwlU4nfTsuoSN0FRvtcUMDFcbkxVLlg4CH94T5KXP+pAvM21zGFKojj4+oH3T fkOCWV3Cp1CUtNhhRL0aA0/o1Ff/LZkWpnzP+tw8ZxJS272pgc+w/IauQBTw7cJaMJ01 Bn1w== X-Gm-Message-State: AJaThX7x+bBRVhEEt5td8yQX2dOKf/YH46SRW/nS2H9Er+UxcY/aMInk cucbn20CI5dvWYq+ubT+b0nky0NN X-Received: by 10.84.128.36 with SMTP id 33mr2564393pla.329.1512046009622; Thu, 30 Nov 2017 04:46:49 -0800 (PST) Received: from [192.168.43.210] (mobile-166-170-39-52.mycingular.net. [166.170.39.52]) by smtp.gmail.com with ESMTPSA id m22sm7834764pfg.120.2017.11.30.04.46.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Nov 2017 04:46:49 -0800 (PST) Subject: Re: [RFC 0/2] of: Add whitelist To: Alan Tull , Rob Herring Cc: Pantelis Antoniou , Moritz Fischer , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , linux-fpga@vger.kernel.org References: <1511816284-12145-1-git-send-email-atull@kernel.org> From: Frank Rowand Message-ID: <24161ebf-81be-bec7-9fe8-36279a8b5a8d@gmail.com> Date: Thu, 30 Nov 2017 07:46:36 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/29/17 11:11, Alan Tull wrote: > On Wed, Nov 29, 2017 at 7:31 AM, Rob Herring wrote: >> On Wed, Nov 29, 2017 at 3:20 AM, Frank Rowand wrote: >>> On 11/27/17 15:58, Alan Tull wrote: >>>> Here's a proposal for a whitelist to lock down the dynamic device tree. >>>> >>>> For an overlay to be accepted, all of its targets are required to be >>>> on a target node whitelist. >>>> >>>> Currently the only way I have to get on the whitelist is calling a >>>> function to add a node. That works for fpga regions, but I think >>>> other uses will need a way of having adding specific nodes from the >>>> base device tree, such as by adding a property like 'allow-overlay;' >>>> or 'allow-overlay = "okay";' If that is acceptable, I could use some >>>> advice on where that particular code should go. >>>> >>>> Alan >>>> >>>> Alan Tull (2): >>>> of: overlay: add whitelist >>>> fpga: of region: add of-fpga-region to whitelist >>>> >>>> drivers/fpga/of-fpga-region.c | 9 ++++++ >>>> drivers/of/overlay.c | 73 +++++++++++++++++++++++++++++++++++++++++++ >>>> include/linux/of.h | 12 +++++++ >>>> 3 files changed, 94 insertions(+) >>>> >>> >>> The plan was to use connectors to restrict where an overlay could be applied. >>> I would prefer not to have multiple methods for accomplishing the same thing >>> unless there is a compelling reason to do so. >> >> Connector nodes need a mechanism to enable themselves, too. I don't >> think connector nodes are going to solve every usecase. >> >> Rob > > The two methods I'm suggesting are intended to handle different cases. > There will exist some drivers that by their nature will want every > instance to be enabled for overlays, such as fpga regions. The other > case is where drivers could support overlays but that's not the > widespread use for them. So no need to enable every instance of that > driver for overlays. I understand what the paragraph, to this point, means. But I had to read it several times to understand it because the way the concept is phrased clashed with my mental model. The device node is not an instance of a driver, which is why I was getting confused. (Yes, I do understand that the paragraph is talking about multiple device nodes that are bound to the same driver, but my mental model is tied to the device node, not to the driver.) If each of the device nodes in question is a connector, then each of the nodes will bind to a connector driver, based on the value of the compatible property. (This is of course a theoretical assumption on my part since the connectors are not yet implemented.) If the connector node is an fpga, or an fpga region (I may be getting my terminology wrong here - please correct as needed) then an fpga overlay could be applied to the node. If I understand what you are saying, there will be some fpga connector nodes for which the usage at a given moment might be programmed to function in a manner that will not be described by an overlay, but at a different moment in time may be programmed in a way that needs to be described by an overlay. So there may be some times that it is valid to apply an overlay to the connector node and times that it is not valid to apply an overlay to the connector node. Is my understanding correct, or am I still confused? -Frank > In that case the DT property provides some > granularity, only enabling overlays for specific instances of that > driver, leaving the rest of the DT locked down.> > If we only want one method, I would choose having the DT property only > and not exporting the functions. Users would have to add the property > for every FPGA region but that's not really painful. This would have > the benefit of still keeping the DT locked down unless someone > specifically wanted to enable some regions for overlays for their > particular use. > > Alan > From 1585493412004888550@xxx Thu Nov 30 12:19:05 +0000 2017 X-GM-THRID: 1585254667994231857 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread