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.
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:
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