Skip to content

Commit e0fe5ab

Browse files
Alexandre Ghitipalmer-dabbelt
authored andcommitted
riscv: Fix pte_leaf_size() for NAPOT
pte_leaf_size() must be reimplemented to add support for NAPOT mappings. Fixes: 82a1a1f ("riscv: mm: support Svnapot in hugetlb page") Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com> Link: https://lore.kernel.org/r/20240227205016.121901-3-alexghiti@rivosinc.com Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
1 parent 16ab464 commit e0fe5ab

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

arch/riscv/include/asm/pgtable.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,10 @@ static inline pte_t pte_mkhuge(pte_t pte)
439439
return pte;
440440
}
441441

442+
#define pte_leaf_size(pte) (pte_napot(pte) ? \
443+
napot_cont_size(napot_cont_order(pte)) :\
444+
PAGE_SIZE)
445+
442446
#ifdef CONFIG_NUMA_BALANCING
443447
/*
444448
* See the comment in include/asm-generic/pgtable.h

0 commit comments

Comments
 (0)