For mstatus.GVA, the privileged spec says this:
Field GVA (Guest Virtual Address) is written by the implementation whenever a trap is taken into M-mode.For any trap (breakpoint, address misaligned, access fault, page fault, or guest-page fault) that writes a guest virtual address to mtval, GVA is set to 1. For any other trap into M-mode, GVA is set to 0
With two stage paging enabled and VSATP.mode=BARE, when a Guest Page fault is taken my interpretation of the above statement is:
- mtval = 0 (stval = 0 if Guest Page fault delegated to HS mode)
- mtval2 = GPA (htval = GPA if Guest Page fault delegated to HS mode)
- mstatus.GVA = 0 (hstatus.GVA=0 if Guest Page fault delegated to HS mode)
Since VSATP.mode=BARE there is no guest virtual address just guest physical address.
Does this interpretation make sense ? Is there something that I am missing which would cause mstatus.GVA to be set and mtval to be updated for the scenario mentioned above?
Thank you.
Note: The above lines of text appear in section 9.4.1 of RISC-V Instruction set manual (Vol 2 Privileged Architecture) version 20211203.