Home/Instructions/SINVAL-VMA
SINVAL.VMA

RISC-V SINVAL.VMA Instruction Details

Instruction ManualR-type

Svinval address-translation invalidation instruction: uses rs1 virtual-address and rs2 address-space selectors to invalidate matching address-translation cache entries.

Instruction Syntax

sinval.vma rs1, rs2
Operand Breakdown
Destination rd: register receiving the operation result.
Source rs1: register holding the first operand.
Source rs2: register holding the second operand.
PrivilegedSvinvalMemory Management

Instruction Behavior

SINVAL.VMA is the supervisor address-translation invalidation instruction in the Svinval extension. It invalidates the address-translation cache entries that an SFENCE.VMA with the same rs1/rs2 operands would affect; rs1=x0 selects all virtual addresses, and rs2=x0 selects all address spaces, including global mappings. It performs invalidation and is not a generic data-cache flush; a split invalidation sequence is typically bracketed by SFENCE.W.INVAL before one or more SINVAL/HINVAL instructions and SFENCE.INVAL.IR after them.

SINVAL.VMA Decode And Svinval Animation

Shows the SYSTEM encoding, VA/ASID scope selected by rs1/rs2, and address-translation invalidation within an Svinval sequence.

rs1
rs2
sinval.vma
,
31..25
24..20
19..15
14..12
11..7
6..0
0001011
funct7
01011
rs2/ASID
01010
rs1/VA
000
funct3
00000
rd=x0
1110011
SYSTEM
Svinval Sequence State
instruction
0x16B50073
opcode
1110011 -> SYSTEM
funct7
0001011 -> SINVAL.VMA
rs1
a0(x10) -> VA 0x0000000040001000
rs2
a1(x11) -> ASID 3; globals not required
invalidate
a0(x10)=0x0000000040001000; a1(x11)=3, global mappings not required
sequence
SFENCE.W.INVAL -> SINVAL.VMA... -> SFENCE.INVAL.IR

This animation shows only the local-hart invalidation/ordering relation defined by the privileged architecture; it does not simulate TLB structures, cache flushes, page-walk latency, IPIs, or OS shootdown protocols.

Quick Understanding & Search Notes

SINVAL.VMA is about scoped invalidation: rs1 selects the virtual-address scope and rs2 selects the address-space scope; the ordering boundaries are expressed by the companion SFENCE.W.INVAL and SFENCE.INVAL.IR instructions.

rs1=x0 means all virtual addresses; rs2=x0 means all address spaces and includes global mappings.
The instruction invalidates address-translation cache entries; it is not a generic data-cache flush.
The Svinval split sequence supports batched invalidation; do not read the animation as a concrete TLB-entry walk.

Common Usage Scenarios

Svinval Sequence

Understand this scenario with real code like «sinval.vma x0, x0 # invalidate all address spaces, including global mappings».

Pre-Use Checklist

Syntax Check
  • Confirm the current instruction format is R-type.
  • Confirm the operand order matches the example.
Semantic Check
  • Ensure the destination register usage is compatible with the calling convention.
  • Confirm this is not the lower-level form of a pseudo-instruction expansion.

Pitfalls / Common Confusions

U-mode execution always raises illegal-instruction; VU-mode execution raises virtual-instruction.
S-mode or HS-mode execution with mstatus.TVM=1 raises illegal-instruction; VS-mode execution with hstatus.VTVM=1 raises virtual-instruction.
rs1=x0 selects all virtual addresses; rs2=x0 selects all address spaces and includes global mappings.
SINVAL.VMA invalidates address-translation cache entries; it is not a normal data-cache flush or a page-table-walk simulation.
Use SFENCE.W.INVAL before and SFENCE.INVAL.IR after a split Svinval sequence when that ordering is required.

FAQ

How is SINVAL.VMA related to SFENCE.VMA?

SINVAL.VMA uses the same rs1/rs2 scope selection as SFENCE.VMA for invalidating matching address-translation cache entries, while ordering in the split sequence is provided by SFENCE.W.INVAL and SFENCE.INVAL.IR.

Does rs2=x0 mean only ASID 0?

No. As a SINVAL.VMA scope selector, rs2=x0 means all address spaces and includes global mappings.

Does it flush the data cache?

No. The official semantics are address-translation cache invalidation and related ordering, not a generic data-cache flush.