Skip to content

Commit 5a7ac59

Browse files
Kefeng Wangpalmer-dabbelt
authored andcommitted
riscv: mm: Enable PMD split page table lock for RV64
After commit 1355c31 ("asm-generic: pgalloc: provide generic pmd_alloc_one() and pmd_free_one()"), the main part to support PMD split page table lock is in asm-generic/pgalloc.h. The only change is add pgtable_pmd_page_ctor() into alloc_pmd_late(), then we could enable ARCH_ENABLE_SPLIT_PMD_PTLOCK for RV64. Reviewed-by: Alexandre Ghiti <[email protected]> Signed-off-by: Kefeng Wang <[email protected]> Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent 7cc8c75 commit 5a7ac59

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

arch/riscv/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ config RISCV
1414
def_bool y
1515
select ARCH_CLOCKSOURCE_INIT
1616
select ARCH_ENABLE_HUGEPAGE_MIGRATION if HUGETLB_PAGE && MIGRATION
17+
select ARCH_ENABLE_SPLIT_PMD_PTLOCK if PGTABLE_LEVELS > 2
1718
select ARCH_HAS_BINFMT_FLAT
1819
select ARCH_HAS_DEBUG_VM_PGTABLE
1920
select ARCH_HAS_DEBUG_VIRTUAL if MMU

arch/riscv/mm/init.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,8 @@ static phys_addr_t __init alloc_pmd_late(uintptr_t va)
367367
unsigned long vaddr;
368368

369369
vaddr = __get_free_page(GFP_KERNEL);
370-
BUG_ON(!vaddr);
370+
BUG_ON(!vaddr || !pgtable_pmd_page_ctor(virt_to_page(vaddr)));
371+
371372
return __pa(vaddr);
372373
}
373374

0 commit comments

Comments
 (0)