linux-stable/arch/riscv
Logan Gunthorpe d95f1a542c RISC-V: Implement sparsemem
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: Greentime Hu <greentime.hu@sifive.com>
Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Christoph 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: Mike Rapoport <rppt@linux.ibm.com>
[paul.walmsley@sifive.com: updated to apply; minor commit message
 reformat]
Signed-off-by: Paul Walmsley <paul.walmsley@sifive.com>
2019-08-30 11:10:37 -07:00
..
boot riscv: dts: fu540-c000: drop "timebase-frequency" 2019-07-31 12:26:10 -07:00
configs riscv: defconfig: Update the defconfig 2019-08-13 19:26:42 -07:00
include RISC-V: Implement sparsemem 2019-08-30 11:10:37 -07:00
kernel riscv: Using CSR numbers to access CSRs 2019-08-30 11:04:19 -07:00
lib riscv: Using CSR numbers to access CSRs 2019-08-30 11:04:19 -07:00
mm RISC-V: Implement sparsemem 2019-08-30 11:10:37 -07:00
net bpf, riscv: Enable zext optimization for more RV64G ALU ops 2019-07-05 23:55:41 +02:00
Kconfig RISC-V: Implement sparsemem 2019-08-30 11:10:37 -07:00
Kconfig.debug RISC-V: Remove EARLY_PRINTK support 2018-12-17 10:23:46 -08:00
Kconfig.socs riscv: select SiFive platform drivers with SOC_SIFIVE 2019-07-01 13:20:01 -07:00
Makefile riscv: drop unneeded -Wall addition 2019-07-17 10:25:10 +09:00