Does SFENCE.VMA flush TLBs on all harts?
No. The official semantics apply to the current hart; a multi-hart system must make other harts execute the appropriate address-translation synchronization sequence.
Supervisor address-translation fence: rs1 selects virtual-address scope, rs2 selects ASID scope, synchronizing local page-table updates with later implicit translations.
SFENCE.VMA synchronizes explicit updates to memory-management data structures by the current hart with later implicit address translations. rs1=x0 selects all virtual addresses; otherwise the value in rs1 selects one virtual address. rs2=x0 selects all ASIDs and includes global mappings; otherwise the value in rs2 selects one ASID and global mappings are not required to be ordered. Implementations may perform a broader fence than requested. The instruction affects only the local hart; address-translation synchronization on other harts requires those harts to execute their own synchronization sequence. It is not a data-cache or instruction-cache flush instruction.
Shows the R-type SYSTEM encoding, VA/ASID scope selected by rs1/rs2, and local-hart address-translation ordering.
This animation shows only local-hart address-translation ordering/invalidated-observation semantics; it does not simulate TLB structures, caches, page-walk latency, or multi-hart shootdown protocols.
SFENCE.VMA is not an ordinary memory fence or a portable TLB-structure model. It makes later implicit translations by the local hart observe prior memory-management updates for the selected VA/ASID scope; rs2=x0 includes global mappings, while a nonzero ASID scope is not required to include global mappings.
Understand this scenario with real code like «sfence.vma x0, x0 # Fence all VA/ASID translations on this hart».
Understand this scenario with real code like «sfence.vma x0, x0 # Fence all VA/ASID translations on this hart».
Understand this scenario with real code like «sfence.vma x0, x0 # Fence all VA/ASID translations on this hart».
No. The official semantics apply to the current hart; a multi-hart system must make other harts execute the appropriate address-translation synchronization sequence.
rs1 selects virtual-address scope, with x0 meaning all virtual addresses; rs2 selects ASID scope, with x0 meaning all ASIDs and including global mappings, while a nonzero rs2 scope is not required to order global mappings.