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

Re: [PATCH] xen/arm: Skip Xen specific nodes/properties from hwdom /chosen node


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Tue, 12 Sep 2023 09:18:07 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=qTI3z+saNJaVJL2qSdIaPUg3YylWbHJV/ZNidfwunVA=; b=OrQzywIrwHL0UuIOkfcSDQ4E2ka8FoeS4DuvDNVE+fHhFN19NBG3/vyYNm5HvO2/eit36NhKIS0wCkR2xtS0gYUV6DXF3qml7IRn+3LpBVAJAe/gwX/GXw/BFPmUQWIU4Lt4uKkUJftlDqOVAeAAKrYA0sAHhXrDImPje9fo4eJE6ktAYigNVbQ7V5GFKU46j3tk+EJ2r8foTJnky7a5odCazMIhvYXTudvMJUjRfMzWmzag/u0qd0bSj5GFgV0tQLR1ty6gE/eDsSwaHZAAV4B3WHRvfaFpFWinsbd5ENRm5sxqzY6PQbZ78c6cyZZAAb420EwnTt4/6ncZancB/w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DTeHciFi+RQlYxrb3gv3S1JerOTd0qGnO7lxQvJICh8+o/EH778CoxDola8DcVSxfcgc40VQT9YBsk0ff6sgxstvrTE/4EEcHh7JczSgkEfVHwNYlozwVtKwCHySQJoHvKzAUEBXq1thmvu3chcT7+6WbZrc6lB+u9M1eDVWz5Z23XDWdU+KQ1a7QPDqv3/b1kUUxzWLCoZUvIr/RjPVn2aGjPXznqKe9U+row8blVMnEDmQbqt6rZoxVtNdLAo9H6eH7ivJb/nyYIRl8/X5uR23Q6dFcq20MOW+8Je8pj+nlsaV26ZgdrtS1d9IE/TegdZW1nEAMrXo6dKDhRq5Cg==
  • Cc: Julien Grall <julien@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "Bertrand Marquis" <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Tue, 12 Sep 2023 07:18:25 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Stefano,

On 12/09/2023 01:21, Stefano Stabellini wrote:
> Caution: This message originated from an External Source. Use proper caution 
> when opening attachments, clicking links, or responding.
> 
> 
> On Mon, 11 Sep 2023, Michal Orzel wrote:
>> On 11/09/2023 16:48, Julien Grall wrote:
>>> On 11/09/2023 15:01, Michal Orzel wrote:
>>>> Hi Julien,
>>>>
>>>> On 11/09/2023 15:14, Julien Grall wrote:
>>>>>
>>>>>
>>>>> Hi,
>>>>>
>>>>> On 11/09/2023 13:34, Michal Orzel wrote:
>>>>>> Host device tree nodes under /chosen with compatible string
>>>>>> "xen,evtchn-v1", "xen,domain-shared-memory-v1" are Xen specific and not
>>>>>> meant to be exposed to hardware domain.
>>>>>
>>>>> So, how dom0 is meant to discover the static event channel, shared
>>>>> memory it can use?
>>>>
>>>> For static shared memory:
>>>> A node with this compatible is only meant for Xen since it contains 
>>>> information like host-guest mapping.
>>>> Xen creates a different node for guests under /reserved-memory.
>>>> Linux binding:
>>>> https://elixir.bootlin.com/linux/latest/source/Documentation/devicetree/bindings/reserved-memory/xen,shared-memory.txt
>>>> Xen node generation:
>>>> https://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=xen/arch/arm/domain_build.c;hb=HEAD#l1407
>>>
>>> Ah good point. I agree with this one.
>>>
>>>>
>>>> For static event channels:
>>>> This is a bit weird so let me put it in a different way.
>>>> 1) Xen does not create any node for static evtchn for domU.
>>>> 2) The booting.txt states:
>>>> There is no need to describe the static event channel info in the domU 
>>>> device
>>>> tree. Static event channels are only useful in fully static configurations,
>>>> and in those configurations, the domU device tree dynamically generated by 
>>>> Xen
>>>> is not needed.
>>>> 3) The "xen,evtchn" property specifies the local port as well as phandle 
>>>> of domU node.
>>>> dom0 does not have access to domU nodes, therefore exposing a property 
>>>> with not existing phandle
>>>> makes me think that:
>>>
>>> You have a point for the phandle. Yet, this is the only way dom0 can
>>> find the event channel today. As we exposed it, I don't think we can
>>> remove it until we have a proper replacement.
>>>
>>> We might get away if the feature is not supported it at all. But there
>>> is no statement, so it is a little unclear whether the feature is meant
>>> to be in technical preview.
>>>
>>> In any case, I think the commit message deserve a bit more explanation
>>> as hiding "xen,evtchn-v1"/"xen,domain-shared-memory-v1" is not
>>> uncontroversial.
>>>
>>>> a) point 2) applies to dom0 as well and we should hide this node or > b) 
>>>> there is a missing property for both dom0 and domUs to tell them
>>> about static local port in a proper way
>>>>
>>>> Exposing Xen specific evtchn node only to dom0 and not to domU with 
>>>> required information happen to be found as first value
>>>> in xen,evtchn is definitely not a proper solution.
>>>
>>> My concern here is we exposed such information to dom0. So as I said
>>> above, I don't think we can simply remove it as there is no other way to
>>> find such information today.
>>>
>>> It doesn't matter that it wasn't exposed to domU.
>>>
>>>> Also, there is no Linux binding for it.
>>>
>>> AFAIK the static event channel support was not added in Linux until very
>>> recently. Also, I think the kernel doesn't directly use the static event
>>> channel. So it is possible, this is just an overlook.
>>
>> I've found this thread in which Stefano, Rahul and Bertrand agrees on not 
>> exposing
>> any dt property and the rationale behind:
>> https://patchwork.kernel.org/project/xen-devel/patch/4836304496e6fbbea41348ed8cc9fcf6b0f3e893.1648049827.git.rahul.singh@xxxxxxx/
> 
> yes it was done on purpose
> 
> 
>> I would not call exposing node to dom0 as something done deliberately given 
>> that it happens automatically by copying. So my understanding is
>> that we did not want to expose any node and dom0 case was overlooked (since 
>> done automatically).
>>
>> Exposing half the interface (from system POV) in a way it should not be done 
>> (phandle) is not great IMO.
>> In any case, if you insist on keeping xen,evtchn, I can leave with it.
>>
>> This feature is marked as tech preview with no Linux binding in place so I 
>> would not be worried.
> 
> Yes I agree. I don't think we risk breaking anything. I would remove
> that info from Dom0. Even if we wanted to expose it to Dom0, this is not
> the right way to do it...

Ok, so my understanding was correct and the code itself need no change. 
Following Julien advice to add more
information to commit msg, my proposal for it is as follows:

Skip the following Xen specific host device tree nodes/properties
from being included into hardware domain /chosen node:
 - xen,static-heap: this property informs Xen about memory regions
   reserved exclusively as static heap,
 - xen,domain-shared-memory-v1: node with this compatible informs Xen
   about static shared memory region for a domain. Xen exposes a different
   node (under /reserved-memory with compatible "xen,shared-memory-v1") to
   let domain know about the shared region,
 - xen,evtchn-v1: node with this compatible informs Xen about static
   event channel configuration for a domain. Xen does not expose information
   about static event channels to domUs and dom0 case was overlooked (by
   default nodes from host dt are copied to dom0 fdt unless explicitly marked
   to be skipped), since the author's idea was not to expose it (refer
   docs/misc/arm/device-tree/booting.txt, "Static Event Channel"). Even if we
   wanted to expose the static event channel information, the current node
   is in the wrong format (i.e. contains phandle to domU node not visible by
   dom0). Lastly, this feature is marked as tech-preview and there is no
   Linux binding in place.

~Michal



 


Rackspace

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