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

Re: [PATCH v3 2/4] docs, xen/arm: Introduce static heap memory


  • To: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Wed, 7 Sep 2022 15:31:58 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=arm.com 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=saWxUsOCnIN1GHIPpT2/IpKXb61jM2DLyBuEiVwJIl0=; b=Cz1Y3mjWQOSdErmR3AViUPD0dfznP0okrAQTj3WDeLelYAeBHNDSVmZGsa34FjvRUZwC9y2UyhRqcOWB9WF+AnWW8aJ/xPq36++44zVc/I3yNpqOKOi1gY8IWr3JbVT8l76oCfgPqkd7+LjOCHvUMxf2HMAKw3XaPVR6wHL475MxMQXa2bHGEgTMQtBAOwOnjF+Jui0Ld1+eKUJWAnlQ5ZGCo5tLCdak9Fzyy+nzh8jObLtoW0ihTEqW9/7lr2zibez6GgIMza7wu0VZiwSSwYGgj6l7T6HM5jy5TB8FULh/acl9eaqzFwLQQCVjPpRsUCYS1mpM3Ebueh0Jitlwow==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hjRaPRWunX7OAQ322uTrcVj0SZFPqk7+eCTxQZHz3wil2zJF2tqc9fdChcjtzMwWHo3wn/rmcWOomGutpUdC+hcPFjiXeY9Wiw7xvUu610a1HQYrWbelAk3uOlF57d/F9+VfnbwL4rO0LZAOHX/GLcJfzgLtz0hw00grN68UpfHwuL7sMiN1DtLb/eIlpWPUFyBY9jIipZ7lS+Z3vHRUogmy8GlKG0yuMjtoVQlMUbX6FHBB/xkehfgOJXnYRKTURdhQwF+4hdtCLy7lsIvDKtwp/suL5ePNj7QkS2d9KXBsG9j4c8PHupEqb8ExcwaXEAGVZvq/tBu8IA8kr2wLPQ==
  • Cc: Julien Grall <julien@xxxxxxx>, Henry Wang <Henry.Wang@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Chen <Wei.Chen@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Penny Zheng <Penny.Zheng@xxxxxxx>
  • Delivery-date: Wed, 07 Sep 2022 13:32:10 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


On 07/09/2022 15:28, Bertrand Marquis wrote:
> 
> Hi Michal,
> 
>> On 7 Sep 2022, at 14:09, Michal Orzel <michal.orzel@xxxxxxx> wrote:
>>
>>
>> On 07/09/2022 14:45, Julien Grall wrote:
>>>
>>> On 07/09/2022 13:41, Michal Orzel wrote:
>>>>
>>>>
>>>> On 07/09/2022 14:32, Julien Grall wrote:
>>>>> [CAUTION: External Email]
>>>>>
>>>>> On 07/09/2022 13:12, Michal Orzel wrote:
>>>>>> Hi Julien,
>>>>>
>>>>> Hi Michal,
>>>>>
>>>>>> On 07/09/2022 13:36, Julien Grall wrote:
>>>>>>>
>>>>>>> Hi Henry,
>>>>>>>
>>>>>>> While reviewing the binding sent by Penny I noticed some inconsistency
>>>>>>> with the one you introduced. See below.
>>>>>>>
>>>>>>> On 07/09/2022 09:36, Henry Wang wrote:
>>>>>>>> +- xen,static-heap
>>>>>>>> +
>>>>>>>> +    Property under the top-level "chosen" node. It specifies the 
>>>>>>>> address
>>>>>>>> +    and size of Xen static heap memory. Note that at least a 64KB
>>>>>>>> +    alignment is required.
>>>>>>>> +
>>>>>>>> +- #xen,static-heap-address-cells and #xen,static-heap-size-cells
>>>>>>>> +
>>>>>>>> +    Specify the number of cells used for the address and size of the
>>>>>>>> +    "xen,static-heap" property under "chosen".
>>>>>>>> +
>>>>>>>> +Below is an example on how to specify the static heap in device tree:
>>>>>>>> +
>>>>>>>> +    / {
>>>>>>>> +        chosen {
>>>>>>>> +            #xen,static-heap-address-cells = <0x2>;
>>>>>>>> +            #xen,static-heap-size-cells = <0x2>;
>>>>>>>
>>>>>>> Your binding, is introduce #xen,static-heap-{address, size}-cells
>>>>>>> whereas Penny's one is using #{address, size}-cells even if the property
>>>>>>> is not "reg".
>>>>>>>
>>>>>>> I would like some consistency in the way we define bindings. Looking at
>>>>>>> the tree, we already seem to have introduced
>>>>>>> #xen-static-mem-address-cells. So maybe we should follow your approach?
>>>>>>>
>>>>>>> That said, I am wondering whether we should just use one set of property
>>>>>>> name.
>>>>>>>
>>>>>>> I am open to suggestion here. My only request is we are consistent (i.e.
>>>>>>> this doesn't depend on who wrote the bindings).
>>>>>>>
>>>>>> In my opinion we should follow the device tree specification which states
>>>>>> that the #address-cells and #size-cells correspond to the reg property.
>>>>>
>>>>> Hmmm.... Looking at [1], the two properties are not exclusive to 'reg'
>>>>> Furthermore, I am not aware of any restriction for us to re-use them. Do
>>>>> you have a pointer?
>>>>
>>>> As we are discussing re-usage of #address-cells and #size-cells for custom 
>>>> properties that are not "reg",
>>>> I took this info from the latest device tree specs found under 
>>>> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.devicetree.org%2Fspecifications%2F&amp;data=05%7C01%7Cmichal.orzel%40amd.com%7C83da1eb9d32441cb9e8108da90d4f2d6%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637981541539851438%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=3M9aT3LjCEOhZUHWSbgSSmKppY1Wion4TT3BeKLnWSo%3D&amp;reserved=0:
>>>> "The #address-cells property defines the number of <u32> cells used to 
>>>> encode the address field in a child node's reg property"
>>>> and
>>>> "The #size-cells property defines the number of <u32> cells used to encode 
>>>> the size field in a child node’s reg property"
>>>
>>> Right. But there is nothing in the wording suggesting that
>>> #address-cells and #size-cells can't be re-used. From [1], it is clear
>>> that the meaning has changed.
>>>
>>> So why can't we do the same?
>> I think this is a matter of how someone reads these sentences.
>> I do not think that such documents need to state:
>> "This property is for the reg. Do not use it for other purposes."
>> The first part of the sentence is enough to inform what is supported.
>>
>> On the other hand, looking at [1] these properties got new purposes
>> so I think we could do the same. Now the question is whether we want that.
>> I think it is doable to just have a single pair of #address/#size properties.
>> For instance xen,shared-mem requiring just 0x1 for address/size
>> and reg requiring 0x2. This would just imply putting additional 0x00.
> 
> I think we want in general to reduce complexity when possible.
> Here we are adding a lot of entries in the device tree where we know that
> in all cases having only 2 will work all the time.
> 
> I am not convinced by the arguments on not using #address-cells and will
> leave that one to Stefano
> 
> But in any case we should only add one pair here for sure, as you say the
> only implication is to add a couple of 0 in the worst case.
I agree. The only drawback is the need to modify the already introduced 
properties
to be coherent.

> 
> Cheers
> Bertrand
> 
>>
>>>
>>> Cheers,
>>>
>>> --
>>> Julien Grall
> 



 


Rackspace

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