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

Re: [PATCH 1/2] docs, xen/arm: Introduce reserved heap memory


  • To: Henry Wang <Henry.Wang@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Tue, 30 Aug 2022 09:10:41 +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=ECVxWzbQf30V0mfSPDDiyEcG2uJMSylwj6gohYM28v0=; b=FURrR3sgpwVks212SVAW1ImRxSisQsHOOvMb52F1jmyzUz0z4bSrHMlMU57tk76/6W+PNNcQSCLyND2mnpsKTSgFAKaXKy1dLYkgj08R7PXiQ//HXntXA5TlYrvsLQr1kC/wzLqvpGRLCg4sbDy6DkAdm7G7Rn+S9w02hGtNecfmZ6ALncAdPN/o6UZSFXNYh/bfGcwWUk/T7r6jooU+8xbUfbh6/AJi9ro/CyfZdd+5bRwYtd84tKiCLc+bjKIsmdGt7/juKkoo8rQI7kMyE4jQDFDU+AeAhO7oNo3KS7beWpTwCm31/sVYt8qelweu//oDV2JbCQAjOCO+oNGIVA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VAlOeHbF62y4YAbcOZuMngzitiiCgtXAd0bEGhvixZZtI7U1i+fHnXlngeIqzVunlaFiM2me457X3R1WUGqk95Luw0UgoZuvaPOXt0jlVf8H/TmnDud4fWf6icQPilRccOkMKyG+AznFlgKH0swnr0cS/HnTP97+3tWaCmCXh26mu7zEbHth8WFNiZe/sMnGWE2LT8plW8TyF6RHXaz/c79HuK4Or+1wATmmuYKIRI5IYCVjdQsu3zXFdfmDcM5JR7ZTt0zgfZkRw7f+qlDf3aWKFT8gchVxck0jpu3WqCYkwckN4ztomGeDbn5uUBYd23BcquZ3GVOorL+lSiyyNw==
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "Julien Grall" <julien@xxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Wei Chen <Wei.Chen@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, "Penny Zheng" <Penny.Zheng@xxxxxxx>
  • Delivery-date: Tue, 30 Aug 2022 07:11:20 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 30/08/2022 08:29, Michal Orzel wrote:
> Hi Henry,
> 
> On 30/08/2022 02:58, Henry Wang wrote:
>>
>> Hi Stefano and Michal,
>>
>>> -----Original Message-----
>>> From: Stefano Stabellini <sstabellini@xxxxxxxxxx>
>>> Sent: Tuesday, August 30, 2022 8:47 AM
>>> To: Henry Wang <Henry.Wang@xxxxxxx>
>>> Cc: Michal Orzel <michal.orzel@xxxxxxx>; xen-devel@xxxxxxxxxxxxxxxxxxxx;
>>> Stefano Stabellini <sstabellini@xxxxxxxxxx>; Julien Grall <julien@xxxxxxx>;
>>> Bertrand Marquis <Bertrand.Marquis@xxxxxxx>; Wei Chen
>>> <Wei.Chen@xxxxxxx>; Volodymyr Babchuk
>>> <Volodymyr_Babchuk@xxxxxxxx>; Penny Zheng <Penny.Zheng@xxxxxxx>
>>> Subject: RE: [PATCH 1/2] docs, xen/arm: Introduce reserved heap memory
>>>
>>> On Thu, 25 Aug 2022, Henry Wang wrote:
>>>>>>                                         const char *name,
>>>>>>                                         u32 address_cells, u32 
>>>>>> size_cells)
>>>>>>  {
>>>>>> @@ -301,16 +303,40 @@ static void __init process_chosen_node(const
>>>>> void *fdt, int node,
>>>>>>      paddr_t start, end;
>>>>>>      int len;
>>>>>>
>>>>>> +    if ( fdt_get_property(fdt, node, "xen,static-mem", NULL) )
>>>>>> +    {
>>>>>> +        u32 address_cells = device_tree_get_u32(fdt, node,
>>>>>> +                                                
>>>>>> "#xen,static-mem-address-cells",
>>>>>> +                                                0);
>>>>>> +        u32 size_cells = device_tree_get_u32(fdt, node,
>>>>>> +                                             
>>>>>> "#xen,static-mem-size-cells", 0);
>>>>>> +        int rc;
>>>>>> +
>>>>>> +        printk("Checking for reserved heap in /chosen\n");
>>>>>> +        if ( address_cells < 1 || size_cells < 1 )
>>>>> address_cells and size_cells cannot be negative so you could just check if
>>>>> there are 0.
>>>>
>>>> In bootfdt.c function device_tree_get_meminfo(), the address and size cells
>>>> are checked using <1 instead of =0. I agree they cannot be negative, but I
>>> am
>>>> not very sure if there were other reasons to do the "<1" check in
>>>> device_tree_get_meminfo(). Are you fine with we don't keep the
>>> consistency
>>>> here?
>>>
>>> I would keep the < 1 check but it doesn't make much difference either
>>> way
>>
>> I also would prefer to keep these two places consistent and I agree Michal is
>> making a good point.
> I'm ok with that so let's keep the consistency.
Actually, why do we want to duplicate exactly the same check in 
process_chosen_node that is already
present in device_tree_get_meminfo? There is no need for that so just remove it 
from process_chosen_node.

> 
>>
>> Kind regards,
>> Henry
>>
> 
> ~Michal



 


Rackspace

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