Privilege Level Switching and Simple Trap Implementation
{ Today I took a closer look at the VA2PA process in sv32, but I still didn't quite grasp the specifics. I originally planned to review the manual myself, briefly examine xv6, and then write my own implementation. However, I realized my understanding wasn't deep enough, so I ended up referencing xv6 to build the smallest MVP.
In the three-level page table used by sv39, the page table can be treated as a three-dimensional array. When accessing vpn[2], the address of the corresponding page is obtained. This address may point to the next subpage table. Then, using vpn[1], the corresponding PTE within that subpage table is retrieved. Similarly, vpn[0] ultimately obtains the final PTE, completing the VA2PA translation process. }