|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] RE: [XEN RFC PATCH 29/40] xen/arm: implement Arm arch helpers Arm to get memory map info
Hi Julien,
> -----Original Message-----
> From: Julien Grall <julien@xxxxxxx>
> Sent: 2021年8月26日 1:10
> To: Wei Chen <Wei.Chen@xxxxxxx>; xen-devel@xxxxxxxxxxxxxxxxxxxx;
> sstabellini@xxxxxxxxxx; jbeulich@xxxxxxxx
> Cc: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
> Subject: Re: [XEN RFC PATCH 29/40] xen/arm: implement Arm arch helpers Arm
> to get memory map info
>
> Hi Wei,
>
> On 11/08/2021 11:24, Wei Chen wrote:
> > These two helpers are architecture APIs that are required by
> > nodes_cover_memory.
> >
> > Signed-off-by: Wei Chen <wei.chen@xxxxxxx>
> > ---
> > xen/arch/arm/numa.c | 14 ++++++++++++++
> > 1 file changed, 14 insertions(+)
> >
> > diff --git a/xen/arch/arm/numa.c b/xen/arch/arm/numa.c
> > index f61a8df645..6eebf8e8bc 100644
> > --- a/xen/arch/arm/numa.c
> > +++ b/xen/arch/arm/numa.c
> > @@ -126,3 +126,17 @@ void __init numa_init(bool acpi_off)
> > numa_initmem_init(PFN_UP(ram_start), PFN_DOWN(ram_end));
> > return;
> > }
> > +
> > +uint32_t __init arch_meminfo_get_nr_bank(void)
> > +{
> > + return bootinfo.mem.nr_banks;
> > +}
> > +
> > +int __init arch_meminfo_get_ram_bank_range(int bank,
> > + unsigned long long *start, unsigned long long *end)
>
> They are physical address, so we should use "paddr_t" as on system such
> as 32-bit Arm, "unsigned long" is not enough to cover all the physical
> address.
>
> As you change the type, I would also suggest to change the bank from an
> int to an unsigned int.
>
I will fix them in next version.
> > +{
> > + *start = bootinfo.mem.bank[bank].start;
> > + *end = bootinfo.mem.bank[bank].start + bootinfo.mem.bank[bank].size;
> > +
> > + return 0;
> > +}
> >
>
> Cheers,
>
> --
> Julien Grall
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |