Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
vm_cpu: Eliminate hgatp and vsatp mismatch
Recently the isa manual added a clarification[1] related to avoiding invalid caching of page translation stemming from vsatp being set for one VM and hgatp configured for another transiently while running in the hypervisor. That guidance is to use the following sequence: - zero vsatp - swap hgatp - set new vsatp To ensure that sequence in salus, set vsatp to zero when saving VM registers. Additionally, on VM restore, restore vm_pages first, setting hgatp in the process if needed, and _then_ restore the vs csrs including vsatp. [1] https://github.com/riscv/riscv-isa-manual/pull/1111/files#diff-519b8bf20dee5e4eba1d389aea0a9c430c3e508a4f7518125582c055cccdc6ebR1680 Signed-off-by: Dylan Reid <dgreid@rivosinc.com>
- Loading branch information