[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: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Wei Chen <Wei.Chen@xxxxxxx>
  • Date: Thu, 27 Jan 2022 08:03:55 +0000
  • Accept-language: en-US
  • 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=4aulY6N+wY3Q2qtoEOWjfk646UHH1xeCvrILBn0guYs=; b=oMyDl7U7SsYSEpipYQew3GxIzz2KZEdPS548LvIlPudM/oZeRNMgeMdTDXGzARSo7kjFj2C4Ev2ometfbX+LfTM0U76Xi0PlGuXuW+K/MxGhSOyc8FMbHzEbWN55dMrTHoetPY4kB4BTGtNUXDN4PjtBCoHdATkxEB3AVjTAMAjjF+FE58uv5JPAB/iVVJXOW1C7ORbLqp+UN+E/GB/i2ApsT/r3MPAKKfnQXAj4kaW273ZcWp1YtRHQhrHIQScWj86ZnVTQah8nF2yUGAW2ItnhOxq2N6g/P1W0DSAq6fLntCft3UvwcmJGIflAZ5NfYW839bmzeBalCWToW2nybA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RSJA2tO0CK2F5OioKUqhY66hFQF1sx9nsP9xz43RAlR/k3EV9JOPbzJUF9FDwcgeQYmVl3tIEn1xt98h9LWXLJEYgy6OGPIFADuW2Rhkm/F2arGUND4+aZt69C9KDvek03RSjG0sT5O3DoL/o9sRDB5+2TWY0uD4ARBy27swBOrZSjpWy83kN0F0ffPBC4gO6qAQsx45TJcf2wYdA15p0Hbj0MAJkQD8mihrLZ6mTSKW9fP4F36SiitP7QR3RPwvoU99LcutmOK8A8cX5sNxFdRtgqfIX5IpqgjdPxUkq65yAC1q1Y1NgI4KF4a0KAei07O8xuzSBASjPU5nOOA8fQ==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.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 08:04:17 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHXsHMWLK2Lk+nkCEuQGshEHTFFNqxzJoSAgAQcdmA=
  • Thread-topic: [PATCH 12/37] xen/x86: decouple nodes_cover_memory from E820 map

Hi Jan,

> -----Original Message-----
> From: Jan Beulich <jbeulich@xxxxxxxx>
> Sent: 2022年1月25日 0:59
> To: Wei Chen <Wei.Chen@xxxxxxx>
> Cc: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>; xen-
> devel@xxxxxxxxxxxxxxxxxxxx; sstabellini@xxxxxxxxxx; julien@xxxxxxx
> Subject: Re: [PATCH 12/37] xen/x86: decouple nodes_cover_memory from E820
> map
> 
> 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.

> > --- 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)
> 

OK.

> > +{
> > +   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.
> 

Yes, I have removed this checking in the latest version.

> > +           return -1;
> > +   }
> 
> No need for braces here.
> 

Ok.

> > +   *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.
> 

Yes, the original file is xen-style. I will change the inserted code
to xen-style too. Thanks!

> Jan


 


Rackspace

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