Re: [PATCH v6] RISC-V: Implement sparsemem
From: Logan Gunthorpe
Date: Thu Aug 29 2019 - 11:46:55 EST
On 2019-08-29 12:21 a.m., Mike Rapoport wrote:
> On Wed, Aug 28, 2019 at 03:40:54PM -0600, Logan Gunthorpe wrote:
>> Implement sparsemem support for Risc-v which helps pave the
>> way for memory hotplug and eventually P2P support.
>>
>> Introduce Kconfig options for virtual and physical address bits which
>> are used to calculate the size of the vmemmap and set the
>> MAX_PHYSMEM_BITS.
>>
>> The vmemmap is located directly before the VMALLOC region and sized
>> such that we can allocate enough pages to populate all the virtual
>> address space in the system (similar to the way it's done in arm64).
>>
>> During initialization, call memblocks_present() and sparse_init(),
>> and provide a stub for vmemmap_populate() (all of which is similar to
>> arm64).
>>
>> [greentime.hu@xxxxxxxxxx:
>> fixed pfn_valid, FIXADDR_TOP and fixed a bug rebasing onto v5.3]
>> Signed-off-by: Greentime Hu <greentime.hu@xxxxxxxxxx>
>> Signed-off-by: Logan Gunthorpe <logang@xxxxxxxxxxxx>
>> Reviewed-by: Palmer Dabbelt <palmer@xxxxxxxxxx>
>> Reviewed-by: Christoph Hellwig <hch@xxxxxx>
>> Cc: Albert Ou <aou@xxxxxxxxxxxxxxxxx>
>> Cc: Andrew Waterman <andrew@xxxxxxxxxx>
>> Cc: Olof Johansson <olof@xxxxxxxxx>
>> Cc: Michael Clark <michaeljclark@xxxxxxx>
>> Cc: Rob Herring <robh@xxxxxxxxxx>
>> Cc: Zong Li <zong@xxxxxxxxxxxxx>
>
> Reviewed-by: Mike Rapoport <rppt@xxxxxxxxxxxxx>
Thanks!
Logan