[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC PATCH v4 6/8] xen/arm: scmi: introduce SCI SCMI SMC multi-agent driver


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Oleksii Moisieiev <Oleksii_Moisieiev@xxxxxxxx>
  • Date: Wed, 25 Jun 2025 19:47:02 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=pq0deBK2atO06y7P8Q70iCCGe0BtI6RVI0qpn1FQ574=; b=SrGpbJ87hgH3Uoml7WpONy54Dd1PaxsR/PXkQOt5cXdayL8fNPxZlliZnPC9rP9KhHITG1N6hrsKXoFO5oAAOzAD5Zj3z6ecLlk0xQjvUwtLI60rswJp/SRmf2SjyX1rIR5Unk/F6+vNhUljAPJCSsHFEpMccUStDxuEDbr/J1q7YO8uKiXG43oqU8E100nPhZj8MFXQQOyuimHB0M6sEfK2AZ2RT7dHnmCtEhv8d2Aq6rxr0J9U/FjDA1Pn47LeJ8d/P3a5k2ZxTlXcevJ339fAWB/14qiZ1+86e1mRL4x6TepNw7MoPM3i5l/Xpp4BrvcgD1YtvbXSUE8LhRewIw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=iK7Yxtun2i6o05Wd1ERXr/9bIYZscElpKQjzz4zhqyDSBD87Nqed6gE7a0y3OPlPyX2tG7C6EWeQm1vAy4F2nUAJuoi9tgYBEO+FB+YPE4W5rAU48vFCyj2t2Tmsr1UhXjTE/MoLx3/xyZG6p5FcQwccC/fnZiIR5ZkOCV+Cuh14TB3YujaRU3DLD5h0lUQ7dK1cNJTLLtzWx0w0dUFLXPkWH2CWj/Md4caxMVvvav9gyp/28Uywzbafgm34H+4nlrZlAu63jZz4PvXMkPfx90LhZbEXyH0EI8MxwrLYbqhtY+MP5i0Xa4U2C4AUU/lbxns1ZKaIpepvFkLYUU+IYg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Grygorii Strashko <grygorii_strashko@xxxxxxxx>
  • Delivery-date: Wed, 25 Jun 2025 19:47:23 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHbyNXPHUV4T01ZEEC9Uxm0LaLKHbPgqpIAgB7nygCACJlwgIACrSiAgAUbw4CABI1zgA==
  • Thread-topic: [RFC PATCH v4 6/8] xen/arm: scmi: introduce SCI SCMI SMC multi-agent driver

On 23/06/2025 01:15, Stefano Stabellini wrote:
> On Thu, 19 Jun 2025, Oleksii Moisieiev wrote:
>> On 18/06/2025 02:22, Stefano Stabellini wrote:
>>> On Thu, 12 Jun 2025, Oleksii Moisieiev wrote:
[snip]
>>>>> Are you sure it is worth to go through all this trouble to modify FDT in
>>>>> place when we could simply generate the DT node from scratch like we do
>>>>> for example for the GIC? This seems to be more error prone as well. Is
>>>>> generating it from scratch is really difficult? If it is difficult then 
>>>>> OK.
>>>>>
>>>> In the last patch [0] of the series, there is a proposal to separate
>>>>
>>>>     the Xen privileged agent from the Dom0 agent. This eliminates the
>>>>
>>>> need to modify the Xen Device Tree Blob (DTB), which is a positive
>>>> improvement
>>>>
>>>> since the Dom0 agent node is already present in the device tree.
>>>>
>>>> However, the issue with SCMI node generation lies in the need to handle
>>>>
>>>> the list of protocols that are supported across the system.
>>>>
>>>> If we want to generate the SCMI node for Dom0, we need to:
>>>>
>>>> Copy these protocols from a centralized or predefined source.
>>>> Set the correct phandle for each subnode within the SCMI node, ensuring
>>>>
>>>> accurate representation and functionality.
>>>> This extra step of managing the protocols and phandles adds
>>>>
>>>> complexity but is necessary for ensuring proper support for Dom0.
>>>>
>>>> [0]
>>>> https://lists.xenproject.org/archives/html/xen-devel/2025-05/msg01041.html
>>> I was only commenting that rather than trying to modify the DT in place
>>> we could create the node for Dom0 from scratch (artificially), based on
>>> host DT information as required (fetching data from the host DT as
>>> required and copying it to the Dom0 DT).
>>>
>> The problem is that scmi node, apart from the default parameters has a
>> list of
>>
>> supported protocols which may be different for Xen and Dom0 so to
>> generate Dom0 node
>>
>> from scratch we need to copy(or even generate) these nodes which will
>> require complex implementation.
>>
>> In contrary, if we go with implementation, proposed in the last patch -
>> then we can have
>>
>> more cleaner Xen device tree, which will look like this:
>>
>> ```
>>
>> chosen {
>>
>>       scmi_xen: scmi {
>>
>>             arm,smc-id = <0x82000002>;
>>
>>             shmem= <$shm_0>;
>>
>>            ... # no protocols description here
>>
>> };
>>
>> firmware {
>>
>>      scmi {
>>
>>             arm,smc-id = <0x82000003>;
>>
>>             shmem= <$shm_1>;
>>
>>             protocol@X{
>>
>>             };
>>
>>      }
>>
>> };
>>
>> ```
>>
>> In this case, we don’t provide any protocol information for the Xen
>> agent and instead set protocols for Dom0.
>>
>> This ensures that each node has the information it requires.
> Leaving aside how we generate the device tree nodes for Dom0, which is
> of minor importance, we have two potentially conflicting goals:
>
> 1) no Xen-specific changes to Device Tree outside of /chosen
> 2) When Xen is present, Xen should be the one using the information in the 
> Host Device Tree
>
> With 1), I mean that the Host Device Tree, outside of the /chosen node,
> should be the same for the BSP (no Xen) and for Xen. That is because it
> should describe the platform, no matter the software running on it. Also
> at the time the Device Tree is generated, often it is not known if Xen
> will be running on the platform or not.
>
> With 2) I meant that ideally when Xen is present, Xen should be the one
> to use the information under /firmware/scmi, because Xen is the
> principal SCMI client. Then Xen would generate somehow the SCMI device
> tree nodes for Dom0 and the DomUs.
>
> 1) is more important than 2).
>
> >From what you wrote, it looks like the SCMI device tree nodes are
> different between Linux baremetal and Xen. If /firmware/scmi describes
> what Linux baremetal should use, then it would work for Linux baremetal
> but it would *not* work for Xen's own SCMI connection. Is that correct?
>
> If that is the case, that is unfortunate. We need to compromise on 2).
>
> I would keep /firmware/scmi as the one used by Linux baremetal because I
> think we should uphold 1) above all else.
>
> Then the Xen SCMI nodes could be placed under /chosen. This is less than
> ideal because /chosen should contain Xen/Linux configurations, not
> firmware interfaces. But it is the best we can do in a difficult
> situation.
>
> I think that whether the Dom0 device tree nodes are artificially
> generated by Xen, or copied from the Host Device Tree somewhere, it
> matters less.

I completely agree with your point. That’s why, during the discussion of
the last patch in the series, I proposed an approach

that keeps the /firmware/scmi node unchanged in the Host Device Tree
(DT) and places all Xen-related

changes inside the /chosen/xen,config node.

I plan to follow this approach in v5.

Here’s the link to the message where I provided a DT example that
ensures the /firmware/scmi node remains the same as in the Host DT: [0].

[0]:
https://lists.xenproject.org/archives/html/xen-devel/2025-06/msg01421.html

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.