Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
To enable guest OS to run SDL applications using bidirectional queues, the VMM or system emulator must access the guest OS's virtual memory, as the queues are defined there. This requires MMU translation. In addition, the queues event data size likely larger than a word (maybe a page), thus the existing rv->io.mem_{read,write}_w do not sufficient for such memory manipulation. Export rv->io.mem_translate() to perform gVA2gPA translation. Unifying MMU translation logic by using rv->io.mem_translate(), eliminating redundant flows: mmu_walk -> check_pg_fault -> check_signal -> get_ppn_and_offset. Also, this interface allowing src/syscall_sdl.c to handle virtual memory by first translating the gVA2gPA, followed by memory_{read/write} the chunk of data at once. TODO: dTLB can be introduced in rv->io.mem_trans() to cache the gVA2gPA translation. See: sysprog21#310, sysprog21#510
- Loading branch information