Open SiFiveHolland opened 2 weeks ago
good point - how is this behavior modification spec:
The behavior of the SFENCE.VMA and the HFENCE.VMA instructions are affected when supervisor domains are used by the M-mode RDSM.
When SFENCE.VMA is used within a supervisor domain, the virtual-address argument is a virtual address with either the ASID being a S/HS-level ASID (V=0), or a VS-level ASID (V=1).
For S/HS-level ASID, the virtual-address argument to SFENCE.VMA is a host virtual address within the current supervisor domain, and the ASID argument is a S/HS-level ASID within the current supervisor domain. The current supervisor domain is identified by the SDID field of the CSR mttp, and the effective ASID can be considered the combination of the SDID and the S/HS-level ASID. The SFENCE.VMA orders stores only to this S/HS-level address-translation structures with subsequent HS-level address translations.
When V=1, the virtual-address argument to SFENCE.VMA is a guest virtual address within the current virtual machine, and the ASID argument is a VS-level ASID within the current virtual machine. The current virtual machine is identified by the SDID field of the CSR mttp, the VMID field of CSR hgatp, and the effective ASID can be considered to be the combination of this SDID and VMID with the VS-level ASID. The SFENCE.VMA instruction orders stores only to the VS-level address-translation structures with subsequent VS-stage address translations for the same virtual machine, i.e., only when mttp.SDID and the hgatp.VMID is the same as when the SFENCE.VMA executed.
@SiFiveHolland ptal PR #84 thanks
Thanks, further comments are in #84.
There is a hierarchy of ASID < VMID < SDID. The H extension specification limits the scope of the SFENCE.VMA instruction to a single VMID:
Will the SDID similarly be used to limit the scope of other SFENCE. (with or without the H extension) and HFENCE. instructions? This would need to be specified.