Freeze after setting SATP register

I solved problem. It was caused by missing hardware support of setting accessed and dirty PTE flags. If flags are not set access to page always trigger page fault. Kernel is supposed to set flags in page fault handler. Problem in boot loader was solved by setting accessed and dirty PTE flags during initial page table construction.

QEMU and TinyEMU set flags automatically.

Freedom U740-C000 Manual says:

It is important to note the U74 does not automatically set the accessed ( A ) and dirty ( D ) bits in a
Sv39 Page Table Entry (PTE). Instead, the U74 MMU will raise a page fault exception for a read
to a page with PTE.A=0 or a write to a page with PTE.D=0 .

3 Likes