From: Kefeng Wang Date: Fri, 30 Jul 2021 12:48:41 +0000 (+0800) Subject: riscv: Support allocating gigantic hugepages using CMA X-Git-Tag: howlett/maple/20220722_2~2380^2~6 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=8ba1a8b77ba1eb3aef441ed2caf28ab2b1261f5f;p=users%2Fjedix%2Flinux-maple.git riscv: Support allocating gigantic hugepages using CMA This patch adds support to allocate gigantic hugepages using CMA by specifying the hugetlb_cma= kernel parameter. This is only supported on RV64. Reviewed-by: Alexandre Ghiti Signed-off-by: Kefeng Wang Signed-off-by: Palmer Dabbelt --- diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c index 888dff9530b8..248f9ec393c1 100644 --- a/arch/riscv/mm/init.c +++ b/arch/riscv/mm/init.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -202,6 +203,8 @@ static void __init setup_bootmem(void) early_init_fdt_scan_reserved_mem(); dma_contiguous_reserve(dma32_phys_limit); + if (IS_ENABLED(CONFIG_64BIT)) + hugetlb_cma_reserve(PUD_SHIFT - PAGE_SHIFT); memblock_allow_resize(); }