Currently the machine is using Sv57 virtual memory address spacing (5 level), however nodejs does not work with Sv57, furthermore address translation with a 5 level has more overhead on TLB misses than Sv39 which only has 3 levels.
I checked there is only two ways to force using Sv39 in recent kernel:
Add no4lvl to bootargs
Disable Sv48 and Sv57 modes in satp CSR.
While option 2. would be optimal in terms of performance, I decided to go for 1. in case a dapp wants to remove no4lvl from bootargs to map more 512GB to virtual memory.
Looks like mmu-type: riscv,sv39 in DTB is ignored in recent kernels, but I left the entry there to keep supporting old kernels.
Currently the machine is using Sv57 virtual memory address spacing (5 level), however nodejs does not work with Sv57, furthermore address translation with a 5 level has more overhead on TLB misses than Sv39 which only has 3 levels.
I checked there is only two ways to force using Sv39 in recent kernel:
no4lvl
to bootargssatp
CSR.While option 2. would be optimal in terms of performance, I decided to go for 1. in case a dapp wants to remove
no4lvl
from bootargs to map more 512GB to virtual memory.Looks like
mmu-type: riscv,sv39
in DTB is ignored in recent kernels, but I left the entry there to keep supporting old kernels.