Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp2427689pxm; Fri, 25 Feb 2022 01:33:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJxWE9wF25G9AzodTWDIkTjivM20pS09sNqcdYThtfRVHVnuVjPYEYnFZGnJDUmD5C/7ZY3M X-Received: by 2002:a65:5a8e:0:b0:365:3b6:47fb with SMTP id c14-20020a655a8e000000b0036503b647fbmr1729463pgt.147.1645781638089; Fri, 25 Feb 2022 01:33:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645781638; cv=none; d=google.com; s=arc-20160816; b=DdIQLc8Lr9B/5p8+C0vqExUAomJeBrVktgjXZsLe8xkO7nvbXEEYPxsdsbkmctbXFU cXB5051Z3X/OrMr24kP49W6woazb+ncMi+qhLLzGtIgURzNjLrhsKVr4rrGv4BnTfkgb OxC9jJeasou1/RmgHA1N9ps+kRZphtO4Uc078nnbGe23mXbF/N6WE2WnenzWWS3anc6t FnpZmKXiHcu7KlJf1dESyftf7AWdXFv/gxuWcSYcBvzm/2LVTSs61SOWN5YNxDYKnL/q dRCMMwREHj2bcJeYJY1McFgVUwpkks2yfQkI4F68CekAdnpJXX+X5y0QphNwzG/UZTtl bG7A== 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=tx3jJYzi1pO4ReKeG37oE3XbAbicAcKQ2oHodwokeYg=; b=VSjv0c+HT4s5IG4cWf0dyrENjDrU3PLTUuqWE+TZTE5GVXPlu7LTG/mM90Y65yDKsx k7wzHauI7LSLhWhsW6fIv41OF+t471hSlIDsDu9PIY+3oef4dCK3Zr4KfNAc3gpPylMg eDfsYz3Jw0EHID9XYH4Nm5d1EJ2Q0Y8kPdyPjgJUEA54z8tNlW0iGENFKqoAJ4hSClJt 7waTQWK+QtXyDa851ItiG2tCoadnSdDcMW4VvWAx1pLy/kvy6PVEjnLsQpzq2M99McN5 FVCvwCBNzFVWq1gCBcE4XtA7G656RYkhAdRiIpNzOfHpek+yBCoVB2WWpsMg8Aj7NKTv F9Eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oO1DeX5Q; 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 j7-20020a170902da8700b0014f1636c8a7si1595309plx.77.2022.02.25.01.33.33; Fri, 25 Feb 2022 01:33:58 -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=oO1DeX5Q; 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 S235818AbiBXWwU (ORCPT + 99 others); Thu, 24 Feb 2022 17:52:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235465AbiBXWwS (ORCPT ); Thu, 24 Feb 2022 17:52:18 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41363286EB; Thu, 24 Feb 2022 14:51:46 -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 ams.source.kernel.org (Postfix) with ESMTPS id ED2FEB829B0; Thu, 24 Feb 2022 22:51:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 31E15C340E9; Thu, 24 Feb 2022 22:51:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645743103; bh=P9qcOemBY8u888uY/b/Wuuv4yBCQnVd4boIuuS7cnNA=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=oO1DeX5QvOxenx0MYZgsizhTiYOeT5Wpi8TK6AkK7Ze6EbkDamOHOoyVhnmV4Cpbj RATgZ9nG4pWwD2RnmW9IxNVU/+Tt+kS+Y7/aug4aQhK0fv+Wutcsli9JUb25Pi+Rt/ mFvj+YFI2Pxy9Q6gT0HYtIVc5xt3u2LGl6NpNWw1wEbjkGDz0HLrnCxHNvaft+wKNr i9SLt7UWF+T79G3gk9IxQcb2zNiwFFp5IgjvYMz4MwHcxZnOSg8l5G5hECmwLsoGep QR4BbV+HjlEBBJ3swzVgd2zlArUN1jcfQW0F+YWpxLCYyAFAMxV6688dnjgD3mhqFE jVdUcYOLDdRWQ== Date: Thu, 24 Feb 2022 14:51:42 -0800 (PST) From: Stefano Stabellini X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop To: Sudeep Holla cc: Oleksii Moisieiev , Cristian Marussi , "robh+dt@kernel.org" , "devicetree@vger.kernel.org" , Stefano Stabellini , Vincent Guittot , Souvik Chakravarty , "linux-kernel@vger.kernel.org" Subject: Re: [RFC PATCH 0/1] dt-bindings: arm: Add scmi_devid paramter for In-Reply-To: <20220224115443.fwhczfvm3cfwoim7@bogus> Message-ID: References: <20220222110003.GC21915@e120937-lin> <20220222160637.yn6pru4nfgwih23j@bogus> <20220222171549.GA2194063@EPUAKYIW015D> <20220224115443.fwhczfvm3cfwoim7@bogus> 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, Sudeep Holla wrote: > On Tue, Feb 22, 2022 at 05:15:49PM +0000, Oleksii Moisieiev wrote: > > Hi Sudeep, > > > > On Tue, Feb 22, 2022 at 04:06:37PM +0000, Sudeep Holla wrote: > > > Hi Oleksii, > > > > > > My initial feedback on this. And thanks Cristian for making it so easy as > > > you have covered most of the things in depth(which I might have not done > > > myself that well) > > > > > > On Tue, Feb 22, 2022 at 11:00:03AM +0000, Cristian Marussi wrote: > > > > On Mon, Feb 21, 2022 at 05:26:46PM +0000, 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. > > > > > > I prefer you had given more details on your usage model here instead of > > > pointing to the other Xen thread as it helps for someone without much > > > background on Xen or your use-case to review this. > > > > > Let me describe the process in few words: > > We implemented a new feature, called SCI-mediator in Xen. > > The proposed implementation allows Guests to communicate with the Firmware using SCMI > > protocol with SMC as a transport. Other implementation are also > > possible, such as SCMI-Mailbox, SCPI-mailbox etc. > > > > In this feature Xen is the Trusted Agent, which receives the following > > information in Xen device-tree: > > 1) All channels should be described, each channel defined as > > arm,scmi-shmem node; > > 2) Scmi node arm,scmi-smc with protocols description; > > Sounds good so far. > > > 3) scmi-devid should be set in nodes, which works through SCMI. > > > > Why is this needed for Guest OS, you need not populate this if Guest OS > is not required to use it, right ? If it is needed just by Xen hypervisor, > lets talk about that and why it is bad idea to mix that with general > SCMI bindings. I'll try to help Oleksii by answering here, I hope I am not off the mark :-) I think Sudeep is right, scmi-devid is not needed by the guest OS. The host device tree is a more interesting discussion. As the host device tree is meant to be generic and not tied to a specific version of Linux, it should fully describe the SCMI interface available. If the device tree is provided to a Trusted Agent, then it should also have the scmi-devid information, right? > > On start Xen inits itself as trusted agent and requests agent > > configuration by using BASE_DISCOVER_AGENT message. This message is sent > > to each configured channel to get agent_id > > > > On Domain creation stage Xen will do the following steps: > > 1) Assign channel to the Guest and map channel address to the Domain > > address. For the Domain this address should be the same; > > 2) Generate arm,scmi-shmem and arm,scmi-smc nodes if needed for Guest > > device-tree (the device-tree which should be passed to the Guest); > > 3) Process devices, which are passed through to this Guest and set > > BASE_SET_DEVICE_PERMISSIONS for the scmi-devid, received from the > > device-node; > > > > I am confused here. So the Xen knows which devices are assigned to each > Guest OS but doesn't know device ID for them, but relies on the device > tree node ? Which devices go to which guest OS is a user-provided configuration. For instance, a user can say: "assing /amba/ethernet@ff0e0000 to dom1". This is normal and not related to SCMI: when a user configures a static partitioning system, they decide which resources belong to which domain. So Xen is told that /amba/ethernet@ff0e0000 is supposed to go to dom1. Xen proceeds to map memory and interrupts corresponding to /amba/ethernet@ff0e0000 to dom1. So far so good. What about SCMI? In Oleksii's design, Xen is going to assign one of the available SCMI channels to dom1 and restrict its permission to only /amba/ethernet@ff0e0000. To do that, Xen needs to know the scmi-devid of /amba/ethernet@ff0e0000. As far as I can tell there is nothing Xen-specific in this activitity, that's why I asked Oleksii to reach out to the upstream device tree community to improve the generic bindings for everyone's benefits.