Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp2040042pxm; Thu, 24 Feb 2022 15:00:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJyQW2s9uEPk2377SAHj5kZh9NC9k+zjurZQ+48AnbaEXOAAyNtQjk9xpCMX/KosI4h8Mupu X-Received: by 2002:a17:902:d2c6:b0:150:128:b276 with SMTP id n6-20020a170902d2c600b001500128b276mr4878061plc.5.1645743606932; Thu, 24 Feb 2022 15:00:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645743606; cv=none; d=google.com; s=arc-20160816; b=UlqF+pbPDC9QULCgZgeeWT9Q96pYILsZ6p5Ch/4sdqMS4QLmvEtn7Z5pEsuCJORCo9 d0ev6hMKd+wGRh7GTTtfBAA6bGxFYFHPRJ8lPLbihCfQUQ7Kbcj5k6osdT2WaGFVplYH vnH1mqT/tihckBfICCdrb1qX4ZbwKTYWzwJxZY+FSdvecHQwIhF1eIrkELBAh0I1zVaa wqvj/G/T0ZWV/4JtlI/5FGxreBsX6frnAdRNs7qQ/JTky2FTVvN4q0B+NCDhgN9jW2wt 1WYZToulWt2ftUJY/LZ+1P1uB3tzJ2kX6Gxtc77r7EdSc0YnaOHQR56TDebPIBQnxLje oNMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date:dkim-signature; bh=E4O5YlUgiUaSwA2t8uPGB84m5pEZNfY2QZGeYDNbJdQ=; b=AsKeyD0mcXCFPs98Qe+LpPbcjGtalgxDNsSmnKhQy1+g60s70wBpT+j1B1Z15fiYHu d9TcADOULZqxPkrWts8LTR6PvmBhgGYLA6PCuR2DAxzOJxNyyIAuQTgmb/I+Bb3aqZ+n fING5aVDRIbW4FitksvwIoL6WZh/KVfWqJVva+UktmnSd8Z+kaZZtsP4bBS2yXMp1CA6 A9hfzUbsiq6XVqZ4JLOgm5QU7L/juh3CDFE7fnNw5bWLV9L1zILTB1fywUvkvC49Yc4U 5jniyKIIEvjXH7m6sIpRK3TcIf7ilP1XVXmcHJuTZtxewhh+rOAjzuwYch0RF9mFVTHe xfnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Daxs+iSj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s7-20020a056a0008c700b004f13ac64653si421692pfu.109.2022.02.24.14.59.51; Thu, 24 Feb 2022 15:00:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Daxs+iSj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235417AbiBXWXC (ORCPT + 99 others); Thu, 24 Feb 2022 17:23:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230052AbiBXWXB (ORCPT ); Thu, 24 Feb 2022 17:23:01 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 573FF1F6379; Thu, 24 Feb 2022 14:22:30 -0800 (PST) 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 dfw.source.kernel.org (Postfix) with ESMTPS id E891961B1D; Thu, 24 Feb 2022 22:22:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D9B62C340E9; Thu, 24 Feb 2022 22:22:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645741349; bh=UxMxEvfG8FtNiZ24bFbTag8u0+nLYjbUUydetdA6CbA=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=Daxs+iSjfMuGxnp8faDDRFDiHBP/NyvqTqbtoyXY3IloKURZ8+hgDbN+Rji6li356 F7FH4q2VMz0ryZDVuBh09CsQVfyLGzc4os9xpf3peUF5+GLMrAMDQce5XTagN2y8Ws ItxrleLcIi1yWfoGqgK6j9IIZsDnNfpK+h88wq4I/xmROqvqGo9d3tlknWePz/h2RW pH2YJNMypC5YV4gvAYBYILN9wBcslk0Up4ggdFGZwT9DI6eBQGTeVm2zr+slOdRik2 dmpojRhyKAZ8f67BS+M/6XyOBFs9AfvRJD1/3mNHFD3Yc64ETJM/jAvKxiP0/2whJ7 5XyIXU/9IbQgw== Date: Thu, 24 Feb 2022 14:22:28 -0800 (PST) From: Stefano Stabellini X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop To: Cristian Marussi cc: Stefano Stabellini , Oleksii Moisieiev , Sudeep Holla , Krzysztof Kozlowski , "robh+dt@kernel.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [RFC PATCH 0/1] dt-bindings: arm: Add scmi_devid paramter for In-Reply-To: <20220224093232.GA12053@e120937-lin> Message-ID: References: <2546477f-4190-e838-3095-f47b31802445@kernel.org> <20220221213932.GA164964@EPUAKYIW015D> <7f17ab8f-429f-d2e0-8f5f-bfa2dd19cc49@kernel.org> <20220222161440.xadrgjftdyxenxgo@bogus> <20220222173458.GA2310133@EPUAKYIW015D> <20220224093232.GA12053@e120937-lin> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Thu, 24 Feb 2022, Cristian Marussi wrote: > On Wed, Feb 23, 2022 at 06:51:59PM -0800, Stefano Stabellini wrote: > > On Tue, 22 Feb 2022, Oleksii Moisieiev wrote: > > > On Tue, Feb 22, 2022 at 04:14:40PM +0000, Sudeep Holla wrote: > > > > On Tue, Feb 22, 2022 at 09:06:25AM +0100, Krzysztof Kozlowski wrote: > > > > > On 21/02/2022 22:39, Oleksii Moisieiev wrote: > > > > > > Hi Krzysztof, > > > > > > > > Hi Stefano, > > > > > > > On Mon, Feb 21, 2022 at 10:01:43PM +0100, Krzysztof Kozlowski wrote: > > > > > >> On 21/02/2022 18:26, Oleksii Moisieiev wrote: > > > > > >>> Introducing new parameter called scmi_devid to the device-tree bindings. > > > > > >>> This parameter should be set for the device nodes, which has > > > > > >>> clocks/power-domains/resets working through SCMI. > > > > > >>> Given parameter should set the device_id, needed to set device > > > > > >>> permissions in the Firmware. This feature will be extremely useful for > > > > > >>> the virtualized systems, which has more that one Guests running on the > > > > > >>> system at the same time or for the syestems, which require several > > > > > >>> agents with different permissions. Trusted agent will use scmi_devid to > > > > > >>> set the Device permissions for the Firmware (See Section 4.2.2.10 [0] > > > > > >>> for details). > > > > > >>> Agents concept is described in Section 4.2.1 [0]. > > > > > >>> > > > > > >>> scmi_devid in Device-tree node example: > > > > > >>> usb@e6590000 > > > > > >>> { > > > > > >>> scmi_devid = <19>; > > > > > >>> clocks = <&scmi_clock 3>, <&scmi_clock 2>; > > > > > >>> resets = <&scmi_reset 10>, <&scmi_reset 9>; > > > > > >>> power-domains = <&scmi_power 0>; > > > > > >>> }; > > > > > >> > > > > > >> And how do you prevent DT overlay adding such devid to any other node > > > > > >> thus allowing any other device to send requests with given devid? > > > > > >> > > > > > > Thank you for the quick response. > > > > > > scmi_devid value will be used only by Trusted Agent when the device > > > > > > permissions are set. Non-trusted agents, which in our case are > > > > > > represented as Guest OS are using scmi drivers, already present in linux > > > > > > kernel, ignores scmi_devid and uses scmi_clocks, scmi_power, scmi_reset > > > > > > nodes to access to SCMI protocol. > > > > > > > > > > Ah, ok. > > > > > > > > > > > > > > > > >> Plus few technicalities: > > > > > >> 1. Hyphen, not underscore in property name, so scmi-devid. > > > > > > > > > > > > Thanks for the tip, I will change that in v2. > > > > > > > > > > Few more thoughts: > > > > > 1. This looks specific to ARM SCMI, so you also need vendor prefix, so > > > > > something like: > > > > > arm,scmi-devid > > > > > arm,scmi-device-id > > > > > > > > > > > > > Keeping the other discussion separate, I wanted to comment on this. > > > > I agree with Krzysztof on having vendor specific prefix if we decide to add > > > > this device id thing. However, I prefer not to use "arm,scmi-" here. > > > > It can be "xen,scmi-" as we had plans to introduce some concepts in SCMI > > > > spec that may use looks like this device-id. I would just like to avoid > > > > conflicting with that in the future. It may happen to be same in the future > > > > (i.e. this xen device-id matches 100% with definition of device-id we might > > > > introduce in the spec, but I want to make assumption otherwise and leave > > > > scope for divergence however small/little it can be). No issues even if > > > > they converge and match 100% later in the far future. > > > > > > > > > > xem,scmi- works for me. What do other thinks? > > ^ xen,scmi- > > > > If this problem was Xen specific, then it would be fine to use xen,scmi- > > As Xen developer, it solves my problem and I am fine with it. > > > > However, from a device tree and SCMI point of view, it looks like this > > problem is generic and it just happens that Xen is the first > > implementation to encounter it. > > > > Cristian wrote: "The SCMI spec does not indeed cover the discovery of > > such devices and the related associated resources: it indeed delegates > > such description to FDT/ACPI as of now." How is that supposed to happen > > today with the current DT definitions, regardless of Xen? Is it a gap in > > the current device tree binding? > > What I meant is that in fact SCMI device IDs are NOT needed in the Linux > Kernel DT, in fact also this series does not add any code using it and > there is no code as of now in Kernel to issue BASE_SET_DEVICE_PERMISSIONS > commands; Linux Guest OS in the above scenario is a Non-Trusted agent and > doesn't need to know SCMI DevIDs and must NOT have access to those IDs for > security reasons too (as Sudeep was saying): the Trusted Agent (XEN here) > and the SCMI platform server are the only ones required to share the > knowledge of such Device IDs (and how the related resources are grouped) > via some HW description scheme as you are doing indeed in XEN. > > So, while on one side such device IDs discovery is delegated by the spec > to the HW description mechanisms, it seems just not needed in Kernel DT > given the kind or role it has as an SCMI agent in this context: as said > in fact there won't be any use as of now in Linux of such DT entries as > of now. I see. This is one of those "difficult" cases where the device tree binding is needed but it is not used by the Linux kernel. (We have a few cases like this in system device tree and the more device tree gets adopted by other projects the more will see instances like this one.) In that case, I think it is OK to call it "xen,scmi-" if Rob also agrees. After all, we are currently using in Xen a property called "linux,pci-domain". We might as well have Linux in the future use a property called "xen,scmi-devid" to even things out :-)