[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: Mon, 24 Jan 2022 17:59:11 +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=NzZ8mjlOIwf2cNrcjrv/9Do3m54VXE2nx+kyuWI2BiU=; b=NrLhE4fonTYjjNLmGHYc5iATIsOGxsV/5rxd20JqfcE0/hIU7Sy8hHk6XTCf9qGbRNUqk3Ebdt5O6zGNdH/9BuXKk/uIDyv3f5qzzImwZadxQRalk1m6h0bvrKykUXUCX8psVQPUNeaXF2c2zhkVX1UYCVR4R44uf/5Ent8nlheGOz3+2ry9OCk/4iQSH4Xn9mH++eRltwl8gNaMv9vJrhvhvjXMpl/U/ohANW9EgA0DsERY6gU+BRGygBqZcOGuidwq9nV0xnAF5L0JU/bBro8Apb5ymRKPTAKuu9jya/6p5rERFs6DE7T31ylNzLP7vbBvG98Ak+brxTdpkO1gIA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P5AWRwAb5SuSxtzTGMPPhqtVsibAx2UXRhuEda1e3OA/Vvb7EU93336SArrbLlAm0iDZA87hR36wu2dBHC/t56XOuOnBU8Smj7ZIkeuxniuSl2+JVFdi/RD4b1n+FNfO6g02mbdvCvPlNl3NUjxCsP5zbwJIwAFz/RAtilbALnmwDdtFp0R1w0e3jtJLXIt6QgPznV4JxhRGesMgNKQ6VWOvBrHF1qjOWcyBxjZ0Gf7h5Yns/rwjswB8EmxlkoQOuZCP+ibAW8DX+rw+2bs8bxPESnQLT8lorzTcSqI8bpb/ifPKZ86riQTrR/5GRUzEsE5YCHCS5P/WqFuCbGZ8Rw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Bertrand.Marquis@xxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, sstabellini@xxxxxxxxxx, julien@xxxxxxx
  • Delivery-date: Mon, 24 Jan 2022 16:59:33 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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.

> --- a/xen/arch/x86/numa.c
> +++ b/xen/arch/x86/numa.c
> @@ -378,6 +378,24 @@ unsigned int arch_have_default_dmazone(void)
>      return ( num_online_nodes() > 1 ) ? 1 : 0;
>  }
>  
> +uint32_t __init arch_meminfo_get_nr_bank(void)

unsigned int (also elsewhere)

> +{
> +     return e820.nr_map;
> +}
> +
> +int __init arch_meminfo_get_ram_bank_range(uint32_t bank,
> +     paddr_t *start, paddr_t *end)
> +{
> +     if (e820.map[bank].type != E820_RAM || !start || !end) {

I see no reason for the checking of start and end.

> +             return -1;
> +     }

No need for braces here.

> +     *start = e820.map[bank].addr;
> +     *end = e820.map[bank].addr + e820.map[bank].size;
> +
> +     return 0;
> +}
> +
>  static void dump_numa(unsigned char key)
>  {
>      s_time_t now = NOW();

Judging by just the two pieces of patch context you're inserting
a Linux-style code fragment in the middle of two Xen-style ones.

Various other comments given for earlier patches apply here as well.

Jan




 


Rackspace

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