|
[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
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
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |