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

Re: [PATCH 12/37] xen/x86: decouple nodes_cover_memory from E820 map


  • To: Wei Chen <Wei.Chen@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 27 Jan 2022 10:22:29 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=roLsfW5BYtLkyJsUdQFvcHZ6aAyOjF7GMt7sZWiTRZA=; b=mJbyFg/Tf5HSgXP6QKvmVnz9Skklmm/aG3KI+Vi7+DJWItBtHgej2ZnsC3tGtHL+seae9Ywi1Bc1wUHVXInrB2TsBmiNIHvcP46I8o6NFgfrz0612fqRTqi4CdC0oqvwSfNZgQOZaWh9hKTIVq9r/6VrJKPF7LmgDfH91L7TD8/MzGjk4w5o+o0KSJ23BdUdYjpmV1MnbDBm5lBdDliLjeWnBnfVkNYloeonq+FrhFKI3OKvA9isAw0OiiY1H1ssBqtpNpthslkEMefvyTXaD55l2+NOmhw+iii0oRkNwjesebQMyOOj4sZVRN0KZN8oxzPejp7zsrUs7Pjibj3/zg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AIgo/tF/2BrYg9ywiyLvnEAHDIQ8cET+g54vKDN0jhWXUuMgGUUskxK73MOjC158mJNWj+VpG7wZ5omvrXM4FjM5eNoU/nqRVU60LayRVYGy65GzoFDBY64YrdrIBdc14pIDkHegrqyrnX6UyNOIgBXZU6YXJslyRkOJ8LxYKgQuHOUW+TOyzfbGAHtGOWraPf5QQgVWyzFKpmX6/V+r8VeryzxZAO3vl+qC8ATUC5056KLSURCeX8z+C6GU03GsB8YWjIKmKQG4QKdh7q231OyYw0KNR+V8UbMTLJJ1vP0KZzXUnSA5r2KuqJjMBfJ6B4Axv8QZdk3t8ys5jCGu+Q==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>, "julien@xxxxxxx" <julien@xxxxxxx>
  • Delivery-date: Thu, 27 Jan 2022 09:22:42 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 27.01.2022 10:03, Wei Chen wrote:
>> From: Jan Beulich <jbeulich@xxxxxxxx>
>> Sent: 2022年1月27日 16:09
>>
>> On 27.01.2022 09:03, Wei Chen wrote:
>>>> From: Jan Beulich <jbeulich@xxxxxxxx>
>>>> Sent: 2022年1月25日 0:59
>>>>
>>>> On 23.09.2021 14:02, Wei Chen wrote:
>>>>> We will reuse nodes_cover_memory for Arm to check its bootmem
>>>>> info. So we introduce two arch helpers to get memory map's
>>>>> entry number and specified entry's range:
>>>>>     arch_get_memory_bank_number
>>>>>     arch_get_memory_bank_range
>>>>
>>>> I'm sorry, but personally I see no way for you to introduce the term
>>>> "memory bank" into x86 code.
>>>
>>> In my latest changes, I have updated these two helpers to:
>>> uint32_t __init arch_meminfo_get_nr_bank(void)
>>> __init arch_meminfo_get_ram_bank_range(...)
>>> I am sorry, I forgot to change the commit log accordingly.
>>> I will update it in next version.
>>
>> I'm sorry for the ambiguity of my earlier reply, but my objection was
>> against "bank", not "memory". As an aside, you also don't want the
> 
> How about arch_meminfo_get_nr_map/ arch_meminfo_get_map_range?
> I am sorry, I am not very familiar with e820 map, could you
> give me some suggestions?

First of all I don't think you need a "get_nr" function at all, which
eliminates the need to find a good name for it. The "get_range" function
can easily provide back a unique indicator when the passed in index is
beyond the number of regions. For this function's name, how about
arch_get_memory_map() or arch_get_memory_map_block() or
arch_get_memory_map_range() (in order of my personal preference)?

Jan




 


Rackspace

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