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