Skip to content

Commit

Permalink
riscv: Add support for memtest
Browse files Browse the repository at this point in the history
The riscv [rv32_]defconfig enabled CONFIG_MEMTEST,
but memtest feature is not supported in RISCV.

Add early_memtest() to support for memtest.

Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
  • Loading branch information
Kefeng Wang authored and Palmer Dabbelt committed Mar 10, 2021
1 parent a38fd87 commit f6e5aed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Documentation/admin-guide/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2794,7 +2794,7 @@
seconds. Use this parameter to check at some
other rate. 0 disables periodic checking.

memtest= [KNL,X86,ARM,PPC] Enable memtest
memtest= [KNL,X86,ARM,PPC,RISCV] Enable memtest
Format: <integer>
default : 0 <disable>
Specifies the number of memtest passes to be
Expand Down
6 changes: 4 additions & 2 deletions arch/riscv/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,9 @@ void __init setup_bootmem(void)
if (max_mapped_addr == (dram_end - 1))
memblock_set_current_limit(max_mapped_addr - 4096);

max_pfn = PFN_DOWN(dram_end);
max_low_pfn = max_pfn;
min_low_pfn = PFN_UP(memblock_start_of_DRAM());
max_low_pfn = max_pfn = PFN_DOWN(dram_end);

dma32_phys_limit = min(4UL * SZ_1G, (unsigned long)PFN_PHYS(max_low_pfn));
set_max_mapnr(max_low_pfn - ARCH_PFN_OFFSET);

Expand Down Expand Up @@ -593,6 +594,7 @@ void __init paging_init(void)

void __init misc_mem_init(void)
{
early_memtest(min_low_pfn << PAGE_SHIFT, max_low_pfn << PAGE_SHIFT);
arch_numa_init();
sparse_init();
zone_sizes_init();
Expand Down

0 comments on commit f6e5aed

Please sign in to comment.