riscv: mm: Enable PMD split page table lock for RV64
PATCH v2 1/1 riscv: mm: Enable PMD split page table lock for RV64
After commit 1355c31eeb7e ("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.
---
v2:
- rebase to v5.15-rc3, update changelog, and add RB
arch/riscv/Kconfig | 1 + arch/riscv/mm/init.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-)
arch/riscv/Kconfig +1 -0
@@ -14,6 +14,7 @@ config RISCV def_bool y select ARCH_CLOCKSOURCE_INIT select ARCH_ENABLE_HUGEPAGE_MIGRATION if HUGETLB_PAGE && MIGRATION + select ARCH_ENABLE_SPLIT_PMD_PTLOCK if PGTABLE_LEVELS > 2 select ARCH_HAS_BINFMT_FLAT select ARCH_HAS_DEBUG_VM_PGTABLE select ARCH_HAS_DEBUG_VIRTUAL if MMU
arch/riscv/mm/init.c +2 -1
@@ -367,7 +367,8 @@ static phys_addr_t __init alloc_pmd_late(uintptr_t va)unsigned long vaddr; vaddr =__get_free_page (GFP_KERNEL ); -BUG_ON (!vaddr); +BUG_ON (!vaddr || !pgtable_pmd_page_ctor (virt_to_page (vaddr))); +return __pa (vaddr); }
Signature · 7 lines
2.26.2 _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv
Hi Palmer, ping, it looks this patch is missed...
Quoted 34 lines · Kefeng Wang
After commit
1355c31eeb7e("asm-generic: pgalloc: provide genericpmd_alloc_one()andpmd_free_one()"), the main part to support PMD split page table lock is inasm-generic/pgalloc.h.The only change is add
pgtable_pmd_page_ctor()intoalloc_pmd_late(), then we could enableARCH_ENABLE_SPLIT_PMD_PTLOCKfor RV64.Reviewed-by Alexandre Ghiti <[email protected]>Signed-off-by Kefeng Wang <[email protected]>---
v2:
- rebase to v5.15-rc3, update changelog, and add RBarch/riscv/Kconfig | 1 + arch/riscv/mm/init.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-)arch/riscv/Kconfig +1
-0@@ -14,6 +14,7 @@ config RISCV def_bool y select ARCH_CLOCKSOURCE_INIT select ARCH_ENABLE_HUGEPAGE_MIGRATION if HUGETLB_PAGE && MIGRATION + select ARCH_ENABLE_SPLIT_PMD_PTLOCK if PGTABLE_LEVELS > 2 select ARCH_HAS_BINFMT_FLAT select ARCH_HAS_DEBUG_VM_PGTABLE select ARCH_HAS_DEBUG_VIRTUAL if MMUarch/riscv/mm/init.c +0
-0
arch/riscv/mm/init.c static phys_addr_t __init alloc_pmd_late(uintptr_t va) · line 374
Quoted 9 lines
arch/riscv/mm/init.c +2
-1@@ -367,7 +367,8 @@ static phys_addr_t __init alloc_pmd_late(uintptr_t va)unsigned long vaddr; vaddr =__get_free_page (GFP_KERNEL ); -BUG_ON (!vaddr); +BUG_ON (!vaddr || !pgtable_pmd_page_ctor (virt_to_page (vaddr))); +return __pa (vaddr); }
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
Palmer Dabbelt
maintainerQuoted 1 line · On Fri, 19 Nov 2021 00:14:19 PST (-0800), [email protected] wrote:
Hi Palmer, ping, it looks this patch is missed...
Sorry about that. This is on for-next, thanks!
Quoted 37 lines · Kefeng Wang
Quoted 36 lines
After commit
1355c31eeb7e("asm-generic: pgalloc: provide genericpmd_alloc_one()andpmd_free_one()"), the main part to support PMD split page table lock is inasm-generic/pgalloc.h.The only change is add
pgtable_pmd_page_ctor()intoalloc_pmd_late(), then we could enableARCH_ENABLE_SPLIT_PMD_PTLOCKfor RV64.Reviewed-by Alexandre Ghiti <[email protected]>Signed-off-by Kefeng Wang <[email protected]>---
v2:
- rebase to v5.15-rc3, update changelog, and add RBarch/riscv/Kconfig | 1 + arch/riscv/mm/init.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-)arch/riscv/Kconfig +1
-0@@ -14,6 +14,7 @@ config RISCV def_bool y select ARCH_CLOCKSOURCE_INIT select ARCH_ENABLE_HUGEPAGE_MIGRATION if HUGETLB_PAGE && MIGRATION + select ARCH_ENABLE_SPLIT_PMD_PTLOCK if PGTABLE_LEVELS > 2 select ARCH_HAS_BINFMT_FLAT select ARCH_HAS_DEBUG_VM_PGTABLE select ARCH_HAS_DEBUG_VIRTUAL if MMUarch/riscv/mm/init.c +0
-0@@ -367,7 +367,8 @@ static phys_addr_t __init alloc_pmd_late(uintptr_t va)unsigned long vaddr;
Quoted 7 lines
arch/riscv/mm/init.c static phys_addr_t __init alloc_pmd_late(uintptr_t va) · line 374
Quoted 7 lines
arch/riscv/mm/init.c +2
-1vaddr =__get_free_page (GFP_KERNEL ); -BUG_ON (!vaddr); +BUG_ON (!vaddr || !pgtable_pmd_page_ctor (virt_to_page (vaddr))); +return __pa (vaddr); }
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv