• L
    RISC-V: Implement sparsemem · d95f1a54
    Logan Gunthorpe 提交于
    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@sifive.com: fixed pfn_valid, FIXADDR_TOP and fixed a bug
     rebasing onto v5.3]
    Signed-off-by: NGreentime Hu <greentime.hu@sifive.com>
    Signed-off-by: NLogan Gunthorpe <logang@deltatee.com>
    Reviewed-by: NPalmer Dabbelt <palmer@sifive.com>
    Reviewed-by: NChristoph Hellwig <hch@lst.de>
    Cc: Albert Ou <aou@eecs.berkeley.edu>
    Cc: Andrew Waterman <andrew@sifive.com>
    Cc: Olof Johansson <olof@lixom.net>
    Cc: Michael Clark <michaeljclark@mac.com>
    Cc: Rob Herring <robh@kernel.org>
    Cc: Zong Li <zong@andestech.com>
    Reviewed-by: NMike Rapoport <rppt@linux.ibm.com>
    [paul.walmsley@sifive.com: updated to apply; minor commit message
     reformat]
    Signed-off-by: NPaul Walmsley <paul.walmsley@sifive.com>
    d95f1a54
Kconfig 6.9 KB